Doks 1.2
December 23, 2023 by
Henk Verlinde—2 minutes

Doks 1.2 is out! This release features support for diagrams, extended code blocks formatting, and more.
To upgrade an existing project, see the Upgrade Doks guide.
Highlights
Diagrams Support
Diagrams are now available in 1.2. You can use a fenced code block to embed an SVG image of a diagram in your Doks site using the free Kroki service.
Kroki generates diagrams from textual descriptions, and provides a unified API with support for D2, Mermaid, PlantUML, and other diagram types
```kroki {type=mermaid}
gantt
title A Gantt Diagram
dateFormat YYYY-MM-DD
section Section
A task :a1, 2014-01-01, 30d
Another task :after a1, 20d
section Another
Task in Another :2014-01-12, 12d
another task :24d
```
Read more about diagrams in our documentation.
Code blocks formatting
Doks now extends the formatting possibilities for code blocks. Code blocks can be rendered inside a window-like frame. A frame that looks like a terminal window will be used for shell scripting languages (e.g. bash
or sh
). Other languages display inside a code editor-style frame if they include a title.
A code block’s optional title can be set with a title="..."
attribute following the code block’s opening backticks and language identifier.
npm install @thulite/doks-core@latest
```bash
npm install @thulite/doks-core@latest
```
if ([1, "one", 2, "two"].includes(value)) {
console.log("Number is either 1 or 2."); // comment
}
```js {title="count.js"}
if ([1, "one", 2, "two"].includes(value)) {
console.log("Number is either 1 or 2."); // comment
}
```
Also, you now can add line numbers and line highlighting. Read more about code blocks in our documentation.
Bug Fixes
Additional bug fixes are included in this release. Check out the release notes to learn more.