I have a Python project, and wrote many docstring in functions,
how to convert those docstring into html documentation in one or two steps,
I just want the Sphinx can act as doxygen, just convert all my comments or doctring into html documentation.
I run the sphinx-quickstart under the docs folder
then
> autodoc: automatically insert docstrings from modules (y/n) [n]: y
then modified the conf.py long_term_streaming_monitor/docs/source/conf.py
sys.path.insert(0, os.path.abspath('../../src'))
Because all of my source code are put under long_term_streaming_monitor/src
The generated code is here download
I followed the tutorial, but when I opened the index.html I got nothing, no module and methods listed on the html file link
.
├── docs
│   ├── _build
│   │   ├── doctrees
│   │   └── html
│   │       ├── _sources
│   │       └── _static
│   ├── _static
│   ├── _templates
│   └── html
└── src
    ├── long_term_streaming_monitor
    │   ├── log
    │   ├── scripts
    │   └── tests
    │       └── log
    └── long_term_streaming_monitor_.egg-info
                As mentioned in one of the comments you can use sphinx.ext.autodoc
More steps on quickstart here.
Check a example configuration file here
Bonus - you can also integrate Travis with sphinx using travis-sphinx to autogenerate your github pages each time you push a code with new docstrings.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With