-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Submodules to autosummary, and respect __all__ (patch) #317
Comments
From ciantic on 2010-01-11 18:05:57+00:00 Here is the module.rst I speaked in Bonus topic, it's rather obvious since it just includes :toctree: for all of the subthingies {{{ .. automodule:: {{ fullname }} {% block functions %} .. autosummary:: {% for item in functions %} {% block modules %} .. autosummary:: {% for submodule in modules %} {% block classes %} .. autosummary:: {% for item in classes %} {% block exceptions %} .. autosummary:: {% for item in exceptions %} With that module.rst creating documentation just from docstrings is easy piecy. You only include in index.rst the package: API Reference.. autosummary:: yourpackage |
From ciantic on 2010-01-11 19:43:12+00:00 Hmm, okay, apparently one cannot replace files... So here is second version, for some reason the original author of autosummary also thought it is a good idea to mask module attributes, why? I want to document also module attributes... |
From ciantic on 2010-01-13 17:10:36+00:00 Third installment, this has legacy mode, when tuning respect_all=False (Though as from TODO one can see, it is not configurable anyway yet). |
From ciantic on 2010-03-05 16:21:45+00:00 Okay, I decided that "fixing" autosummary is not the right thing, since it would be almost impossible to make it backwards compatible at this extent I wanted. So I created own extension that is //directly aimed at generating project package/module documentations//. My extension: Sphinkydoc can be found in http://github.com/Ciantic/sphinkydoc and so far it is only alpha and I've tested it only against tip of Sphinx. It automatically reads all modules/packages, generates documentation from docstrings and uses your project files such as INSTALL, README, CHANGES, COPYING, LICENSE to complement the generated documentation. Though, I think the generation code in my extension is far more cleaner, as it is separated to logical functions. See the generation code at http://github.com/Ciantic/sphinkydoc/blob/master/src/sphinkydocext/generate.py where various documentation generations tooks place. |
From Georg Brandl on 2010-04-06 09:03:17+00:00 Thanks for your work! A look at Sphinkydoc is already on my to-do list. Assuming you're still interested in contributing to Sphinx itself (I've sadly neglected your work a bit because I had to concentrate on getting domains ready), I think we can target this to version 1.1. |
From ciantic on 2010-04-06 19:47:41+00:00 No harm done, I think this separate extension approach is much better. Since autosummary is good for creating the tables at some level, but for actual documentation generation it was not suitable. Basically Sphinkydoc is split on two parts: Generating sphinx configuration //the actual conf.py// using sphinkydoc.py (script) which to some degree is a rather extreme.Actual documentation for helper pages (such as LICENSE, COPYING, ...) and modules, packages are generated using sphinkydocext (extension).As a pure extension it is not as useful as a script. My extension is not release ready, no single tag is yet added... Nevertheless one should be able to try it (see README) by fetching the source (adding src to pythonpath) and going to docs/ directory underneath sphinkydoc dir and running "sphinkydoc.py sphinkydocext"... It does many kinds of documentation generation. I'm very much interested to develop sphinkydoc forwards as it currently works for all of my small projects. The main improvement I'm working on is to be able to read project's setup.py and incorporate interesting information to documentation automatically. I haven't had time lately to improve it. |
From Georg Brandl on 2014-01-10 19:36:39+00:00 This has lingered too long (my fault) and won't apply anymore. |
== 1.) I implemented //submodules// to autosummary extension. ==
See the following diff. After that patch one can use them in
module.rst
for example:== 2.) I made the module to respect all ==
//If the module being summarized has defined all, otherwise it fallbacks to dir() that was used before.
They are both in same patch, because they depend on each other somewhat, and they belong to same section of code.
== As a bonus. ==
After that patch, one can //generate// whole documentation of //package//, all classes/submodules/functions etc with one custom module.rst. I will paste it to comment of this Issue, so others can use it also. This beats the living crap out of EpyDoc any day :) Even for small projects...
The text was updated successfully, but these errors were encountered: