-
-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create sphinx autodoc extension for param #197
Comments
I agree the extension should be supported at the param level instead of wherever it lives right now... |
This would be great to have! Who knows how to do it? Smells like this would entail making a |
@jlstevens is there a way to generate docs from params right now? In whatever form? |
nbsite does have a paramdoc Sphinx extension. I've improved it a fair bit but it's still not great. This would be of huge value if someone were to pick it up and improve it. I also agree it should move into the param repo. |
I've made a mock project where I use an adaptation of the paramdoc extension in case anyone finds that useful: https://github.com/Jhsmit/param_docs Basically the idea is to make the output as readable as possible for non-experts who just want to use the GUI. |
@Jhsmit That output looks pretty good! I think the param sphinx extension would ideally be in its own repo. I don't know how @jbednar or @philippjfr feel about this, but if @Jhsmit is willing to be a maintainer, this could be moved to pyviz-dev... |
I would be happy to be a maintainer, however I find myself wanting to contribute several parts of panel but I never find the time to do so. The mock project I made above is mostly driven by needing it for my own applications. So I can't guarantee any time investment. |
Is there some reason not to have that in the Param repo? |
Sure. That does at least make more sense than shipping it with |
@jbednar Good point this indeed needs some whitespace in between. This might not be wanted behavior for the general use-case so maybe it should be configurable. What I was aiming for is to document only what users see in the GUI, so internally used args kwargs are ignored. I suspect that a separate repo might make configuration for users easier when its a full sphinx extension rather then a module within Param. When its a sphinx extension, the configuration would be the more general: extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.mathjax',
'sphinx.ext.viewcode',
'numpydoc',
'paramdoc'
] compared to def setup(app):
app.connect("autodoc-process-docstring", param_format_basic, priority=-100) Although I dont know how sphinx extensions work exactly. |
Makes sense. In my own work I rarely use anything but Parameters on a Parameterized, but that seems like an issue for a tool like HoloViews, where there is always a positional argument "data" followed by parameters. In that case the data argument would never get documented, so it's definitely important to make that behavior be configurable. I don't know much about how sphinx extensions work either, but I would assume that it's not the repo that would matter, it's the packaging. I.e. surely the sphinx extension can live in the same param github repo in a subdirectory, even if it's shipped to the user as a sphinx extension installed separately. |
We are already doing things to make param work well with sphinx, but I think if possible we should capture that into a sphinx autodoc extension.
Would make it easier for others to use (e.g. see ioam/ioam-builder#3).
The text was updated successfully, but these errors were encountered: