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

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)

Source distribution for mkdocs-related-content-plugin 0.2.0
File Size Uploaded
mkdocs_related_content_plugin-0.2.0.tar.gz 55.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mkdocs-related-content-plugin 0.2.0
File Interpreter ABI Platform
mkdocs_related_content_plugin-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 76.9 kB

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release 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