Skip to main content

Sphinx extension to build Notion pages.

Project description

Build Status codecov PyPI

Notion Builder for Sphinx

Extension for Sphinx which enables publishing documentation to Notion.

Installation

sphinx-notionbuilder is compatible with Python 3.11+.

$ pip install sphinx-notionbuilder

Add the following to conf.py to enable the extension:

"""Configuration for Sphinx."""

extensions = ["sphinx_notion"]

For collapsible sections (toggle blocks), also add the sphinx-toolbox collapse extension:

"""Configuration for Sphinx."""

extensions = [
    "sphinx_notion",
    "sphinx_toolbox.collapse",
]

For video support, also add the sphinxcontrib-video extension:

"""Configuration for Sphinx."""

extensions = [
    "sphinxcontrib.video",  # Must be before sphinx_notion
    "sphinx_notion",
]

For strikethrough text support, also add the sphinxnotes-strike extension:

"""Configuration for Sphinx."""

extensions = [
    "sphinxnotes.strike",  # Must be before sphinx_notion
    "sphinx_notion",
]

Supported markup

The following syntax is supported:

  • Headers

  • Bulleted lists

  • Code blocks

  • Table of contents

  • Block quotes

  • Note, warning, and tip admonitions

  • Collapsible sections (using sphinx-toolbox collapse directive)

  • Images (with URLs or local paths)

  • Videos (with URLs or local paths)

  • Tables

  • Strikethrough text

See a sample document source and the published Notion page.

Uploading Documentation to Notion

After building your documentation with the Notion builder, you can upload it to Notion using the included command-line tool.

Prerequisites

  1. Create a Notion integration at https://www.notion.so/my-integrations

  2. Get your integration token and set it as an environment variable:

$ export NOTION_TOKEN="your_integration_token_here"

Usage

$ notion-upload -f path/to/output.json -p parent_page_id -t "Page Title"

Arguments:

  • -f, --file: Path to the JSON file generated by the Notion builder

  • -p, --parent-page-id: The ID of the parent page in Notion (must be shared with your integration)

  • -t, --title: Title for the new page in Notion

The command will create a new page if one with the given title doesn’t exist, or update the existing page if one with the given title already exists.

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

sphinx_notionbuilder-2025.9.25.2.tar.gz (23.9 kB view details)

Uploaded Source

Built Distribution

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

sphinx_notionbuilder-2025.9.25.2-py2.py3-none-any.whl (12.1 kB view details)

Uploaded Python 2Python 3

File details

Details for the file sphinx_notionbuilder-2025.9.25.2.tar.gz.

File metadata

File hashes

Hashes for sphinx_notionbuilder-2025.9.25.2.tar.gz
Algorithm Hash digest
SHA256 7b1b9cc51f518cfa5f139164a0bfae5053adbe5bbf92f1b4871e89ed7ee6bcf2
MD5 7db0a92e9f29acde9e9f1cd85e53a21a
BLAKE2b-256 44d7a1861972f3e29f01d4e0e7209c7dc5835cc8b7232c5c9413f89f098f716a

See more details on using hashes here.

Provenance

The following attestation bundles were made for sphinx_notionbuilder-2025.9.25.2.tar.gz:

Publisher: release.yml on adamtheturtle/sphinx-notionbuilder

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sphinx_notionbuilder-2025.9.25.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for sphinx_notionbuilder-2025.9.25.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 2f9ae81509c3e5f446ecb9e678d68ee36c782eac7771905e8483cdef60a8cb5b
MD5 e9c8b23251a7253c3bc2a482b5091521
BLAKE2b-256 408715b3d28e261e88c6ece1397660f3153105d9fd0a0219972e7a0c89192a33

See more details on using hashes here.

Provenance

The following attestation bundles were made for sphinx_notionbuilder-2025.9.25.2-py2.py3-none-any.whl:

Publisher: release.yml on adamtheturtle/sphinx-notionbuilder

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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