sphinx-contrib / prettyspecialmethods

Shows special/magic methods in sphinx docs as the python syntax that invokes them
MIT License
5 stars 5 forks source link
magic-methods python sphinx sphinx-extension sphinxcontrib

================================== sphinxcontrib-prettyspecialmethods

|badge-pypi| |badge-travis|

.. |badge-pypi| image:: https://badgen.net/pypi/v/sphinxcontrib-prettyspecialmethods :target: https://pypi.org/project/sphinxcontrib-prettyspecialmethods

.. |badge-travis| image:: https://travis-ci.org/sphinx-contrib/prettyspecialmethods.svg?branch=master :target: https://travis-ci.org/sphinx-contrib/prettyspecialmethods

Shows special methods as the python syntax that invokes them

Overview

This module renders docs like

.. code-block:: rst

.. method:: __add__(other)
    Docstring

as

self + other Docstring

After installing this module, add the following to your conf.py to enable it

.. code-block:: python

extensions = [
    ...  # your other extensions
    'sphinxcontrib.prettyspecialmethods',
]

Links