GitHub

Overview

This is a Quarto filter extension that uses bytefield-svg to parse the bytefield DSL from quarto code block, generate the SVG and replace it in the HTML.

Installing

quarto add crisbour/bytefield

This will install the extension under the _extensions subdirectory. If you're using version control, you will want to check in this directory.

Using

To generate the SVG for the bytefield DSL, you would likely want to use {.bytefield} as the code block class. {bytefield} works as well, but it will cause Quarto to require a jupyter kernel unnecessary.

```{.bytefield}
(draw-column-headers)
(draw-box "Address" {:span 4})
(draw-box "Size" {:span 2})
(draw-box 0 {:span 2})
(draw-gap "Payload")
(draw-bottom)
```

Bytefield example

Documentation

The documentation for the bytefield-svg DSL

Example

Here is the source code for a minimal example: example.qmd.

Resources

[WARN] I am not sure whether the best approach is to attach installed npm package

Read the original on github.com ↗