MkDocs plugin: rewrite ../ repo links to forge view URLs in built HTML
Project description
MkDocs Source Links
MkDocs plugin that rewrites ](../path) links to your git forge in built HTML only. Source markdown keeps relative paths so GitHub and your IDE still work.
- Files →
https://…/blob/<branch>/<path> - Directories →
https://…/tree/<branch>/<path> - Forges: GitHub, GitLab, Bitbucket, Gitea/Forgejo, Azure DevOps (autodetected; self-hosted via
forge:)
Documentation: https://filipchristiansen.github.io/mkdocs-source-links
Install
pip install mkdocs-source-links
Usage
site_name: My project
repo_url: https://github.com/you/your-repo
edit_uri: edit/main/docs/
plugins:
- source-links
Requires repo_url in mkdocs.yml (shown above). Without it, links are left unchanged.
Optional branch override:
plugins:
- source-links:
branch: develop
Advanced options
plugins:
- source-links:
pin: commit # embed HEAD SHA instead of branch name
forge: gitlab # override autodetection for custom domains
warn_on_missing: false # silence missing-target warnings
enabled: !ENV [SOURCE_LINKS, true] # disable per environment
Line fragments in links (#L10, #L10-L20) are translated to each forge's line-reference
syntax. See the configuration docs
for all options.
Link conventions and branch resolution
Parent-directory links (../path) to repo files and directories are rewritten to forge blob/tree
URLs; links between pages inside docs/ are unchanged. Branch names are resolved from plugin
config, extra.git_branch, or edit_uri.
See Usage and Configuration in the docs for the full tables and resolution order.
Contributing
This project uses uv, pre-commit, and a Makefile.
make install # install Python 3.10, sync all groups, set up pre-commit hooks
make ci # run the full pre-PR suite: lint, test, coverage
Maintainers release with make release-prep VERSION=X.Y.Z (bump, roll the hand-written
CHANGELOG.md, open the release PR) and, once merged, make release-tag VERSION=X.Y.Z (signed tag
and publish to PyPI).
See CONTRIBUTING.md for the full workflow and CHANGELOG.md for release notes. Security issues: see SECURITY.md.
License
MIT
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mkdocs_source_links-0.3.12.tar.gz.
File metadata
- Download URL: mkdocs_source_links-0.3.12.tar.gz
- Upload date:
- Size: 18.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e71d7ba5fd1e9386dfa8054529389cc366226603ec89aa1c524576faf328d8b
|
|
| MD5 |
db90b51362eb0fa9821153d31f1fa806
|
|
| BLAKE2b-256 |
abd28ed134c91a1c62127d651a0f0c226357e2de2cb9f76ec5e0981c9864c01b
|
Provenance
The following attestation bundles were made for mkdocs_source_links-0.3.12.tar.gz:
Publisher:
publish.yml on filipchristiansen/mkdocs-source-links
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mkdocs_source_links-0.3.12.tar.gz -
Subject digest:
5e71d7ba5fd1e9386dfa8054529389cc366226603ec89aa1c524576faf328d8b - Sigstore transparency entry: 1864487564
- Sigstore integration time:
-
Permalink:
filipchristiansen/mkdocs-source-links@d6e2ebcc7ad582ad1de241aa5f5b0f0b9717dbdd -
Branch / Tag:
refs/tags/v0.3.12 - Owner: https://github.com/filipchristiansen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d6e2ebcc7ad582ad1de241aa5f5b0f0b9717dbdd -
Trigger Event:
push
-
Statement type:
File details
Details for the file mkdocs_source_links-0.3.12-py3-none-any.whl.
File metadata
- Download URL: mkdocs_source_links-0.3.12-py3-none-any.whl
- Upload date:
- Size: 13.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
572f12a2f8a82ff3a96b102601b9542cdb7b448e0908d61411059e68a0f65192
|
|
| MD5 |
c634db113470a266e8bf0f99ae13a595
|
|
| BLAKE2b-256 |
d3094e064459f4ef2649eef84ed52df6a8601e9bddfe51de6ad1513fa6c098bd
|
Provenance
The following attestation bundles were made for mkdocs_source_links-0.3.12-py3-none-any.whl:
Publisher:
publish.yml on filipchristiansen/mkdocs-source-links
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mkdocs_source_links-0.3.12-py3-none-any.whl -
Subject digest:
572f12a2f8a82ff3a96b102601b9542cdb7b448e0908d61411059e68a0f65192 - Sigstore transparency entry: 1864487780
- Sigstore integration time:
-
Permalink:
filipchristiansen/mkdocs-source-links@d6e2ebcc7ad582ad1de241aa5f5b0f0b9717dbdd -
Branch / Tag:
refs/tags/v0.3.12 - Owner: https://github.com/filipchristiansen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d6e2ebcc7ad582ad1de241aa5f5b0f0b9717dbdd -
Trigger Event:
push
-
Statement type: