book: Support text-based nomnoml blocks This change adds support for inline nomnoml diagrams so that they're easier to update and we don't need to render images separately. Support was added via an mdbook preprocessor written in python. The processor, which you can find in `scripts/preprocess-graphics-book.py`, rewrites code blocks that start with "diagram=nomnoml". It currently uses a pretty naive hand-written regex "parser" to find the blocks, but it could certainly be cleaned up in the future. As a proof of concept, I've replaced the processes/threads diagram with raw source. Change-Id: If3bf55494efacb8ec12162089cb24e72f8ddb90b Reviewed-on: https://chromium-review.googlesource.com/c/graphics-book/+/3781184 Reviewed-by: Jim Shargo <jshargo@chromium.org>
This is the source code for a public book and living document capturing the high level architecture and low-level details of graphics in Chrome and ChromeOS.
This book is currently written with https://rust-lang.github.io/mdBook/
This mdbook supports some homebrew markdown extensions. These are provided by scripts/preprocess-graphics-book.py.
One can create in-line nomnoml diagrams by formatting a code block like so:
``` diagram=nomnoml [foo] -> [bar] ```
First, install mdbook following the guide [0].
Then, to build and run the book locally, run the command mdbook serve. This will start a local server that you can connect to at localhost:3000.
[0] https://rust-lang.github.io/mdBook/guide/installation.html
The book is currently deployed at firebase. The public URL is https://graphics-book.web.app.
With the appropriate permissions on the project, one can build and push the book like so:
$ mdbook build && firebase deploy