I need some help with sphinx doc generator My git repo looks like this:
root:
.. include:: ../../repo/boot.py
Boot file
==========
and my toctree in index.rst looks like this:
.. toctree::
:maxdepth: 2
:caption: source code:
Boot file <boot_link.rst>
And now Spinx can read my boot.py file, but it is a total mess. The boot page looks like the follow:
EDIT: Okay, I found the solution. add this to index.rst:
.. toctree::
:maxdepth: 2
:caption: source code:
autodoc
add this to conf.py
import os
import sys
sys.path.insert(0, os.path.abspath('../../repo/'))
and also this:
extensions = ['sphinx.ext.autodoc']
and finally create autodoc.rst like this:
.. _autodoc:
.. contents::
something.py
=================
.. automodule:: something
:members:
:undoc-members:
something1.py
=================
.. automodule:: something1
:members:
:undoc-members:
something2.py
=================
.. automodule:: something2
:members:
:undoc-members:
I think that is it.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.