Hi!

I decided to post also here, I have implemented a way to get
submodules working for autosummary extension.

Also I implemented to autosummary to respect __all__ of package/
module. This is changes behavior, but I think not that many people are
yet using autosummary, since there was bug where all Classes were
included in Exceptions section also, one would think that would have
been spotted a long time ago?

See following issue, diff file is attached to it:
http://bitbucket.org/birkenfeld/sphinx/issue/317/submodules-to-autosummary-and-respect-__all__

Essentially the submodule iteration allows to generate *whole*
documentation for *package* like EpyDoc does with a custom module.rst:

    {{ fullname }}
    {{ underline }}

    .. automodule:: {{ fullname }}

        {% block functions %}
        {% if functions %}
        .. rubric:: Functions

        .. autosummary::
            :toctree: {{ fullname }}/functions

        {% for item in functions %}
            {{ item }}
        {%- endfor %}
        {% endif %}
        {% endblock %}

        {% block classes %}
        {% if classes %}
        .. rubric:: Classes

        .. autosummary::
            :toctree: {{ fullname }}/classes

        {% for item in classes %}
            {{ item }}
        {%- endfor %}
        {% endif %}
        {% endblock %}

        {% block exceptions %}
        {% if exceptions %}
        .. rubric:: Exceptions

        .. autosummary::
            :toctree: {{ fullname }}/exceptions

        {% for item in exceptions %}
            {{ item }}
        {%- endfor %}
        {% endif %}
        {% endblock %}

        {% block modules %}
        {% if modules %}
        .. rubric:: Modules

        .. autosummary::
            :toctree: {{ fullname }}/submodules

        {% for submodule in modules %}
            {{ fullname }}.{{ submodule }}
        {% endfor %}
        {% endif %}
        {% endblock %}

Also I've been wondering, can't that {{ underline }} be done with
{{ fullname|underline }}, I'm coming from Django and that would be the
most natural way to do it.
-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-dev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sphinx-dev?hl=en.


Reply via email to