-
Notifications
You must be signed in to change notification settings - Fork 192
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
Documenting WorkChain and CalcJob plugins #3300
Comments
Discovered now that the reStructuredText, at least the inline literals are preserved for the |
Point 1 is not almost fixed. It is still projected using a large font and I am not sure why. But it is better. Now at least these things are projected in red and it seems easier to follow if you compliment with some reStructuredText in the documentation itself. Following the same principles for point 2 did not work and I got this:
which is caused by the |
Realize PR #3314 only addressed this issue partially in generalizing it from |
That is correct @sphuber. Thanks for leaving it open. I believe we should try to fix these issues. Maybe I will have a look at this next week if it is still open. Should be possible. |
Yes - I originally planned to address the points Espen mentioned here but then didn't manage to figure it out in time either. After looking at the built documentation with suggestion 1. implement, I think I prefer it without this modification (showing just the port names in red to me looks inconsistent, also compared to the rest of the API docs), but I would definitely support points 2., 3. and 4. |
From a UI perspective, I think making namespaces collapsible would be really neat. In HTML this could be done with the If that's reasonably possible, it would make point 3 better. Personally I'd like to keep all inputs because I keep forgetting the names of the different metadata flags, but I also agree the list is too long. |
FYI, this is a reasonable intro to creating sphinx extensions (which I should probably also watch again...) https://www.youtube.com/watch?v=8vwtgMkqE9o |
@greschd Thanks, I will watch it as well. I have rather limited experience with this, but seems like it would be time well spent. Probably not the first time we want to create something a bit outside the box. |
Oo interesting, I hadn't noticed the |
It seems |
Thanks @greschd , looks nice!
Since you're working on it now and we are going to drop python2 support early next year, I would vote for option 2; otherwise we risk it gets hanging for some time. |
One other point that isn't quite clear to me is where the extra spacing around the "namespace" port comes from - in particular there also seems to be extra space before it (e.g. namespace |
WIP branch: https://github.com/greschd/aiida_core/tree/details_directive_for_namespace It was surprisingly easy to just have the feature conditional on Py3 (did it before I saw your comment). Not sure if simply making the top part clickable is easily doable: It might mess with the indentation, because those are different levels of "bullet list". Spacing definitely needs a bit of clean-up. |
I believe this was closed by #3441, but feel free to re-open if not |
There are still some formatting issues with the current extension - see, e.g. here Space missing after It would be super useful if the docstring of the workchain could itself be rendered using sphinx - currently it's ending up in the docs as plain text, which makes it hard to read: |
That's easy to fix, you just add a nested parse. But actually there's bigger problems than that; it doesn't work correctly at all with autodocs. In #4470, I fixed the fact that autodoc was just being ignored. But now it's not, it overrides the normal class/method documenting, and the directive does not correctly store the documented objects for referencing. So now all the references are broken. There's no easy fix I see for that, I think I just need to re-write the whole thing |
I support this issue not being fully resolved. But then there is of course the question of what we can do. It seems @chrisjsewell has a pretty good overview of what is needed to make this fly properly. Can we open an issue at sphinx or the autodoc module? An alternative is to close this issue and make a couple which are more to the point. Okey for me. |
Note this issue is already being tracked in #3689, we can discuss more there |
I notice that upon including https://aiida.readthedocs.io/projects/aiida-core/en/latest/developer_guide/aiida_sphinxext.html for workchains and similar for calculations (after #3299) that it might be convenient to try to change the formatting slightly. Here is my suggestions:
Since we use a lot of inline literals for variables etc. it would be nice if we could get the
spec.inputs
andspec.outputs
names to be rendered as inline literals. Now they are rendered withlineral_strong
function from theaddnode
from Sphinx. I have tried to see it it is possible to render reStructuredText in any of thedocutils.nodes
orsphinx.addnodes
but gave up due to lack of examples that I considered to be relevant. If anyone could chime in on this, that would be great.Similarly, I would like to have the data type following the name to be projected as
:py:class:'aiida.orm.nodes.data.Dict
or similar. Then they are clickable etc. and fits with the documentation otherwise. Again, tried to search for solutions, but did not find any similar requests.It seems when using
expose_inputs
etc. we pull along everything from the bottom, meaning that for instancemetadata
is shown for allWorkChain
. I think ideally we would like to offer some granularity to this as we would like to restrict what is projected to the users.Also, when the docstring is taken from the class definition, reStructuredText is not supported, making it a bit difficult to support a good API documentation and at the same time leveraging the functionality to get the workchain and calculation documentation into a more general documentation on the workchains and calculation functionality.
Comments, suggestions, limitations etc?
The text was updated successfully, but these errors were encountered: