Static related contents - Properdocs / MkDocs plugin
A plugin for Properdocs / MkDocs, the static site generator, which computes, for every tagged page, a list of related pages based on shared tags, and exposes it to the Jinja context so your theme can render a "Related content" / "See also" section.
Installation
pip install mkdocs-related-content
Usage
Then in your mkdocs.yml:
plugins:
- related-content
Example
Two pages sharing a tag:
# docs/api-auth.md
---
tags:
- API
- authentication
- Python
---
# docs/api-oauth.md
---
tags:
- API
- oAuth
---
Both pages api-auth.md and api-oauth.md share the api tag: each will list the other as related content (Jaccard similarity score of 0.25), regardless of the order pages are declared in nav.
Development
Once you cloned the repository:
# install project as editable
python -m pip install -e .
# including development dependencies
python -m pip install -e .[dev]
# including documentation dependencies
python -m pip install -e .[docs]
# including testing dependencies
python -m pip install -e .[test]
# all inclusive
python -m pip install -e .[dev,docs,test]
# install git hooks
pre-commit install
Then follow the contribution guidelines.
Run the tests
# install development dependencies
python -m pip install -e .[test]
# run tests
pytest
Build the documentation
# install dependencies for documentation
python -m pip install -e .[docs]
# build the documentation
mkdocs build
Release workflow
- Fill the
CHANGELOG.md - Change the version number in
__about__.py - Apply a git tag with the relevant version:
git tag -a 0.3.0 {git commit hash} -m "New awesome feature" - Push tag to main branch:
git push origin 0.3.0
Metadata
Release files for mkdocs-related-content-plugin 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mkdocs_related_content_plugin-0.2.0.tar.gz | 55.0 kB | With provenance | Details for mkdocs_related_content_plugin-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mkdocs_related_content_plugin-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for mkdocs_related_content_plugin-0.2.0-py3-none-any.whl |
Total release size: 76.9 kB
Security for mkdocs-related-content-plugin 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.