-
Notifications
You must be signed in to change notification settings - Fork 45
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
[PoC] Documentation generation #275
Conversation
I think I would like to generate |
Oh, I see from the failing check that this is also generating the doxygen-style comments. |
Yes this is actually already the case in @rajveermalviya's code in main, just ignoring it in case the doc equals
That's indeed part of the open questions arising from this first PoC indeed. I considered the option of going through Doxygen indeed, I'd say that there are pros and cons to using Doxygen:
I admit that I may also be biased by the way the raw HTML output of doxygen looks, but there may be ways to get it right.
Agreed for sure!
No worry, I'm aware that this is an early test that may end up entierly dropped! As long as it helps asking the right questions it's fine with me. |
Added a note in the first comment about the intended goals of the documentation. The documentation of WebGPU Native should be:
This should drive the choice of technical tool, rather than the other way around. :) |
We (@rajveermalviya and Dawn people) discussed this in a meeting and here's our suggestion: Mar 14 meeting:
|
Okey let's give a shot to Doxygen then! I carried this in a separate repo so we can easily compare:
So far the outcome of my tests:
|
Mar 28 meeting:
I'll add, the most important thing was that the documentation is passing through Doxygen-style doc comments (to make sure IDE support works well and avoid extra maintenance work). So, if you think we should use a different tool like MkDoxy/Breathe to generate the actual documentation we publish, that would most likely be fine. Aside, I tried looking up if it was possible to use doc comments to direct Doxygen to expand specific macros. Unfortunately it seems not. |
My comments on the generated documentation itself:
|
Thx for the feedback! I'll do the suggested updates. The main thing that still bother me are URLs. I really believe that it is important to have clear forgeable URLs in an API spec, I'll see what we can do. Regarding the content of the doc, I was thiking it could be interesting to organize a little "doc jam"/"docathon"/whatever to have people help copy relevant parts of the JS doc in |
I have some ideas about how we should do this, in particular if possible we should reuse / pull in / reference what we already have in the JS spec. Let's discuss that on #25 |
Any progress on this? My guess is the only way would be to generate docs using something other than Doxygen (but still using the doc comments). Things I found online seemed to say Doxygen couldn't do this. That said, I would like to start getting changes merged, even if we generate using Doxygen for now. We can just hold off on actually publishing docs (on github pages) until we have the permalinks we want. |
f0a33b4
to
b9dbc76
Compare
Since we're sure we'll go for Doxygen at least internally to make sure docstrings are correctly generated, I switched this PR to the doxygen version and cleaned it up a little bit to be able to merge things! |
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.
Looking great, just a few small things before I think we should land this initial work!
Thanks for the feedback @kainino0x! I addressed all of your points. I had left the Doxyfile to what doxygen's initialization generates but I agree it is better to only leave what we set to non default values. I tried to document each choice in the comments |
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.
Few failing checks:
- webgpu.h needs to be regenerated
doc/generated/html: Cannot open: No such file or directory
doc/theme/LICENSE.txt
Outdated
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.
This made me think: Would it be possible to include this theme as a submodule instead of copying the files in?
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.
I personnally find it easier to maintain copy pasted code with only what we need from a repo rather than to use submodules (no need to warn users about the presence of submodules, no need to download the whole git history of the other repo, no need for half the repo -- though in this case its ok, no need to maintain a mirror in case the third party force pushes, etc.) but we can easily switch to a submodule pointing to https://github.com/jothepro/doxygen-awesome-css indeed!
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.
A submodule could make sense here though, because since the raw doxygen output is not satisfying due to dirty URLs, we may want to avoid poluting the git history with theme files that we may eventually get rid of in favor of a different solution (I've started looking at sphinx-breathe, not ideal neither, the more I work on this the more I lean towards heading back to a Doxygen-less generation)
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.
I'm not too worried about a submodule being annoying, fortunately not very many people will need to check out and build the docs for this repo. (And you don't even need to subrepo if you're not building docs)
That said, if you think the theme is likely to be short-lived since we'll replace Doxygen or replace the theme, how about we just start without a theme? The output may initially be ugly, but we can improve it later.
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.
Hey @eliemichel I'd love to get this landed, what do you think of the proposal to remove the theme?
I'd be happy to implement it and land the PR if you don't have a chance to do it.
We'll potentially look into theming (or using another doxygen-compatible documentation generator) later on. Also moves the gitignore line to doc/ so that Doxygen has a directory to generate into.
Landing without theme so we can get some generated documentation up and set up GitHub Pages! |
... and it just worked! https://webgpu-native.github.io/webgpu-headers/ |
That's pretty nice! Thank you @eliemichel! |
Starting from @rajveermalviya gen scripts, I did a draft of a documentation generation (using MkDocs for the final HTML generation).
The generated doc can be seen here: https://eliemichel.github.io/webgpu-headers
This is a Proof of Concept rather than something to merge as is. Some notable points:
api/Foo
to work with any function or object typeFoo
so that it is easy to forge urls, but at the same time the current state where functions are grouped by object make sense as well. Maybe there could be a global redirection mechanism on top of the more hierarchical approachEdit. Maybe this could be an opportunity to write up a wish list about the future documentation. The documentation of WebGPU Native should be: