<!-- generated by running `just docs readme` -->
# mdbook-permalinks
<div class="hidden">
**For best results, view this page at [https://docs.tonywu.dev/mdbookkit/permalinks](https://docs.tonywu.dev/mdbookkit/).**
</div>
Permalinks in [mdBook]!
With this [preprocessor], you can easily link to any file in your Git repository in your
mdBook documentation, without having to hard-code URLs or worry about broken links.
You simply write ...
```md
Here is a link to the project's [Cargo.toml](/Cargo.toml).
```
... and you will get:
<figure class="fig-text">
Here is a link to the project's [Cargo.toml](https://github.com/tonywu6/mdbookkit/tree/88431989183b48e8c052751b39f547e8824ea677/Cargo.toml).
</figure>
## Overview
Follow the [quickstart tutorial](https://docs.tonywu.dev/mdbookkit/getting-started.html) to try out the preprocessor!
Feature highlights:
- [Use file paths as links](https://docs.tonywu.dev/mdbookkit/getting-started.html#linking-by-paths). The preprocessor
converts them to links to your Git repository.
- Links are anchored to the Git commit at the time your book is built.
- Supports repositories on GitHub, Codeberg, and Tangled out of the box, but you can
also
[define your own permalink format](https://docs.tonywu.dev/mdbookkit/how-to/remote-url.html#using-a-custom-permalink-format).
- Use permalinks to display [images](https://docs.tonywu.dev/mdbookkit/getting-started.html#images) and
[media files](https://docs.tonywu.dev/mdbookkit/getting-started.html#html-links).
- [Get warnings](https://docs.tonywu.dev/mdbookkit/getting-started.html#check) when links become broken.
<figure>
<svg width="740px" height="200px" xmlns="http://www.w3.org/2000/svg"> <style> .fg { fill: #B2B2B2 } .bg { fill: #1A1A1A } .fg-bright-blue { fill: #5CADF1 } .fg-yellow { fill: #D19A66 } .container { padding: 0 10px; line-height: 18px; } .bold { font-weight: bold; } tspan { font: 14px Menlo, Roboto Mono, Ubuntu Mono, Liberation Mono, Consolas, ui-monospace, monospace; white-space: pre; line-height: 18px; } </style> <rect width="100%" height="100%" y="0" class="bg" /> <text xml:space="preserve" class="container fg"> <tspan x="10px" y="28px"><tspan class="fg-yellow bold">warning</tspan><tspan class="bold">: broken link to "../nook.toml"</tspan> </tspan> <tspan x="10px" y="46px"><tspan> </tspan><tspan class="fg-bright-blue bold"> ╭▸ </tspan><tspan>src/tutorial.md:1:19</tspan> </tspan> <tspan x="10px" y="64px"><tspan> </tspan><tspan class="fg-bright-blue bold">│</tspan> </tspan> <tspan x="10px" y="82px"><tspan class="fg-bright-blue bold">1</tspan><tspan> </tspan><tspan class="fg-bright-blue bold">│</tspan><tspan> See [`book.toml`](</tspan><tspan class="fg-yellow bold">../nook.toml</tspan><tspan>) for more info.</tspan> </tspan> <tspan x="10px" y="100px"><tspan> </tspan><tspan class="fg-bright-blue bold">│</tspan><tspan> </tspan><tspan class="fg-yellow bold">┯━━━━━━━━━━━</tspan> </tspan> <tspan x="10px" y="118px"><tspan> </tspan><tspan class="fg-bright-blue bold">│</tspan><tspan> </tspan><tspan class="fg-bright-blue bold">│</tspan> </tspan> <tspan x="10px" y="136px"><tspan> </tspan><tspan class="fg-bright-blue bold">│</tspan><tspan> </tspan><tspan class="fg-yellow bold">resolves to a path that doesn't exist:</tspan> </tspan> <tspan x="10px" y="154px"><tspan> </tspan><tspan class="fg-bright-blue bold">╰╴</tspan><tspan> </tspan><tspan class="fg-bright-blue bold">"nook.toml"</tspan> </tspan> <tspan x="10px" y="172px"> </tspan> <tspan x="10px" y="190px"><tspan class="fg-yellow"> WARN</tspan><tspan> </tspan><tspan class="bold">mdbook-permalinks</tspan><tspan>: finished with warnings</tspan> </tspan> </text> </svg>
<figcaption>
Link rot happens all the time. The preprocessor will tell you about it.
</figcaption>
</figure>
## License
This project is released under the [Apache 2.0 License](https://github.com/tonywu6/mdbookkit/tree/88431989183b48e8c052751b39f547e8824ea677/LICENSE-APACHE.md) and the
[MIT License](https://github.com/tonywu6/mdbookkit/tree/88431989183b48e8c052751b39f547e8824ea677/LICENSE-MIT.md).
<!-- prettier-ignore-start -->
[mdBook]: https://rust-lang.github.io/mdBook/
[preprocessor]: https://rust-lang.github.io/mdBook/format/configuration/preprocessors.html
<!-- prettier-ignore-end -->