Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zachhannum/mkdocs-autolinks-plugin
An MkDocs plugin that automagically generates relative links between markdown pages
https://github.com/zachhannum/mkdocs-autolinks-plugin
documentation markdown mkdocs plugin
Last synced: 28 days ago
JSON representation
An MkDocs plugin that automagically generates relative links between markdown pages
- Host: GitHub
- URL: https://github.com/zachhannum/mkdocs-autolinks-plugin
- Owner: zachhannum
- License: mit
- Created: 2020-01-14T17:57:51.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-04-02T11:27:28.000Z (7 months ago)
- Last Synced: 2024-10-01T10:01:48.943Z (about 1 month ago)
- Topics: documentation, markdown, mkdocs, plugin
- Language: Python
- Homepage: https://pypi.org/project/mkdocs-autolinks-plugin/
- Size: 21.5 KB
- Stars: 78
- Watchers: 4
- Forks: 31
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome - zachhannum/mkdocs-autolinks-plugin - An MkDocs plugin that automagically generates relative links between markdown pages (Python)
- jimsghstars - zachhannum/mkdocs-autolinks-plugin - An MkDocs plugin that automagically generates relative links between markdown pages (Python)
README
# MkDocs Autolinks Plugin
An MkDocs plugin that simplifies relative linking between documents.
The Autolinks plugins allows you to link to pages and images within your MkDocs site without provided the entire relative path to the file in your document structure.
## Setup
Install the plugin using pip:
`pip install mkdocs-autolinks-plugin`
Activate the plugin in `mkdocs.yml`:
```yaml
plugins:
- search
- autolinks
```> **Note:** If you have no `plugins` entry in your config file yet, you'll likely also want to add the `search` plugin. MkDocs enables it by default if there is no `plugins` entry set, but now you have to enable it explicitly.
More information about plugins in the [MkDocs documentation](https://www.mkdocs.org/dev-guide/plugins/).
## Usage
To use this plugin, simply create a link that only contains the filename of file you wish to link to.
For example, say you have a document structure like this:
```
docs/
├── guides/
│ ├── onboarding.md
│ └── syntax_guide.md
├── software/
│ ├── git_flow.md
│ └── code_reviews.md
└── images/
├── avatar.png
└── example.jpg
```Normally, if you want create a link to `git_flow.md` from inside `onboarding.md`, you would need to provide the relative path:
```markdown
# onboarding.md
[Git Flow](../software/git_flow.md)
```This link is fragile; if someone decides to rearrange the site structure, all of these relative links break. Not to mention having to figure out the relative path.
With the Autolinks plugin, you simply need to provide the filename you wish to link to. The plugin will pre-process all of your markdown files and replace the filename with the correct relative path, given that the file exists in your document structure:
```markdown
# onboarding.md
[Git Flow](git_flow.md)
```The Autolinks plugin works with the following extension types:
* md
* png
* jpg
* jpeg
* bmp
* gif
* svg
* webp