# mdbook-permalinks
<div class="hidden">
**For best results, view this page at [https://docs.tonywu.dev/mdbookkit/permalinks](https://docs.tonywu.dev/mdbookkit/permalinks/index).**
</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/9fee25e50b174d4a456cad976f744198498d53ff/Cargo.toml).
</figure>
## Overview
Follow the [quickstart tutorial](https://docs.tonywu.dev/mdbookkit/permalinks/getting-started) to try out the preprocessor!
Feature highlights:
- [Use file paths as links](https://docs.tonywu.dev/mdbookkit/permalinks/getting-started#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/permalinks/how-to/remote-url#using-a-custom-permalink-format).
- Use permalinks to display [images](https://docs.tonywu.dev/mdbookkit/permalinks/getting-started#images) and
[media files](https://docs.tonywu.dev/mdbookkit/permalinks/getting-started#html-links).
- [Get warnings](https://docs.tonywu.dev/mdbookkit/permalinks/getting-started#check) when links become broken.
<figure>
<img src="https://github.com/tonywu6/mdbookkit/raw/9fee25e50b174d4a456cad976f744198498d53ff/crates/mdbook-permalinks/tests/book_homepage/stderr/data.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/9fee25e50b174d4a456cad976f744198498d53ff/LICENSE-APACHE.md) and the
[MIT License](https://github.com/tonywu6/mdbookkit/tree/9fee25e50b174d4a456cad976f744198498d53ff/LICENSE-MIT.md).
[mdBook]: https://rust-lang.github.io/mdBook/
[preprocessor]: https://rust-lang.github.io/mdBook/format/configuration/preprocessors.html