pages icon indicating copy to clipboard operation
pages copied to clipboard

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

Open Jnorm911 opened this issue 2 years ago • 5 comments

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.

Jnorm911 avatar Oct 20 '22 00:10 Jnorm911

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.

SilverRainZ avatar Nov 05 '22 11:11 SilverRainZ

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('..'))

hesic73 avatar Feb 29 '24 23:02 hesic73

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

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

SilverRainZ avatar Mar 01 '24 08:03 SilverRainZ

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.

hesic73 avatar Mar 02 '24 01:03 hesic73

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

SilverRainZ avatar Mar 02 '24 11:03 SilverRainZ