Skip to main content

Notion Plugin for mkdocs

Project description

mkdocs-notion-plugin

Release Build status codecov Commit activity License

A MkDocs plugin that integrates Notion content into your documentation.

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_token: your-notion-integration-token
      parent_page_id: your-parent-page-id
      version: your-version
      cache_dir: .notion_cache  # optional
      deploy_on_build: false  # optional

Required Configuration

  • 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)

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.5.tar.gz (10.9 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.5-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mkdocs_notion_plugin-0.0.5.tar.gz
  • Upload date:
  • Size: 10.9 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.5.tar.gz
Algorithm Hash digest
SHA256 eed69e8863edecdbdaf66869e6a458593a41e3277c059b5d5d892114bdd823cb
MD5 0dbb95ea05510886612e54cd174f4342
BLAKE2b-256 c09ba50eb6816856bca7db0d430c78e2e3409ae550dd1d4ec3b8d8984bb2fcf4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mkdocs_notion_plugin-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 11.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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 af630340ed366b3b65416ddd680692d34b9ea4d5068c03416156ac9ee882aa97
MD5 a14c6c52fa30ce4c5f3980441b13b9e1
BLAKE2b-256 2df79bdb2c7f5580cb308583fb4e80b12dd3dc1603ace0ba378ad0bcdecea8a5

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