gramps/docs
2019-08-21 13:46:45 -05:00
..
corecli
coregui FadeOut removed from ValidatableMaskedEntry 2016-09-25 09:30:06 +10:00
gen Fix ImportError & update API docs year 2018 (#564) 2018-02-28 16:53:37 +11:00
api.rst Add gui.widgets section to the documentation 2013-11-15 19:13:29 +00:00
conf.py Prepare for 5.1.0 release 2019-08-21 13:46:45 -05:00
date.rst Rename DateDisplaySR_latin to DateDisplaySR_Latin 2016-09-25 09:36:10 +10:00
developer_guide.rst
html.rst
index.rst 2691: Create api documentation with sphinx 2009-06-24 21:56:07 +00:00
make.bat Update Sphinx files - includes make.bat for windows 2015-08-18 12:05:25 +10:00
Makefile Update Sphinx files - includes make.bat for windows 2015-08-18 12:05:25 +10:00
README.txt Update outdated links for http://sphinx-doc.org/ 2015-08-22 10:28:08 +10:00
relationship.rst
simple.rst
update_doc.py 8855: start to update API doc for DB stuff 2017-02-02 10:34:18 +01:00
user_guide.rst

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

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

  sudo easy_install sphinx
or
  sudo pip 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-doc.org/markup/ and http://sphinx-doc.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
`