docrepr 0.2.0


pip install docrepr

  Latest version

Released: Jan 29, 2022


Meta
Author: Tim Dumol and the Spyder Development Team
Maintainer: Spyder Development Team and Docrepr Contributors
Requires Python: >=3.6

Classifiers

Development Status
  • 4 - Beta

Environment
  • Web Environment

Framework
  • IPython
  • Jupyter
  • Matplotlib
  • Sphinx

Intended Audience
  • Developers
  • Science/Research

License
  • OSI Approved :: BSD License

Operating System
  • OS Independent

Programming Language
  • Python :: 3
  • Python :: 3 :: Only
  • Python :: 3.6
  • Python :: 3.7
  • Python :: 3.8
  • Python :: 3.9
  • Python :: 3.10

Topic
  • Documentation :: Sphinx
  • Scientific/Engineering :: Visualization
  • Software Development :: Documentation
  • Software Development :: Libraries :: Python Modules
  • Text Processing :: Markup :: reStructuredText
  • Utilities

Docrepr

Docrepr renders Python docstrings to HTML with Sphinx. It can generate rich and plain representations of docstrings, alongside additional metadata about the object to which the docstring belongs. It is based on the sphinxify module developed by Tim Dumol for the Sage Notebook and the utils.help module developed by Carlos Cordoba for the Spyder IDE. See spyder-ide/docrepr#20 for the full history.

Rationale

For more on the motivation and design behind Docrepr, see this presentation by Carlos Cordoba at SciPy 2015:

Towards a Better Documentation System for Scientific Python | SciPy 2015 | Carlos Cordoba

Details

The module renders a dictionary as returned by IPython oinspect module into a full HTML page (with all assets) from an object's docstring, by using the rich_repr function of its sphinxify submodule.

Example of use

import webbrowser

import numpy as np
from IPython.core.oinspect import Inspector   # oinfo generator

import docrepr                                # Set module options
from docrepr import sphinxify                 # html generator

oinfo = Inspector().info(np.sin)
oinfo['name'] = 'sin'
url = sphinxify.rich_repr(oinfo)

webbrowser.open_new_tab(url)

License

This project is distributed under the under the terms of the BSD 3-Clause License.

Wheel compatibility matrix

Platform Python 3
any

Files in release

Extras:
Dependencies:
docutils
jinja2
sphinx (>=1.1)