Skip to main content

docgen

Pythonista markdown document generator from a single file, intended to be used to generate documentation for Github. Included in the generated documentation are:

  • Module-level docstring.
  • Classes and their functions, with docstrings.
  • Module-level functions and their docstrings.
  • Decorators are included, with the following special cases:
    • Properties are placed in a separate section, using the docstring of the getter.
    • on_main_thread decorators are ignored.
  • A table of contents.

Functions and methods that start with '_' are not included in the documentation.

Usage

Include this script in the Pythonista action (wrench) menu, and run it to generate documentation for the file currently open in the editor.

You can choose to just view the resulting documentation as HTML, or also save it as either README.md or <script_name>.md.

Menu image

Table of contents is included after the module docstring.

There are some special directives you can use to fine-tune the output. These are magic comment strings that must be preceeded only by white space.

  • #docgen-toc - Table of contents will replace this string if found in the module docstring, so that you can have the ToC in the middle of it instead of at the end.
  • #docgen: (with a space after the colon) - Use to group functions into related groups. The text you provide after the colon will be included in the table of contents.

API

Class: Processor

Methods to generate markdown documentation from source classes, functions and their docstrings.

Methods

get_markdown(self, include_undocumented=False)

Produces the markdown for the file.

Optional arguments:

  • include_undocumented - set to True to include classes and methods without a docstring.

get_sections(self)

get_section_title(self, line_no)

for_classes(self)

for_functions(self, c, heading, toc_level)

build_toc(self, toc)

Functions

UTILITY FUNCTIONS

el(parent, astdef)

eldoc(body, astdef)

slugify(s)

Simplifies ugly strings into something URL-friendly.

slugify("[Some] _ Article's Title--") --> some-articles-title

From http://blog.dolphm.com/slugify-a-string-in-python/

Metadata

Release files for pythonista-docgen 1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pythonista-docgen 1.0
File Size Uploaded Provenance Actions
pythonista-docgen-1.0.tar.gz 297.2 kB Without provenance Details for pythonista-docgen-1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pythonista-docgen 1.0
File Interpreter ABI Platform Actions
pythonista_docgen-1.0-py2.py3-none-any.whl Python 3, Python 2 none any Details for pythonista_docgen-1.0-py2.py3-none-any.whl

Total release size: 302.2 kB

Release files / pythonista-docgen-1.0.tar.gz

Download URL pythonista-docgen-1.0.tar.gz
Size 297.2 kB
Tags Source
SHA-256 checksum
How to use checksums
1ae92b520b233ad52567ad4e573318bc990bbfabb0445197148a2afdc2ebb40f
BLAKE2b-256 checksum
How to use checksums
7f6af71f0d83dc2e5dbc5eb24ba30159856a0e6e96f448c828e997a335a4d137
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.22.0

Release files / pythonista_docgen-1.0-py2.py3-none-any.whl

Download URL pythonista_docgen-1.0-py2.py3-none-any.whl
Size 5.1 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
d301398ecec9aa07497fd1a130e243fb67f2c304b15219aaa06d860217aace17
BLAKE2b-256 checksum
How to use checksums
77740255a4de88afb800375b93427e3ff4c6d0f24186afd00667ccd18e33930f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.22.0

Security for pythonista-docgen 1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page