mirror of
https://github.com/Ascyii/typstar.git
synced 2026-01-01 05:24:24 -05:00
docs: minor fixes
This commit is contained in:
60
README.md
60
README.md
@@ -24,7 +24,7 @@ Math snippets:
|
||||
- Alphanumeric characters: `:<char>` → `$<char>$ ` in markup (e.g. `:X` → `$X$ `, `:5` → `$5$ `)
|
||||
- Greek letters: `;<latin>` → `<greek>` in math and `$<greek>$ ` in markup (e.g. `;a` → `alpha`/`$alpha$ `)
|
||||
- Common indices (numbers and letters `i-n`): `<letter><index> ` → `<letter>_<index> ` in math and `$<letter>$<index> ` → `$<letter>_<index>$ ` in markup (e.g `A314 ` → `A_314 `, `$alpha$n ` → `$alpha_n$ `)
|
||||
- Series of numbered letters: `<letter> ot<optional last index> ` → `<letter>_1, <letter>_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: `<letter> ot<optional last index> ` → `<letter>_1, <letter>_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)): `<expression><operation>` → `<operation>(<expression>)` (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: `<size>ma` and `<size>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 = '<Tab>'`) 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).
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user