Update README

This commit is contained in:
Jack
2023-04-03 19:25:42 +01:00
parent 6995776fbd
commit c54ed792c3
2 changed files with 20 additions and 5 deletions

View File

@ -2,14 +2,26 @@
Renders `typst` code blocks into images using [Typst](https://github.com/typst/typst) through the power of WASM! This is still very much in development, so suggestions/bugs are welcome!
**NOTE**: The plugin has to load fonts at startup, which on my machine takes about 20s but after that its *heckin* fast.
## Things to NOTE
- Typst does not currently support exporting to HTML only PDFs and PNGs. So due to image scaling, the rendered views may look a bit terrible. If you know how to fix this PLEASE HELP.
- File paths should be relative to the vault folder.
- System fonts are not loaded by default as this takes about 20 seconds (on my machine). Their is an option in settings to enable them (requires a reload of the plugin).
## Example
### `conf.typ`
```typst
#let styling(ct) = {
set page(width: 525pt, height: auto, margin: (x: 0pt, y: 1pt))
set heading(numbering: "1.")
set text(white)
ct
}
```
### `Typst.md`
```
```typst
#set page(width: 10cm, height: auto)
#set heading(numbering: "1.")
#set text(white)
#import "conf.typ": styling
#show: styling
= Fibonacci sequence
The Fibonacci sequence is defined through the
@ -33,6 +45,7 @@ The first #count numbers of the sequence are:
..nums.map(n => $F_#n$),
..nums.map(n => str(fib(n))),
))
```
```
@ -42,8 +55,10 @@ The first #count numbers of the sequence are:
Until this plugin is submitted to the community plugins please install it by copying `main.js`, `styles.css`, and `manifest.json` from the releases tab to the folder `.obsidian/plugins/obsidian-typst`.
## TODO / Goals (In no particular order)
- [ ] Better font loading
- [x] Better font loading
- [x] Fix importing
- [ ] Fix Github Actions
- [ ] Better error handling
- [ ] Fix output image scaling
- [ ] Use HTML output
- [ ] Override default equation rendering

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 34 KiB