book: Add support for logging git revision (about.md)

We can now add the book's current git revision to pages. Eventually,
this can be used to track divergence between what's running live and
what's at HEAD.

To do this, we add some machinery to our preprocessor. It will make it
easy should we want to extend this in the future.

For now, we've added this to the end of the "about.md" page.

Change-Id: I757f419638e2d1532784972cda7a9d9a1bc0fa78
Reviewed-on: https://chromium-review.googlesource.com/c/graphics-book/+/3781185
Reviewed-by: Jim Shargo <jshargo@chromium.org>
3 files changed
tree: 220413a1bd2e5481a3bbcce7b18f1e663240c776
  1. js/
  2. scripts/
  3. src/
  4. .firebaserc
  5. .gitignore
  6. book.toml
  7. firebase.json
  8. PRESUBMIT.py
  9. README.md
README.md

The Chrome Graphics Book

About

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/

Special Features

This mdbook supports some homebrew markdown extensions. These are provided by scripts/preprocess-graphics-book.py.

Nomnoml diagrams

One can create in-line nomnoml diagrams by formatting a code block like so:

``` diagram=nomnoml
[foo] -> [bar]
```

Text replacements

We also support special text replacements:

  • $$GIT_REV$$ is replaced by the current git revision

How To: Run the book locally

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

Deployment

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