[SciPy-Dev] class.rst information and bug with the newer sphinx?

josef.pktd@gmai... josef.pktd@gmai...
Sun Nov 28 18:49:35 CST 2010


On Sun, Nov 28, 2010 at 7:03 PM, Skipper Seabold <jsseabold@gmail.com> wrote:
> I've been playing around a bit with numpy/scipy's
> doc/source/_templates/autosummary/class.rst.  First does this still
> work as expected with the newer sphinx?  See for instance the method
> of the dtype class for numpy 1.4 (assumed built with older sphinx
> before 1.0?) and numpy 1.5
>
> http://docs.scipy.org/doc/numpy-1.4.x/reference/generated/numpy.dtype.html#numpy.dtype
> http://docs.scipy.org/doc/numpy-1.5.x/reference/generated/numpy.dtype.html#numpy.dtype
>
> The newbyteorder method does not have a summary in the 1.5 version.
>
> Second, Is there anywhere to get more information on the autosummary templates?
>
> This covers layout.html <http://sphinx.pocoo.org/templating.html#templating>
> This mentions the possible files
> <http://sphinx.pocoo.org/ext/autosummary.html?highlight=templating#customizing-templates>
> but I am missing the details.  In
> <http://svn.scipy.org/svn/numpy/trunk/doc/source/_templates/autosummary/class.rst>
> where do the lines
>
>      {% for item in methods %}
>         {{ name }}.{{ item }}
>
>
> come from?  Specifically, where does 'name' come from?  Is this from
> Python, Sphinx, Numpy extension, or Jinja?  Any help to demystify this
> would be appreciated.

in
Sphinx-1.0.5\sphinx\ext\autosummary\generate.py

ns collects the description and methods, ... for an object, e.g. for a
class, this is given as argument to the
template:

          rendered = template.render(**ns)

which does the actual rendering of template plus info in `ns` to string.
The template is supposed to produce valid rst with sphinx
instructions. I don't know where the HACK came from.

Josef


>
> Skipper
> _______________________________________________
> SciPy-Dev mailing list
> SciPy-Dev@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-dev
>


More information about the SciPy-Dev mailing list