Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python: Can the pydoc module output HTML docs with relative paths?

Tags:

python

html

pydoc

I am using the pydoc module to output documentation for some types which I have defined with the C API. The types I want to document don't exist until the interpreter has been embedded inside my C program, so I can not use the pydoc command.

I get my C code to call a function which does something like this:

d = pydoc.HTMLDoc()
content = d.docmodule(sys.modules["mymodule"])

This works, but generates HTML pages with hard coded 'file:/' link targets. Is there a way to use relative paths for links?

(Extra points for a better way to document types defined in the C API)

like image 687
Edd Barrett Avatar asked Jun 17 '11 17:06

Edd Barrett


1 Answers

I think Sphinx does a better job at this. Here is how you document a C domain:

http://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html#the-c-domain

like image 158
Alex Plugaru Avatar answered Nov 14 '22 21:11

Alex Plugaru