rivet-typst/README.md

41 lines
1.2 KiB
Markdown
Raw Permalink Normal View History

2024-05-19 10:17:37 +00:00
# rivet-typst
2024-05-19 16:03:52 +00:00
RIVET _(Register / Instruction Visualizer & Explainer Tool)_ is a [Typst](https://typst.app) package for visualizing binary instructions or describing the contents of a register, using the [CeTZ](https://typst.app/universe/package/cetz) package.
2024-05-19 16:08:52 +00:00
It is based on the [homonymous Python script](https://git.kb28.ch/HEL/rivet/)
2024-05-19 16:03:52 +00:00
## Examples
<table>
<tr>
<td>
<a href="./gallery/example1.typ">
2024-05-19 16:08:52 +00:00
<img src="./gallery/example1.png" width="1000px">
2024-05-19 16:03:52 +00:00
</a>
</td>
</tr>
<tr>
<td>A bit of eveything</td>
</tr>
<tr>
<td>
<a href="./gallery/example2.typ">
2024-05-19 16:08:52 +00:00
<img src="./gallery/example2.png" width="1000px">
2024-05-19 16:03:52 +00:00
</a>
</td>
</tr>
<tr>
<td>RISC-V memory instructions (blueprint)</td>
</tr>
</table>
*Click on the example image to jump to the code.*
## Usage
2024-10-02 16:54:42 +00:00
For more information, see the [manual](manual.pdf)
2024-05-19 16:03:52 +00:00
2024-10-02 16:54:42 +00:00
To use this package, simply import `schema` from [rivet](https://typst.app/universe/package/rivet) and call `schema.load` to parse a schema description. Then use `schema.render` to render it, et voilà !
2024-05-19 16:03:52 +00:00
```typ
2024-10-02 16:54:42 +00:00
#import "@preview/rivet:0.1.0": schema
2024-05-19 16:03:52 +00:00
#let doc = schema.load("path/to/schema.yaml")
#schema.render(doc)
2024-10-02 16:54:42 +00:00
```