Skip to main content

Auto-document your API reference on Notion.

Project description

🚧 This is an alpha version of the project, a proof of concept. Looking for collaborators !

Bring autodoc capabilities to your Notion workspace with Docution

test status release

Description • Install • Usage • FAQ • Contribute • Roadmap
Documentation

Description

Writing documentation in Notion is an attractive alternative to other solutions :

  • ✨ Neat interface, rich text editing
  • 👥 Easy to share and collaborate, while keeping it private
  • 🚀 Already hosted !

But Notion lacks features that makes the power of other solutions, like auto-documentation ! This is the role of docution : a python package and command line that updates your Notion pages with clean formatted documentation.

Install

Simply run :

pip install docution

Usage

In your Notion page, create a text block like follow :

/docution my_module.my_function

After creating your integration and giving it access to your page, just run :

docution --auth_token <secret> --page_id <id>

And here you go ! Your Notion page is updated with your documentation :


You can check the docution usage with :

docution --help

Please also check the documentation for a full example with all the details !

FAQ

Why is it in alpha ?

Currently, the official Notion API is in beta, which means it can change anytime.

Also, this project needs additional features that are not implemented in the Notion API yet to be fully functional. So for now, this is just a proof of concept.

Checkout the current limitations for more details.

How does it work ?

When you use the docution command line, the following happens :

  • Retrieve all the blocks used in the Notion page with the given ID
  • Detect the blocks that are a docution command (/docution a.b.c)
  • Import the docstring of the object a.b.c
  • Correctly format the docstring as Notion blocks
  • Write these blocks in your Notion page

Contribute

Clone the repository locally, create your branch, push your changes and open a PR !


Check if code is well-formated :

pip install flake8

flake8 . --count --max-complexity=10 --max-line-length=127 --statistics

Roadmap

  • Add missing functionality to be similar to sphinx (document public methods of class, etc...)

  • Add option to specify path of module

  • Add option for private members, only specific member, etc...

  • Should we add the module name (when documenting module) ? Add option for that ?

  • Should we add only the name of the thing, or the whole path ? Add option for that ?

  • Add option for dryrun

  • Change parser to pardoc ? To handle other type of section, like Example.

  • Optimize API call to NOT do recursive calling (for now, no choice)

  • Handle markdown ?

  • Handle RST ?

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

docution-0.0.2.tar.gz (21.5 kB view hashes)

Uploaded Source

Built Distribution

docution-0.0.2-py3-none-any.whl (21.9 kB view hashes)

Uploaded Python 3

Supported by

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