[Ncr-Python.in] Documentation using Sphinx
Hi, I am trying source code documentation using Sphinx. Here i have to copy paste all modules in to *.rst file, that is painful. Have any way to create documentation (doc for all modules, classes and methods in the project directory) from project folder quickly. I also planing to add a code browsing facility in the document, for example: code should display if we click on a method/class name in the doc, does sphinx has this feature??? or what tool i have to choose for that ???.
2011/12/8 Saju M <sajuptpm@gmail.com>
Hi, I am trying source code documentation using Sphinx. Here i have to copy paste all modules in to *.rst file, that is painful. Have any way to create documentation (doc for all modules, classes and methods in the project directory) from project folder quickly. I also planing to add a code browsing facility in the document, for example: code should display if we click on a method/class name in the doc, does sphinx has this feature??? or what tool i have to choose for that ???.
sphinx has the feature to view the class, method's source code and/or doc string using the side panel link of every page. It should be like 'view source' and 'view doc'. I am using sphinx, I feel it is best tool to generate the documentation. http://matplotlib.sourceforge.net matplotlib web site is designed by sphinx only. http://matplotlib.sourceforge.net/devel/documenting_mpl.html?highlight=sphin... Here is the good documentation about how to start/use the sphinx tool. Matplotlib contributed to sphinx by 1. generate the py module class inheritance diagram as image 2. ipython colorize in sphinx 3. etc We can customize the css, if need. -- Regards, Arulalan.T Project Associate Centre for Atmospheric Sciences Indian Institute of Technology Delhi My Experiments In Gnu/Linux ! : http://tuxcoder.wordpress.com Kanchi Linux User Group Rocks ! : http://kanchilug.wordpress.com
Thanks Arulalan, sphinx has the feature to view the class, method's source code and/or doc string using the side panel link of every page. It should be like 'view source' and 'view doc'. Could you please share links of documentation which have python source code browsing feature .???? On Thu, Dec 8, 2011 at 9:41 PM, Arulalan T <arulalant@gmail.com> wrote:
2011/12/8 Saju M <sajuptpm@gmail.com>
Hi, I am trying source code documentation using Sphinx. Here i have to copy paste all modules in to *.rst file, that is painful. Have any way to create documentation (doc for all modules, classes and methods in the project directory) from project folder quickly. I also planing to add a code browsing facility in the document, for example: code should display if we click on a method/class name in the doc, does sphinx has this feature??? or what tool i have to choose for that ???.
sphinx has the feature to view the class, method's source code and/or doc string using the side panel link of every page. It should be like 'view source' and 'view doc'.
I am using sphinx, I feel it is best tool to generate the documentation.
http://matplotlib.sourceforge.net matplotlib web site is designed by sphinx only.
http://matplotlib.sourceforge.net/devel/documenting_mpl.html?highlight=sphin...
Here is the good documentation about how to start/use the sphinx tool.
Matplotlib contributed to sphinx by
1. generate the py module class inheritance diagram as image 2. ipython colorize in sphinx 3. etc
We can customize the css, if need.
-- Regards, Arulalan.T Project Associate Centre for Atmospheric Sciences Indian Institute of Technology Delhi
My Experiments In Gnu/Linux ! : http://tuxcoder.wordpress.com Kanchi Linux User Group Rocks ! : http://kanchilug.wordpress.com
_______________________________________________ http://mail.python.org/mailman/listinfo/ncr-python.in Mailing list guidelines : http://lug-iitd.org/Mailing_List_Guidelines
2011/12/8 Saju M <sajuptpm@gmail.com>
Thanks Arulalan,
sphinx has the feature to view the class, method's source code and/or doc string using the side panel link of every page. It should be like 'view source' and 'view doc'.
Could you please share links of documentation which have python source code browsing feature .????
The python code browsing feature is you have to enable while you running $ sphinx-quikstart . At that time it should ask question like, do you need code browsing option ? y/n [n] . By default it takes 'no' option. You have to give 'y' option. So that while you build html, that should come up with the code browsing style also. -- Regards, Arulalan.T Project Associate Centre for Atmospheric Sciences Indian Institute of Technology Delhi My Experiments In Gnu/Linux ! : http://tuxcoder.wordpress.com Kanchi Linux User Group Rocks ! : http://kanchilug.wordpress.com
Thanks Arulalan, If we use "sphinx-apidoc" tool code browsing feature will come automatically. Another issue with 'inheritance-diagram -------------------------------------------------------- I am using "sphinx-apidoc" for documentation $ sphinx-apidoc -f -F -o . /home/sam/CMS $ make html I want to include class 'inheritance-diagram' in all my module document page. Right now, i have to edit all *rst file and add two lines as shown below, for each modules. class inheritance diagram ------------------------- .. inheritance-diagram:: CMS.cloud.DbModel.modulename Have any otherway to do it in single shot, like what "sphinx-apidoc" did for documentation ??? I could not find any option in document of "sphinx-apidoc" tool http://sphinx.pocoo.org/invocation.html#invocation-of-sphinx-apidoc
2011/12/14 Saju M <sajuptpm@gmail.com>:
Thanks Arulalan,
If we use "sphinx-apidoc" tool code browsing feature will come automatically.
Another issue with 'inheritance-diagram --------------------------------------------------------
I am using "sphinx-apidoc" for documentation $ sphinx-apidoc -f -F -o . /home/sam/CMS $ make html
I want to include class 'inheritance-diagram' in all my module document page. Right now, i have to edit all *rst file and add two lines as shown below, for each modules.
class inheritance diagram ------------------------- .. inheritance-diagram:: CMS.cloud.DbModel.modulename
Have any otherway to do it in single shot, like what "sphinx-apidoc" did for documentation ??? I could not find any option in document of "sphinx-apidoc" tool http://sphinx.pocoo.org/invocation.html#invocation-of-sphinx-apidoc
Sorry Saju, I searched in sphinx documentation site, couldnt get option to satisfy your need. If you think that some thing is not there in foss tool, then as a developer you itself develop/enhance it ! Scratch your own itch ! This is how most of the foss tools are developed. :-) Wishes. -- Regards, Arulalan.T Project Associate Centre for Atmospheric Sciences Indian Institute of Technology Delhi My Experiments In Gnu/Linux ! : http://tuxcoder.wordpress.com Kanchi Linux User Group Rocks ! : http://kanchilug.wordpress.com
participants (2)
-
Arulalan T -
Saju M