-
Notifications
You must be signed in to change notification settings - Fork 484
Code documentation support #471
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
base: glad2
Are you sure you want to change the base?
Conversation
3ac71f0
to
3a15146
Compare
Forgot to add spaces when listing ('-') <dt> elements. Also, the regex was improperly removing contiguous line breaks.
Thanks for putting in the work, initial thoughts:
|
Seems good to me. I'll be replacing DocsGL with that source. I understand that docs.gl is more a community driven documentation than a strict reference. I was also consider shipping both, but from a maintainer point of view docs.gl is not convenient. Working on resolving the other requested changes :) |
I assumed it is based on the same OpenGL-Refpages repo just already processed for better display on docs.gl but without additional curation. |
See https://docs.gl/about.html. It adds additional information to the official specs (even typo fixes) and allows contributions, but yeah, what was said about maintenance still holds. Still working on parsing Khronos reference. |
I needed the 'recover' kwarg, since some xml files were broken. See <https://lxml.de/api/lxml.etree.XMLParser-class.html>.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for putting in all the work and sorry for being so unresponsive slow, I just don't have the mental bandwidth atm.
- load lxml module first, and fallback to xml module - don't extract zip file to parse the documents - fix other formatting issues that I encountered
No worries, thank you for taking the time to review it. I'm dogfooding this docs while I'm working in some OpenGL projects, so I'll be pushing fixes as I encounter more issues. For now I've implemented the requested changes. Wish the code was more elegant, but Khronos really worked hard to make their documentation format a parsing nightmare haha. |
Hello, apologies for reviving this old thread, but are the changes from this branch going to be added to the default branch? I'd love to have documentation generated and visible when hovering over functions to make development a little easier. |
This PR adds support for optional code documentation as requested in #247.
Basically,
Specification
classes can now include documentation from a language-agnosticSpecificationDocs
class, which knows how to retrieve and parse the specs documentation from a specific source.As a proof of concept I've implemented the
OpenGLRefpages(SpecificationDocs)
class for theOpen GL Refpages
specification, using https://github.com/KhronosGroup/OpenGL-Refpages as source. OpenGL-Refpages was definitely not created to be parser-friendly, but I managed to properly parse all the commands docs (without including tables and code blocks for now).Additional sources will be needed for other specifications. Currently I'm only planning to contribute with the GL spec docs. Others can be added later with no problems.
Looking forward to feedback and willing to implement any requested modification. Thanks!
Test with:
Thinks to know:
--with-docs
flag is present. If the given specification doesn't support docs, only a warning is shown.