python


sphinx documentation: split a python source into sections, using autodoc


I'm using Sphinx with autodoc to document my sources.
Lets say i have a file pre_processing.py, containing 3 classes.
I would like to have section in the generated html files, like this
Main
====
Topic1
------
blabla
Here is included class1 and class2 doc
Topic2
------
blibli
Here is included class3 doc
However , all that i can manage so far is this:
Main
====
Topic1
------
blabla
Here is a link to class1 and class2 doc
Topic2
------
blibli
Here is a link to class3 doc
Here is cdumped class1, class2 and class3
How can this be achieved please ? Do i have to abandon autodoc, and fill my rst file manually ?
You can do that, by putting your outline (and accompanying text) into the docstring of the module itself. Let’s say this is your pre_processing.py:
# yada yada license yada
"""
Main
====
Topic1
------
blabla
.. autoclass:: class1
.. autoclass:: class2
Topic2
------
blibli
Here is a link to class3 doc
"""
class class1(…):
"""
docstring of class 1
"""
…
Then you can simply use .. automodule: in your .rst file:
.. automodule:: pre_processing
That will first read the docstring of the module and generate the documentation from there. Due to the autoclass directives in there, the classes are also documented.

Related Links

Attribute in a Class immediately runs at the wrong time?
Unable to handle “HTTP Badstatus line” exception
How to merge/join two resultset/table in django?
Maximise the Slope using CVXPY
Python-Instagram user_recent_media returning next of none
Django - AttributeError: 'module' object has no attribute 'admin'
Convert pandas (python) categorical x-axis to continuous values when plotting
How to make a specific type of python face tracker
OSError when trying to delete keys from redis
remove/reset matplotlib quiver arrows
Repeating elements in a list
Run python-rq worker process on application start
Chrome Not Starting When Using ChromeDriver
How to selectively iterate over files with Python
I'm having trouble using docker-py in a development environment on OSX
How to query AWS to get ELB names and attached instances to that using python boto modules?

Categories

HOME
dotnetrdf
symfony
system-verilog
raspbian
deep-linking
docker-swarm
filter
simpy
openwrt
uiactivityviewcontroller
keystore
android-source
flann
automata
maxima
webmethods
cross-platform
scenebuilder
chocolatey
attask
android-fragmentactivity
cvs2svn
shippo
badge
printdocument
branch
lync-2013
cgal
cortex-m3
bitcoin-testnet
sharp
rowcount
pari
percentage
construct-2
preg-grep
fabric-digits
qtablewidget
reactivemongo
openpgp
precedence
forecasting
dql
installshield-2012
soundjs
jrules
microdata
lftp
pytest-django
ivona
azureportal
spell-checking
ticker
gce
execl
sqlexception
settimeout
glkit
multifile-uploader
gherkin
clob
spatial-query
portfolio
insertion-sort
affix
ninject.web.mvc
achartengine
httpie
robocode
proximity
named-ranges
adcolony
dalekjs
code-testing
io.js
proxies
dbsetup
factors
flash-cc
openkinect
hamsterdb
healthvault
sslexception
astyanax
visual-studio-2003
shortcuts
appfog
xml-libxml
dropdownlistfor
crocodoc
mpmovieplayer
signals2
law-of-demeter
cross-domain-policy
pureftpd
email-spec
chatroom
svn-hooks
j-interop
gwt-2.2-celltable
graniteds
lazy-c++

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App