sphinx-notes / pages

Github Actions for publishing Sphinx HTML output to github pages
https://sphinx.silverrainz.me/pages/
MIT License
79 stars 34 forks source link

It would be awesome if you could add a spot for apidoc calls #16

Open Jnorm911 opened 1 year ago

Jnorm911 commented 1 year ago

An option before the push that would allow us to enter a popular apidoc call for example "sphinx-apidoc -f -o . .." With this we could completely automate sphinx docs on push.

SilverRainZ commented 1 year ago

Hello, sorry for replying so late.

Do you have an example of this? If we generate apidoc for a python object, we do not need to call sphinx-apidoc by hand.

hesic73 commented 6 months ago

I've encountered the same issue and have implemented some modifications in my fork available at https://github.com/hesic73/pages, where I also introduced a parameter module_path. To enable sphinx-build to locate the module, it's essential to add the following lines to conf.py:

import os
import sys
sys.path.insert(0, os.path.abspath('..'))
SilverRainZ commented 6 months ago

Hi @hesic73, what the value of module_path should be?

B.T.W. Are you willing to make a pull request?

hesic73 commented 6 months ago

According to https://www.sphinx-doc.org/en/master/man/sphinx-apidoc.html, MODULE_PATH is the path to a Python package to document. For example in my repository, module_path=gomoku_rl.

For now it's hard-coded. But this should be an optional parameter. Maybe I will change the code and make a pr.

SilverRainZ commented 6 months ago

Yes, it would be better to make the parameter optional. Besides, I think apidoc_module_path should better than module_path.