Welcome to the API reference ! This was created with docution of course 🙂

Documenter's logic

resolve (thing)

Function resolving a name to a python object, trying to import it. After

importing it, it will extract its docstring.

In case of constant (docstring is not accessible from the __doc__ attribute), we use a copy of the ModuleAnalyzer from sphinx to extract the docstring.

Parameters :

thing str : Name of the thing to document.

Returns : tuple

obj: Imported thing. str: Raw docstring of the thing.

clean_docstring (ds)

Function cleaning a parsed docstring.

This function just ensure single new line are considered as space, and normalize the amount of space, etc...

Parameters :

ds docstring_parser.Docstring : Parsed doctring to clean.

Returns :

ds (docstring_parser.Docstring): Cleaned doctring.

class Documenter (packer)

Class having the responsability of knowing what to document, and how

to document it.

Parameters :

packer docution.BasePacker : Packer class, for packing documentation in Notion.

call (self, thing, block)

Method to document an thing. This will find all the element to

document, and document them all properly, using the given packer to create the right Notion blocks.

Parameters :

thing str : Thing to document.

block dict : Block descriptor that contain the docution command.

Notion API wrapper

class NotionAPI (auth_token)

Simple high-level wrapper around notion's python SDK.

Parameters :

auth_token str : Authentification token.

block_iterator (self, id)

Generator iterating ALL the children of a block (given ID). Because

Notion API uses Pagination, not all blocks are returned at once, and we might need additional calls to the API.

Parameters :

id str : ID of the block to iterate.

Yields : dict

Notion block descriptor.

all_children_iterator (self, id)

Generator recursively iterating ALL the children and subchildren of

a block (given ID). A new call is necessary for each recursive level.

Parameters :

id str : ID of the block to iterate.

Yields : dict

Notion block descriptor.

add_child_to (self, id, children)

Method to add a given block descriptor as a child to the block with

given ID.

Parameters :

id str : ID of the block where to add the child.

children list of dict : List of Notion block descriptors.

Documentation's layout and formatting

class BasePacker (notion, primary='blue_background', secondary='gray_background')

Default Packer. A Packer is a class that convert documentation to

Notion blocks.

Parameters :

notion docution.NotionAPI : Notion API wrapper.

primary str : Color of text to use for the signatures. Defaults to "blue_background".

secondary str optional : Color of text to use for the attributes. Defaults to "gray_background".

pack_data (self, name, thing, docstring, block)

Method to pack data (like constants) into Notion. This method will

create Notion blocks in the page.

Parameters :

name str : Name of the object to document.

thing obj : Object to document.

docstring docstring_parser.Docstring : Parsed doctring of the object to document.

block dict : Notion block descriptor.

Returns : dict

The Notion block descriptor created.

pack_routine (self, name, thing, docstring, block, skip_sig=False, add_empty=True)

Method to pack routine (methods and functions) into Notion. This

method will create Notion blocks in the page.