Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to customize sphinx.ext.autosummary rst template?

Here in Sphinx's documentation it is said what those templates can be redefined. So I tried to copy module.rst from /site-packages/sphinx/ext/autosummary to source/_templates/autosummary (also tried just source/_templates) with some slight changes. But after I regenerated the docs nothing changed.

Maybe i should add some specific option to .. autosummary:: tag to specify custom template directory? (in conf.py directory is set right and sphinx see html templates as well)

UPD: source code: https://github.com/actionless/wooper/blob/master/docs.sh

like image 782
actionless Avatar asked Jan 26 '15 09:01

actionless


1 Answers

It should work if you do the following:

  1. Ensure that the value of the templates_path configuration variable is set to ['_templates'] in conf py.
  2. Put the custom template in the _templates subdirectory.
  3. Use the :template: option:

    .. autosummary::
      :template: mytemplate.rst
    
like image 173
mzjn Avatar answered Oct 20 '22 20:10

mzjn