Notion Plugin for mkdocs
Project description
mkdocs-notion-plugin
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-integrationsparent_page_id: The ID of the Notion page where your documentation will be deployedversion: 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
- Create a Notion integration and get your token
- Share your Notion database with the integration
- Configure the plugin in your
mkdocs.yml - 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
- Github repository: https://github.com/tomas_correa/mkdocs-notion-plugin/
- Documentation: https://tomas_correa.github.io/mkdocs-notion-plugin/
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee7cb0a6e0772961710779fdf605896918d444a7f401a754ceae58a29af28a86
|
|
| MD5 |
e2bba4ba366fde5c79b1af0727dfa70e
|
|
| BLAKE2b-256 |
28a6d55473d45c925fca7ed8a771153cd8684cac3503adc6e2a089d2879c1365
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
875beb89efc832ae632e031cb67a3aa7725b0c062bb214768a786f80854176fe
|
|
| MD5 |
96ba76775436078661f7c28a7fc33093
|
|
| BLAKE2b-256 |
3391f7033ced7918818be642d993fd46c1b0f60128cb8008a0f2f14310b5e907
|