Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Commit e360d07

Browse files
committed
Added stuff to README
1 parent 6e1736d commit e360d07

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

README.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,26 @@ A Proof of Concept application that generates a PDF given a `model` consisting o
66

77
### Development
88

9-
Typst template development can be done in several ways. Via the `typst-cli`, The [online Typst editor](https://typst.app/), or via this Rust program by running:
9+
Typst template development can be done in several ways. Via the `typst-cli`, The [online Typst editor](https://typst.app/), or via this Rust program.
1010

11+
Here is an example command for running the Model O 7 template:
1112
```console
12-
$ cargo watch -x run
13+
$ cargo watch -x "run -- model-o-7 templates/inputs/model-o-7.json"
1314
```
1415

16+
This will restart the program every time it detects a change in the source or template files. Since in development the template files are _not_ stored in the binary, recompilation is not needed when only the template files are changed, which will speed up the restart time of the program.
17+
1518
To develop Typst in your editor of choice, there is a [Typst language server](https://github.com/nvarner/typst-lsp) available and a [Tree-sitter grammar](https://github.com/uben0/tree-sitter-typst).
1619

20+
#### Fonts
21+
22+
When using the Rust application, the fonts will be available via the binary and no further configuration will be needed. For the CLI, you need to point to the fonts folder via `typst compile --font-path path/to/font`
23+
24+
#### Input data
25+
26+
The data used to render the templates should be provided in JSON format. When the provided JSON is in the wrong format, `serde-json` will throw an error.
27+
When introducing a new field, you should add it to the according `PdfModel` enum variant, so it will be type-checked.
28+
1729
### Packaging
1830

19-
This Proof of Concept tries to make installation as easy as possible by embedding all assets in the binary. When running or building in release mode (`cargo build --release`), all Typst files and fonts are embedded into the binary and used from memory when running the application.
31+
This Proof of Concept tries to make installation as easy as possible by embedding all assets in the binary. When running or building in release mode with `cargo build --release`, all Typst files and fonts are embedded into the binary and used from memory when running the application.

0 commit comments

Comments
 (0)