Hi, autosummary template feature works fine for me. This is a small sample for the confirmation. https://www.dropbox.com/s/19x96y6n58m7xa7/autosummary-sample.zip?dl=0
2014-09-02 8:53 GMT+09:00 Craig Watson <[email protected]>: > Hi, > > I'm having trouble using custom templates with autosummary. Essentially I > want a very slightly modified module.rst template, which will add :toctree: > directives in order to generate stub files for all members. > > So, I have added a module.rst file to _templates/autosummary; I've added > this directory to the templates_path list in conf.py autosummary will search it's templates in the 'autosummary' directory under the each 'templates_path' directories, then you just need to add '_templates' directory to 'templates_path'. > and I added :template: module to my index.rst file. If you want to use another template name, it's necessary. In this case, 'module.rst' will be used automatically. > However, nothing is changed and the documentation is generated as if this > file didn't exist. Is there something I'm doing wrong, or something I'm > missing? > Any help would be greatly appreciated! > > Below are the relevant code snippets: > > In my conf.py : > templates_path = ['doc_templates', 'doc_templates/autosummary'] If you placed the 'module.rst' to the '_templates/autosummary', template_path needs to have '_templates'. > In index.rst: > > .. autosummary:: > :template: module > :toctree: _autosummary > > personne > recherche > > > And finally my module.rst template: > > > {{ fullname }} > {{ underline }} > > .. automodule:: {{ fullname }} > > {% block functions %} > {% if functions %} > .. rubric:: Fonctions > > .. autosummary:: > :toctree: > {% for item in functions %} > {{ item }} > {%- endfor %} > {% endif %} > {% endblock %} > > {% block classes %} > {% if classes %} > .. rubric:: Classes > > .. autosummary:: > :toctree: > {% for item in classes %} > {{ item }} > {%- endfor %} > {% endif %} > {% endblock %} > > {% block exceptions %} > {% if exceptions %} > .. rubric:: Exceptions > > .. autosummary:: > :toctree: > {% for item in exceptions %} > {{ item }} > {%- endfor %} > {% endif %} > {% endblock %} Regards, -- Takayuki SHIMIZUKAWA http://about.me/shimizukawa -- You received this message because you are subscribed to the Google Groups "sphinx-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sphinx-users. For more options, visit https://groups.google.com/d/optout.
