gramps/docs
Jérôme Rapinat e76a52b0bd update API documentation (3.4)
svn: r18938
2012-02-20 15:04:41 +00:00
..
corecli update API documentation (3.4) 2012-02-20 15:04:41 +00:00
coregui update API documentation (3.4) 2012-02-20 15:04:41 +00:00
gen update API documentation (3.4) 2012-02-20 15:04:41 +00:00
api.rst update API documentation (3.4) 2012-02-20 15:04:41 +00:00
conf.py update API documentation (3.4) 2012-02-20 15:04:41 +00:00
date.rst 4935: update API documentation 2011-06-01 12:45:39 +00:00
developer_guide.rst 2691: Create api documentation with sphinx 2009-06-24 21:56:07 +00:00
html.rst 2691: Create api documentation with sphinx 2009-06-24 21:56:07 +00:00
index.rst 2691: Create api documentation with sphinx 2009-06-24 21:56:07 +00:00
Makefile 2691: Create api documentation with sphinx 2009-06-24 21:56:07 +00:00
README.txt fix typo 2009-08-22 21:45:34 +00:00
relationship.rst 4935: Update API documentation for Gramps 3.3.x; add localized handlers; start CLI and GUI 2011-05-27 17:12:11 +00:00
simple.rst 4935: Update API documentation; add Simple API 2011-06-14 09:54:16 +00:00
user_guide.rst 2691: Create api documentation with sphinx 2009-06-24 21:56:07 +00:00
utils.rst 2691: Create api documentation with sphinx 2009-06-24 21:56:07 +00:00

Installation and building the docs
==================================

You need to install sphinx. Assuming you have installed the python setuptools, just do:

  sudo easy_install sphinx 

Once installed, go to the docs directory, and do:

  make html

Which will produce the html output in docs/_build/html


Documentation Guidelines
=======================

Doc strings in python files should be written in reStructured text: http://docutils.sourceforge.net/docs/user/rst/quickref.html

The typical docstring for GRAMPS should look like this: 

"""Brief synopsis

This is a longer explanation, which may include  *italics* or **bold**, or
a link to another method :meth:`~gen.lib.person.Person.get_handle`
Then, you need to provide optional subsection in this order (just to be
consistent and have a uniform documentation, nothing prevent you to switch
the order). 

:param arg1: the first value
:type arg1: int or float or :class:`~gen.lib.baseobj.BaseObject`
:param arg2: the second value
:type arg2: int or float 
:param arg3: the third value
         
:returns: arg1/arg2 +arg3
:rtype: float, this is the return type
            
       
:Examples:

>>> import template
>>> a = MainClass()
>>> a.function2(1,1,1)
2

:note:
    can be useful to emphasize
    important feature

:See Also:
    :class:`MainClass1`
       
:Warnings:
    arg2 must be non-zero.
            
:Todo:
   check that arg2 is non zero. 
"""

For a class, use :cvar variable: for class variable, :ivar variable: for instance class
variable, .. attribute:: attribute: for attributes, .... 
See http://sphinx.pocoo.org/markup/desc.html and http://sphinx.pocoo.org/markup/inline.html

Tips and Tricks
===============
Change in many files something:

perl -pi -w -e "s/L{PersonRef}/:class:\`\~gen.lib.personref.PersonRef\`/g;" *.py 

here L{PersonRef} is changed in :class:`~gen.lib.personref.PersonRef
`