Skip to main content

Static related contents - Properdocs / MkDocs plugin

PyPi version badge PyPI - Downloads PyPI - Python Version

Quality Gate Status codecov Ruff pre-commit pre-commit.ci status 📚 Documentation

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

  1. Fill the CHANGELOG.md
  2. Change the version number in __about__.py
  3. Apply a git tag with the relevant version: git tag -a 0.3.0 {git commit hash} -m "New awesome feature"
  4. Push tag to main branch: git push origin 0.3.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mkdocs_related_content_plugin-0.1.0.tar.gz (47.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mkdocs_related_content_plugin-0.1.0-py3-none-any.whl (19.0 kB view details)

Uploaded Python 3

Release history Release notifications | RSS feed

0.2.0

2 files

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page