From 00fcd9041f75fa383e5de2287122bed3b984b57d Mon Sep 17 00:00:00 2001 From: arne314 <73391160+arne314@users.noreply.github.com> Date: Tue, 28 Jan 2025 17:18:58 +0100 Subject: [PATCH] docs: minor fixes --- README.md | 60 +++++++++++++++++++++++------------------------- src/anki/main.py | 2 +- 2 files changed, 30 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index 8d381de..faf87e0 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Math snippets: - Alphanumeric characters: `:` → `$$ ` in markup (e.g. `:X` → `$X$ `, `:5` → `$5$ `) - Greek letters: `;` → `` in math and `$$ ` in markup (e.g. `;a` → `alpha`/`$alpha$ `) - Common indices (numbers and letters `i-n`): ` ` → `_ ` in math and `$$ ` → `$_$ ` in markup (e.g `A314 ` → `A_314 `, `$alpha$n ` → `$alpha_n$ `) -- Series of numbered letters: ` ot ` → `_1, _2, ... ` (e.g. `a ot ` → `a_1, a_2, ... `, `a ot4 ` → `a_1, a_2, a_3, a_4 `, `alpha ot k ` → `alpha_1, alpha_2, ..., alpha_k `) +- Series of numbered letters: ` ot ` → `_1, _2, ... ` (e.g. `a ot ` → `a_1, a_2, ... `, `a ot4 ` → `a_1, a_2, a_3, a_4 `, `alpha otk ` → `alpha_1, alpha_2, ..., alpha_k `) - Wrapping of any mathematical expression (see [operations](./lua/typstar/snippets/visual.lua), works nested, multiline and in visual mode via the [selection key](#installation)): `` → `()` (e.g. `(a^2+b^2)rt` → `sqrt(a^2+b^2)`, `lambdatd` → `tilde(lambda)`, `(1+1)sQ` → `[1+1]`, `(1+1)sq` → `[(1+1)]`) - Matrices: `ma` and `lma` (e.g. `23ma` → 2x3 matrix) @@ -75,42 +75,13 @@ present in Anki ## Installation -Install the plugin in Neovim and run the plugin setup. +Install the plugin in Neovim (see [Nix instructions](#in-a-nix-flake-optional)) and run the plugin setup. ```lua require('typstar').setup({ -- depending on your neovim plugin system -- your typstar config goes here }) ``` -### In a Nix Flake -You can add typstart to your `nix-flake` like so: -```nix -# `flake.nix` -inputs = { - # ... other inputs - typstar = { - url = "github:arne314/typstar"; - flake = false; - }; -} -``` -Now you can use `typstar` in any package-set -```nix -with pkgs [ - # - # other packges ... - # - (pkgs.vimUtils.buildVimPlugin { - name = "typstar"; - src = inputs.typstar; - buildInputs = [ - vimPlugins.luasnip - vimPlugins.nvim-treesitter-parsers.typst - ]; - }) -] -``` - ### Snippets 1. Install [LuaSnip](https://github.com/L3MON4D3/LuaSnip/), set `enable_autosnippets = true` and set a visual mode selection key (e.g. `store_selection_keys = ''`) in the configuration 2. Install [jsregexp](https://github.com/kmarius/jsregexp) as described [here](https://github.com/L3MON4D3/LuaSnip/blob/master/DOC.md#transformations) (You will see a warning on startup if jsregexp isn't installed properly) @@ -130,6 +101,33 @@ with pkgs [ 3. Install the typstar python package (I recommend using [pipx](https://github.com/pypa/pipx) via `pipx install git+https://github.com/arne314/typstar`, you will need to have python build tools and clang installed) \[Note: this may take a while\] 4. Make sure the `typstar-anki` command is available in your `PATH` or modify the `typstarAnkiCmd` option in the [config](#configuration) +### In a Nix Flake (optional) +You can add typstar to your `nix-flake` like so +```nix +# `flake.nix` +inputs = { + # ... other inputs + typstar = { + url = "github:arne314/typstar"; + flake = false; + }; +} +``` +Now you can use `typstar` in any package-set +```nix +with pkgs; [ + # ... other packges + (pkgs.vimUtils.buildVimPlugin { + name = "typstar"; + src = inputs.typstar; + buildInputs = [ + vimPlugins.luasnip + vimPlugins.nvim-treesitter-parsers.typst + ]; + }) +] +``` + ## Configuration Configuration options can be intuitively derived from the table [here](./lua/typstar/config.lua). diff --git a/src/anki/main.py b/src/anki/main.py index 8296ae3..08f0e6b 100644 --- a/src/anki/main.py +++ b/src/anki/main.py @@ -62,7 +62,7 @@ def cmd( reimport: Annotated[ bool, typer.Option( - help="Instead of throwing an error also add flashcards that have already been asigned an id" + help="Instead of throwing an error also add flashcards that have already been asigned an id " "but are not present in Anki. The asigned id will be updated." ), ] = False,