Some hints on writing documentation with Sphinx for web2py
If you use Eclipse / Pydev you can define this piece as template.
creating tables in ReST can be painful. Here is a module that can help:
easy_install prettytable
import prettytable as pt
mytable =pt.PrettyTable(["id", "category", "recipie"])
print mytable # copy & paste this into your ReST document!
mytable_string = mytable.get_string() # or insert this string when
generating automatic documents
Follow these steps:
easy_install -U sphinx
built with custom make files for web2py => Note: we could create a cross-platform python script for this!
- unix-like: sh doc/make-doc_html.sh
- windows: doc\make-doc_html.bat
Due to the special manner of the web2py import mechanism it requires that the doc is built from the web2py root directory.
the result will written to: web2py/applications/examples/static/sphinx (the target directory will be automatically created)
Warning
Please ask on the Mailinglist before commiting or pushing to the repositories.
So far, it has not been agreed on a proper setup to mutually edit the documentation and especially how to correct the docstrings without getting to many DVCS conflicts.
branch the web2py Sphinx code:
bzr branch lp:~web2py/web2py/web2py-sphinx
cd web2py-sphinx
pull the latest code from web2py Sphinx branch:
bzr pull
pull latest web2py development version:
bzr pull http://bazaar.launchpad.net/~mdipierro/web2py/devel/
change and edit the documents or docstrings with your edior
push the changes to the web2py Sphinx branch:
bzr push lp:~web2py/web2py/web2py-sphinx
This requires that you are a member of the web2py team at Launchpad and registered at Launchpad with your SSA keys. You can find more info on the Launchpad help page