Back in 2018 I migrated dtmo from gitbook to [mdbook](https://github.com/rust-lang/mdBook) (see [the pull request](https://github.com/mozilla/firefox-data-docs/pull/187)).
mdbook is maintained by the Rust project and hosts the [Rust book](https://doc.rust-lang.org/book/) as well as a multitude of other community projects.
It provided all we need, plus a way to extend it with some small things, I blogged about [ToC and mermaid](http://localhost:8000/2019/07/11/mdbook-toc-and-mermaid-preprocessors/) before.
During the Mozilla All Hands last week my colleague Mike casually asked why we don't have links to quickly edit the documentation.
When someone discovers a mistake or inaccuracy in the book the current process involves finding the repository of the book, then finding the right file, then edit that file (through the GitHub UI or by cloning the repository),
then push changes, open a pull request, wait for review and finally get it merged and deployed.
I immediately set out to build this feature.
I present to you: **[mdbook-open-on-gh](https://github.com/badboy/mdbook-open-on-gh/)**
It's another preprocessor for mdbook, that adds a link to the edit dialog on GitHub (if your book is actually hosted on GitHub).
And that's how it looks:
![Screenshot of a Glean SDK book site showing the "Edit this file on GitHub" link](https://tmp.fnordig.de/blog/2020/open-on-gh-gleanbook.png)
It's already deployed on dtmo and the Glean SDK book and simplifies the workflow to: click the link, edit the file on GitHub, commit and open a PR, get a review and merge it to deploy.
If you want to use this preprocessor, install it:
```
cargo install mdbook-open-on-gh
```
Add it as a preprocessor to your `book.toml`:
```toml
[preprocessor.open-on-gh]
command = "mdbook-open-on-gh"
renderer = ["html"]
```
Add a repository URL to use as a base in your `book.toml`: