Skip to main content

Notion Plugin for mkdocs

Project description

mkdocs-notion-plugin

Release Build status Python codecov License

A MkDocs plugin that integrates Notion content into your documentation.

⚠️ Development Phase Warning

This project is currently in active development and NOT ready for production use. Features may be incomplete, APIs may change without notice, and stability is not guaranteed. Use at your own risk and expect breaking changes between versions.

We welcome feedback and contributions, but please do not use this in production environments yet.

Features

  • Fetch content from Notion databases
  • Cache Notion content locally for faster builds
  • Seamless integration with MkDocs

Installation

pip install mkdocs-notion-plugin

Configuration

Add the plugin to your mkdocs.yml:

plugins:
  - notion:
      # Notion configuration (only required for deployment)
      notion_token: your-notion-integration-token  # optional
      parent_page_id: your-parent-page-id          # optional
      version: your-version                        # optional
      cache_dir: .notion_cache                     # optional
      deploy_on_build: false                       # optional

Configuration for Deployment

The following configuration is only required when using mkdocs notion-deploy:

  • notion_token: Your Notion integration token. Create one at https://www.notion.so/my-integrations
  • parent_page_id: The ID of the Notion page where your documentation will be deployed
  • version: Version identifier for your documentation

Optional Configuration

  • cache_dir: Directory to store cached Notion content (default: .notion_cache)
  • deploy_on_build: Whether to automatically deploy to Notion during build (default: false)

Note: You can use mkdocs build and mkdocs serve without any Notion configuration. The Notion settings are only validated when you run mkdocs notion-deploy.

Usage

  1. Create a Notion integration and get your token
  2. Share your Notion database with the integration
  3. Configure the plugin in your mkdocs.yml
  4. Deploy your documentation using one of these methods:

Method 1: Manual Deployment (Recommended)

Build and deploy separately for better control:

# Build your documentation
mkdocs build

# Deploy to Notion
mkdocs notion-deploy

# Or if using Poetry for development
poetry run mkdocs notion-deploy

Method 2: Automatic Deployment

Enable automatic deployment during build by adding deploy_on_build: true to your configuration:

plugins:
  - notion:
      notion_token: your-notion-integration-token
      parent_page_id: your-parent-page-id
      version: your-version
      deploy_on_build: true  # Enable automatic deployment

Then simply run:

mkdocs build

Command Options

The notion-deploy command supports several options:

mkdocs notion-deploy --help

Options:
  -f, --config-file FILE  Provide a specific MkDocs config file
  -s, --strict            Enable strict mode (abort on warnings)
  -v, --verbose           Enable verbose output
  -q, --quiet             Silence warnings
  --clean / --dirty       Remove old files before building (default: clean)

Development

# Install dependencies
poetry install

# Run tests
poetry run pytest

# Format code
poetry run black .

Links

License

MIT License


Repository initiated with fpgmaas/cookiecutter-poetry.

Change

Project details


Download files

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

Source Distribution

mkdocs_notion_plugin-0.0.7.tar.gz (16.2 kB view details)

Uploaded Source

Built Distribution

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

mkdocs_notion_plugin-0.0.7-py3-none-any.whl (16.9 kB view details)

Uploaded Python 3

File details

Details for the file mkdocs_notion_plugin-0.0.7.tar.gz.

File metadata

  • Download URL: mkdocs_notion_plugin-0.0.7.tar.gz
  • Upload date:
  • Size: 16.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.4 CPython/3.11.13 Linux/6.11.0-1018-azure

File hashes

Hashes for mkdocs_notion_plugin-0.0.7.tar.gz
Algorithm Hash digest
SHA256 ee7cb0a6e0772961710779fdf605896918d444a7f401a754ceae58a29af28a86
MD5 e2bba4ba366fde5c79b1af0727dfa70e
BLAKE2b-256 28a6d55473d45c925fca7ed8a771153cd8684cac3503adc6e2a089d2879c1365

See more details on using hashes here.

File details

Details for the file mkdocs_notion_plugin-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: mkdocs_notion_plugin-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 16.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.4 CPython/3.11.13 Linux/6.11.0-1018-azure

File hashes

Hashes for mkdocs_notion_plugin-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 875beb89efc832ae632e031cb67a3aa7725b0c062bb214768a786f80854176fe
MD5 96ba76775436078661f7c28a7fc33093
BLAKE2b-256 3391f7033ced7918818be642d993fd46c1b0f60128cb8008a0f2f14310b5e907

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page