-
Notifications
You must be signed in to change notification settings - Fork 424
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
Implement support for interfaces in chpldoc #17383
Comments
I'd like to work on this! |
Oh cool! This is more from the feature side of things but may still be useful to you. Definitely let me know if you have any questions |
I've been getting acquainted with the chpldoc and the sphinxcontrib-chapeldomain codebase.
Could you point me to where I can find how the classes and records are handled? I'm assuming it is somewhere here.
Could you elaborate as to what I need to do here as well. Pointing me to some code will definitely help! |
You'll probably use something this from that file as part of your implementation, and make a version of this for interfaces. I think other changes will be best found by searching for references to those structures.
Sure! The main Chapel compiler stuff supporting chpldoc happens in this file or in the printDocs method of individual AST nodes (e.g. FnSymbol's printDocs method). For the specific AST node handling of interfaces, @vasslitvinov should be able to give pointers - I haven't looked through that code yet. |
Hi Lydia! After a lot of time spent (mostly) understanding what's happening in sphinxcontrib-chpldomain, I think I've understood what exactly needs to be done. the chpldomain needs to be updated in order to be able to output documentation for If so, that brings me back to the code currently available for classes/records. I'm not able to figure out what exactly is going to be different from the code available, other than having to add |
Partially! We definitely will want to be able to reference the interfaces that have been defined and used, probably by making a
That looks like places you'll want to update, yeah. I think the "role" section below the last two will also need to be updated like I mentioned earlier in this comment, and then you'll need to look elsewhere for how to add the |
To Dos:
|
So when a definition is made in the references.rst file, for example, the class directive on line 133, and the necessary changes are made here and here(for the definition itself) and here to enable cross-referencing for the role, the interface role will link directly to the definition in references.rst? Also, could you check if I'm heading in the right direction wrt the todos I've posted above? |
I believe so, but to be absolutely clear, I would expect you to have to write Those are very good TODOs - the last one will need to be merged once the rest are merged into the Sphinx domain repository and a new release is pushed (which I control and won't require as much pomp as the chapel-lang/chapel repository does). I believe there are ways to test it prior to an official Sphinx domain release, to ensure we don't have to push multiple releases to get something that chpldoc itself fully uses. |
I see! Also, tags are not specific to any single directive like
Sounds good. I'll focus on the rest for now.
I was curious about this as well. How would this work? |
I think that the logic is at least partially handled by Sphinx itself, see Sphinx's documentation on roles, so probably what you need to do is just make sure it is listed as a role and Sphinx will handle the rest? I'm not completely certain but that seems likely.
That looks right to me.
Huh, looking at the implementation and testing it myself I guess you are right? You might be able to add the
If my memory serves, it involves modifying the sphinxcontrib-chapeldomain line in $CHPL_HOME/third-party/chpl-venv/chpldoc-requirements.txt. I think you can make that a relative path to where your repository is checked out (but be sure not to commit that change!) |
I'm testing this out now. I also found some articles and material online about custom sphinx roles (ref). These are the roles defined in the chapel domain. To be honest, I'm not quite sure what is happening with roles.
Looks like it. I feel the init.py file might benefit from some refactoring on the whole (comments are from 2010 and docs/comments can be a bit more descriptive). what does |
Is there any specific necessity to run tests on sphinxcontrib-chpldomain using py2.7 as well?
Its been specified here. Also, I think it may be better to just change the |
Huh. I'm not sure. My best guess is currently that it should be "return" but was a typo, given what else is in the list of groups.
No. We expect Python 2 to stop being available in newer system, and earlier versions of Sphinx aren't compatible with a newer Python 3 than 3.4 if I remember right (which is also deprecated if I remember right).
Huh, I hadn't noticed that was still like that. My use of tox has been through running the release script but that script uses a later version of Python as well, maybe it was working for me because that version was overriding the version in that file? We probably need to adjust our scripts to better test that style of execution. |
Hey @lydia-duncan ! Just a quick update.
After searching around a bit, I'm quite positive
Just to confirm, you mean this file right? I've written a few test cases to check if the changes I mentioned in the above to-do list are enough, but some of them are failing. I'll keep you posted. |
Oh, neat!
I was referring to this file, but that one also uses tox and overrides its settings.
Awesome, thanks :) |
Involves:
The text was updated successfully, but these errors were encountered: