Adock is an Asciidoctor CLI wrapper that lets you compile and live preview Asciidoctor documents.
Here’s how to get started:
-
Make sure you have the following tools installed:
-
Docker version 28.2.2 or later. You can check this by running
docker --version.
-
-
Download the
adockscript and optionally put it in yourPATH. -
Run
echo 'Hello, world!' >foo.adocto create a simple Asciidoctor document, then runadock foo.adocto compile it intofoo.html. -
Run
adock -s foo.adocto do the same thing as the previous step, but this time also running an HTTP server on0.0.0.0:8080to preview the document. Openhttp://127.0.0.1:8080in a browser and click onfoo.htmlto view the document. The document will be automatically recompiled and your browser will automatically refresh as you make changes tofoo.adoc. When you’re done, press Ctrl+C to stop and remove the Docker container. -
Run
adock -ds foo.adocto do the same thing as the previous step, but this time running the Docker container in the background instead of the foreground. When you’re done, rundocker rm -f adockto stop and remove the Docker container. -
Run
adock -uto pull the latest version of the Docker image and download and replaceadockitself with the latest version ofadock. -
For more advanced usage, see the man page.
Adock includes an Asciidoctor PDF theme file /adock-theme.yml that
can be used to add KaTeX fonts to the font catalog.
The fonts are named KaTeX_Main and KaTeX_Typewriter.
The fonts also have some extra glyphs added to them.
Here’s an example of how to use this in your own theme file:
extends: - /adock-theme.yml base: font-family: KaTeX_Main code: font-family: KaTeX_Typewriter codespan: font-family: KaTeX_Typewriter
-
Asciidoctor Mathematical is patched to improve the size of math expressions.
-
Lasem, which is a dependency of Asciidoctor Mathematical, is patched with the following changes:
-
KaTeX fonts are used instead of generic fonts.
-
A bug that was preventing
\mathttfrom working is fixed.
-
Asciidoctor Diagram can be enabled using the -r
option of asciidoctor with asciidoctor-diagram as the argument.
For example:
adock -r asciidoctor-diagram foo.adoc.
The following diagram types are supported: