Skip to content

Latest commit

 

History

History
84 lines (58 loc) · 1.34 KB

README.md

File metadata and controls

84 lines (58 loc) · 1.34 KB

quarto-kroki

Render Kroki diagrams in Quarto documents (HTML and PDF).

This uses the Kroki HTTP API via curl, doing a POST request.

Installing

quarto add fermarsan/quarto-kroki

This will install the extension under the _extensions subdirectory.

Usage

Here is how you add the filter to a page (it can also be added to a _quarto.yml project file with the same syntax):

---
title: "My Document"
filters:
  - quarto-kroki
---

And then add the following markdown in your quarto file:

```kroki-<diagram_kind>
    diagram code
```

for instance:

```kroki-graphviz
digraph G { 
  Hello -> World 
}
```

or

```kroki-ditaa
+---------+    +---------+
|  Hello  |--->|  World  |
+---------+    +---------+
```

Make sure you have curl is installed and available in your PATH.

Examples

There are two source code minimal examples:

For PDF output

If the pdf output format is enabled, you can insert Kroki diagrams via inkscape:

---
title: "My Document"
filters:
  - quarto-kroki
format: pdf
---

In that case make sure you have inkscape installed and available in your PATH.