1. Welcome
1.1. Introduction
adbook
is a tool for building book-like webpages. Notes:
1.2. Installation
Rust & adbook
If you have Rust, adbook
is available via Crates.io:
$ cargo install adbook # -> $HOME/.cargo/bin
Ruby & Asciidoctor
You need Ruby and some package manager. I recommend RVM because programs installed with it ran faster than that were with rbenv
(somehow).
Then let’s get Asciidoctor gems:
$ gem install asciidoctor
$ gem install asciidoctor-diagram
We’re ready!
2. Usage
2.1. New project
Let’s create a new book:
$ adbook init my-book
Initialized a new adbook project at my-book
And see the files in it:
$ tree my-book/ -L 2
my-book/
├── book.ron (1)
├── site (2)
└── src (3)
├── article.adoc
├── index.adoc
├── index.ron (4)
└── static
3 directories, 4 files
1 | book.ron is the root configuration file. |
2 | site is the default output directory. |
3 | src is the source file directory. |
4 | index.ron is very similar to mod.rs . |
2.2. Configuration files
Configruation files are in Ron format.
For details, check out the source files of this demo.
2.3. Build
Let’s get into the book directory:
$ cd my-book
We can build our book as this:
$ # Build the book (using the cached files in `.adbook-cache/`
$ adbook build
$ # Build the book, clearing all the cache.
$ # Use the `-f` option on e.g. adding new files:
$ adbook build --force
2.4. Serving the site
adbook does not have serve
command (yet). Use other commands:
From one shell..
$ python3 -m http.server 8050
From another shell..
$ watchexec -e adoc,ron -w src adbook b
3. References
3.1. Asciidoctor documentations
-
AsciiDoc Syntax Quick Reference
This is good for learning AsciiDoc for the first time.
-
The well-written manual.
-
Asciidoctor User Manual (unofficial chunked version)
Chunked version of the old manual site generated with asciidoctor-chunker
3.2. Alternatives to adbook
-
A modular documentation site generator. Designed for users of Asciidoctor.
-
A multipage HTML converter for Asciidoctor
-
The utility to create chunked HTML files from the single HTML generated by Asciidoctor.
-
Maybe other SSGs such as MKDocs
-
Maybe org-mode