MkDocs Network Graph Plugin

September 15, 2025 · View on GitHub

MkDocs Network Graph Plugin

Add an interactive knowledge network graph to your Material for MkDocs documentation project

PyPI - Version PyPI - Python Version GitHub License GitHub Actions Workflow Status Documentation

A powerful Material for MkDocs plugin that generates beautiful, interactive graph visualizations of your documentation structure and relationships.

demo

DocumentationQuick StartConfigurationContributing


Table of Contents

Features

Interactive VisualizationSmart NavigationFully CustomizableLightweight
Interactive Graph Visualization of your documentation structureDual View Modes to switch between a full-site overview and local page connectionsTheme Integration that seamlessly blends with Material for MkDocsPerformance Optimized with minimal impact on build times and a responsive design

Quick Start

Get up and running in under 2 minutes:

1. Install the plugin

pip install mkdocs-network-graph-plugin

2. Enable in your mkdocs.yml

plugins:
  - graph

As part of the package, the plugin looks for the key site_url in order to create the appropriate URLs to link and create the graphs. If you are experiencing an empty graph, enter a URL along with the protocol to your mkdocs.yml file. E.g.:

site_url: "https://example.com/username/repository"

If you are using mkdocs serve to preview your website, you may wish to pass an address argument. E.g., mkdocs serve -a localhost:8000

3. Build your docs

mkdocs serve

That's it! Your documentation now includes an interactive graph visualization.

Installation

pip install mkdocs-network-graph-plugin

Using uv (faster)

uv pip install mkdocs-network-graph-plugin

Using pipx (isolated)

pipx install mkdocs-network-graph-plugin

Development Installation

For contributors, this is the recommended setup:

  1. Clone the repository

    git clone https://github.com/develmusa/mkdocs-network-graph-plugin.git
    cd mkdocs-network-graph-plugin
    
  2. Set up the development environment

    # Sync with the lockfile
    uv sync
    # Install required Python versions for testing
    uv python install 3.10 3.11 3.12 3.13
    # Install in editable mode with dev dependencies
    uv pip install -e '.[dev]'
    # Install pre-commit hooks
    uv run pre-commit install
    

For more details, see the developer guide.

Requirements

  • Python: 3.10+
  • MkDocs: Compatible with latest versions
  • Theme: Designed for Material for MkDocs (v9.0.0+)

Configuration

Basic Configuration

plugins:
  - graph:
      name: "title"        # Use page titles for node names
      debug: false         # Disable debug logging

Advanced Configuration

plugins:
  - graph:
      name: "file_name"    # Use file names instead of titles
      debug: true          # Enable verbose logging for troubleshooting

Configuration Options

OptionTypeDefaultDescription
namestring"title"Node naming strategy: "title" or "file_name"
debugbooleanfalseEnable debug logging for development

Customization

Customize the graph appearance using CSS variables in your extra.css:

:root {
  /* Node styling */
  --md-graph-node-color: #1976d2;
  --md-graph-node-color--hover: #1565c0;
  --md-graph-node-color--current: #ff5722;

  /* Link styling */
  --md-graph-link-color: #757575;

  /* Text styling */
  --md-graph-text-color: #212121;
}

Available CSS Variables

VariableDescriptionDefault
--md-graph-node-colorDefault node colorTheme primary
--md-graph-node-color--hoverNode hover colorDarker primary
--md-graph-node-color--currentCurrent page node colorTheme accent
--md-graph-link-colorConnection line colorTheme text (muted)
--md-graph-text-colorNode label text colorTheme text

Documentation

Comprehensive documentation is available at develmusa.github.io/mkdocs-network-graph-plugin

Documentation Sections

Contributing

We welcome contributions! For a complete guide on how to contribute, please see the developer guide.

To get started, set up your environment by following the Development Installation instructions. From there, you can run tests and linting using nox:

# Run tests
uv run nox -s tests

# Run linting
uv run nox -s lint

Contribution Guidelines

  • Bug Reports: Use the issue tracker
  • Feature Requests: Open an issue with your proposal
  • Pull Requests: Fork, create a feature branch, and submit a PR
  • Documentation: Help improve our docs

License

This project is licensed under the MIT License - see the LICENSE file for details

Acknowledgments

Explore other tools with Markdown documentation graph visualization:


Star this project if you find it useful!

Made with AI and ❤️ by develmusa