-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Has anybody packaged up an extension to allow extracting APIs / docstrings cleanly from Zope interfaces in Sphinx? I found Chris McDonough's patch from back in April, but it no longer applies cleanly, and besides, as he notes, it should really be done as a standalone extension. Tres. - -- =================================================================== Tres Seaver +1 540-429-0999 tseaver@palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFI4tYX+gerLs4ltQ4RAhtiAJ9++cN/gwiXcI566tiFC6p/Y9MnXQCfaB8E aRaEnUBa07Pri23kUTIDraA= =IMQn -----END PGP SIGNATURE-----
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Tres Seaver wrote:
Has anybody packaged up an extension to allow extracting APIs / docstrings cleanly from Zope interfaces in Sphinx? I found Chris McDonough's patch from back in April, but it no longer applies cleanly, and besides, as he notes, it should really be done as a standalone extension.
Scratching my own itch: http://pypi.python.org/pypi/repoze.sphinx.autointerface/ Tres. - -- =================================================================== Tres Seaver +1 540-429-0999 tseaver@palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFI5m0w+gerLs4ltQ4RApBWAJ9tqGVN0BpmupYjmz5fgLzu9Rg2zwCdFpiV AAEO7v6wf+oddaRm/ilGf/4= =U0S+ -----END PGP SIGNATURE-----
On Oct 3, 2008, at 12:06 PM, Tres Seaver wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Tres Seaver wrote:
Has anybody packaged up an extension to allow extracting APIs / docstrings cleanly from Zope interfaces in Sphinx? I found Chris McDonough's patch from back in April, but it no longer applies cleanly, and besides, as he notes, it should really be done as a standalone extension.
Scratching my own itch:
Nice! I've been playing with this since I wanted to start using the sphinx.ext.autoclass (and now repoze.sphinx.autointerface) to generate the Grok docs. However, the HTML differs between autoclass and autointerface - it'd be nice it they were more similar. In particular: * <dl class="interface"> is needed to style the block. * The word "Interface:" should have a <span class="interfacelabel"> or something around it so that it can be hidden using CSS if desired. * <tt class="descinterfacename"> and <tt class="descname"> * Permalinks (those wierd-o backwards P characters ¶) are missing And looking at the source it looks like it the package mostly just slots in the docutils-generated HTML - so I guess it could take some wrangling to make changes to the generated HTML ... One other small thing, the install_requires for the package doesn't declare that it requires docutils >= 0.5. autoclass html ------------------- <dl class="class"> <dt id="grok.Application"> <!--[grok.Application]-->class <tt class="descclassname">grok.</tt><tt class="descname">Application</tt><a class="headerlink" href="#grok.Application" title="Permalink to this definition">¶</a></dt> <dd>A top-level application object.</dd></dl> autointerface html ------------------------ <dl class="docutils"> <dt>Interface: <tt class="docutils literal"><span class="pre">grok.interfaces.IApplication</span></tt></dt> <dd><p class="first">Marker-interface for grok application factories.</ p> <p class="last">Used to register applications as utilities to look them up and provide a list of grokked applications.</p> </dd> </dl>
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Kevin Teague wrote:
Nice!
Thanks! The source is here if you feel inspired: http://svn.repoze.org/repoze.sphinx.autointerface/trunk/
I've been playing with this since I wanted to start using the sphinx.ext.autoclass (and now repoze.sphinx.autointerface) to generate the Grok docs.
However, the HTML differs between autoclass and autointerface - it'd be nice it they were more similar. In particular:
* <dl class="interface"> is needed to style the block. * The word "Interface:" should have a <span class="interfacelabel"> or something around it so that it can be hidden using CSS if desired. * <tt class="descinterfacename"> and <tt class="descname"> * Permalinks (those wierd-o backwards P characters ¶) are missing
And looking at the source it looks like it the package mostly just slots in the docutils-generated HTML - so I guess it could take some wrangling to make changes to the generated HTML ...
Yep. It is on my list to try to get a smoother fit, but I confess that the docutils / sphinx code does not make for easy reading to my eyes. I would also like to add an ':interface:my.package.interfaces.IFoo' directive, which would work as a cross-ref target.
One other small thing, the install_requires for the package doesn't declare that it requires docutils >= 0.5.
Hmm, I guess I didn't realize that it did: what blows up with 0.4? Tres. - -- =================================================================== Tres Seaver +1 540-429-0999 tseaver@palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFI6tcZ+gerLs4ltQ4RAlxSAJ9hHUGS2c+mI5tlTU5Rklh3wafA5gCgvpFX VN9edu5Lc3lL0h8EauGKAmk= =398d -----END PGP SIGNATURE-----
participants (2)
-
Kevin Teague -
Tres Seaver