Skip to content

Commit

Permalink
provide sections and local TOC for module documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikhail Sobolev committed Dec 25, 2013
1 parent 7965d33 commit 1713013
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions hacking/templates/rst.j2
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

@{ module }@
++++++++++++++++++++++++++++++++++++++
{% if author %}
:Author: @{ author }@
{% endif %}

.. contents::
:local:
:depth: 1

{# ------------------------------------------
#
Expand All @@ -10,6 +17,9 @@
#
--------------------------------------------#}

Synopsis
--------

{% if version_added is defined -%}
.. versionadded:: @{ version_added }@
{% endif %}
Expand All @@ -19,6 +29,9 @@
{% endfor %}

{% if options -%}
Options
-------

.. raw:: html

<table border=1 cellpadding=4>
Expand Down Expand Up @@ -54,7 +67,10 @@
{% endfor %}
{% endif %}

{% if not plainexamples %}
{% if examples or plainexamples %}
Examples
--------

.. raw:: html

{% for example in examples %}
Expand All @@ -66,19 +82,18 @@
</p>
{% endfor %}
<br/>
{% endif %}

{% if plainexamples %}

Examples::
::

@{ plainexamples | escape | indent(4, True) }@
{% endif %}

{% endif %}

{% if notes %}
{% for note in notes %}
.. note:: @{ note | html_ify }@</p>
.. note:: @{ note | convert_symbols_to_format }@
{% endfor %}
{% endif %}

0 comments on commit 1713013

Please sign in to comment.