Simplify linking between different MkDocs pages
Project description
mkdocs-crosslink-plugin
This package allows you to add links to other MkDocs (or similar page generator) sites.
Usage
First install the PyPI package:
pip install mkdocs-crosslink-plugin
Add something like the following to your mkdocs.yml
:
plugins:
- search
- crosslink:
crosslinks:
- name: alpha
source_dir: site_a/docs
target_url: http://localhost:8000/site_a/
use_directory_urls: False
- name: "example"
source_dir: /var/www/html/example.com/
target_url: https://example.com/
use_directory_urls: True
Each crosslink has the following attributes:
name
: How you reference the site. By default the schema isx-NAME:FILE_NAME
(so for examplex-alpha:my-image.png
).source_dir
is the directory containing the Markdown files.target_url
is the path, where the site corresponding to thesource_dir
files are hosted.use_directory_urls
should correspond to the target site'suse_directory_urls
settings.- If enabled
path/index.md
will be mapped topath/
andpath/test.md
will be mapped topath/test/
. - If disabled
path/index.md
will be mapped topath/index.html
andpath/test.md
will be mapped topath/test.html
.
- If enabled
On your pages you can reference links and images to other sites with the x-SITE_NAME:FILE_NAME
syntax.
For example to load the image my-image.png
somewhere from the https://example.com/
(crosslink example
) you would use the syntax:
![My Image](x-example:my-image.png)
If multiple files with the exact same name exist, there is currently now way to reference the correct one. In the future I plan to let you specify a part of the path to select the correct file.
Testing
Some very basic tests are in docs
(main site), site_a
(crosslink alpha), and site_b
(crosslink bravo).
You can build and serve the test site by running ./build.sh
.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for mkdocs-crosslink-plugin-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3abb3dde1630fde16accc04a714fdc5523e24b48ff460d58ec4231294582f91c |
|
MD5 | 97c91e2528349dcb1c5acceb16e47bb8 |
|
BLAKE2b-256 | 2034f940c2a3ea6b31db84d17422efc5e14d899676616f43e8fbe0143d966993 |
Hashes for mkdocs_crosslink_plugin-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a21dea15f07cbd0750c21d04061fd91032de19c47495eb87be5525fb72a0dce |
|
MD5 | a18ac5179c55965f43b258057b3a9c6c |
|
BLAKE2b-256 | ce9932d284469958fe205379bbc73b291d330c10006a95bda8ac2e6c7f301dc2 |