f4c3fc7f61e1a58bb85055376aad6a46e06c8572
With left-labels a description is placed by subtracting its width from desc-x. That width was estimated as half the font size per character, which undershoots Ubuntu Mono's advance of 0.56em by 12%, so the leader line struck through the last letter of every label, as it does on the manual's own cover page. Proportional fonts were off by more. render is now a context block, so the text can be measured instead. The font has to be passed explicitly: the set rule at the top of render is not in scope for a measure further down the same context block.
rivet-typst
RIVET (Register / Instruction Visualizer & Explainer Tool) is a Typst package for visualizing binary instructions or describing the contents of a register, using the CeTZ package.
It is based on the homonymous Python script
Examples
|
| A bit of eveything |
|
| RISC-V memory instructions (blueprint) |
Click on the example image to jump to the code.
Usage
For more information, see the manual
To use this package, simply import schema from rivet and call schema.load to parse a schema description. Then use schema.render to render it, et voilà !
#import "@preview/rivet:0.3.1": schema
#let doc = schema.load(yaml("path/to/schema.yaml"))
#schema.render(doc)
Description
Register / Instruction Visualizer & Explainer Tool with Typst, using CeTZ
https://typst.app/universe/package/rivet
Readme
Apache-2.0
3.8 MiB