How to create Sphinx-based documentation in a Jython project?

I am working on several Jython projects using libraries written in Java. I would like to create good documentation with Sphinx thanks to the autodoc extension. However, when I try to create html, I get errors because autodoc cannot find libraries written in Java:

sphinx-build -b html -d _build/doctrees . _build/html Running Sphinx v1.0.5 loading pickled environment... done building [html]: targets for 1 source files that are out of date updating environment: 0 added, 1 changed, 0 removed reading sources... [100%] index /Users/myName/myJythonProject/doc/index.rst:14: (WARNING/2) autodoc can't import/find module 'myJythonProject', it reported error: "global name 'PoolManager' is not defined", please check your spelling and sys.path 

where PoolManager is a Java class.

Can someone help me solve this problem?

+7
source share
1 answer

Sphinx can be used to document Jython projects, but autodoc does not work for code written in Java. The autodoc function imports and validates Python modules. There is no support for doing the same with Java classes.

An autodoc implementation (or something similar) for Java seems doable, but someone should volunteer to do it. See this comment by Sphinx Georg Brandl: http://www.mail-archive.com/ sphinx-dev@googlegroups.com /msg03162.html .

I found some information about the proposed GSoC 2010 project aimed at implementing multiple language support for autodoc. But according to this blog post , the project was not completed. The developer decided to work on another GSoC project.

sphinx-contrib repository does not contain anything related to autodoc.


Update

There is a new Sphinx extension called javasphinx that looks interesting. I have not used this extension, but according to the documentation, it can create reST sources from Java code:

The javasphinx-apidoc is a counterpoint to the sphinx-apidoc within the Java domain. It can be used to generate a restart source from existing Java source code, which has been tagged with Javadoc-style comments. the generated repeater is then processed along with the Sphinx handwritten documentation.

javasphinx uses another library called javalang .

PyPI Packages:

+6
source

All Articles