-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Automate generation of reference docs with doxygen and breathe #598
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
Conversation
|
Hi @dean0x7d, it looks like one |
|
Thanks for advice. Made PR so it can be aboveboard. |
|
I think this looks fantastic. Having more comments in the header files will surely also be appreciated by people reading the code. The |
|
The reference docs now cover more code. There's lots more that can still be added, but I think this should be enough for this PR -- to establish the general framework and have some doxygen/breathe examples for reference when documenting new features. Small note: Doxygen's log contains a few warnings. It gets a bit confused by the Let me know if there's anything about the style or organization that should be changed. Otherwise, if this looks OK, I think it's good to go. |
Will it support regular doxygen format now, or would I have to use |
|
|
|
Merged! Sorry for the delay, I was completely swamped this last month. |
This is an effort to update and complete the API reference docs. Keeping the docs together with the code should help the docs stay up to date. This PR puts an automated system in place: 1. Doxygen grabs the docs by parsing the headers and generates xml output. 2. Breathe provides new sphinx directives which read the xml files.
So far, I've only ported and updated the existing classes/functions from the reference page. This is to get a sense of what it would look like and see if this should move forward. A preview of the output is available here: http://pybind11-breathe.readthedocs.io/en/latest/reference.html
Documentation format: The doc comments can be written in reStructuredText or doxygen formats. I copied the existing docs from the .rst file and kept the original reST format. But I don't have a strong preference either way.
For reST, a downside is the need to surround comments with
\rst\endrstin order to enable cross-references and directives (.. code-block::, etc.). For simple plain-text doc comments, the extra\rst\endrstcan be omitted. I've set the default reST `text` role toany. This makes `object` work just like :class:`object` and `object::release` is equivalent to :func:`object::release`. This makes for easier reading and writing of doc comments.The standard doxygen format can also be used if preferred. Let me know if this is the case.
Doxygen version: A fairly new version of doxygen is required to parse some of the more obscure C++11 in the headers (ref qualifiers). Unfortunately, the latest version (1.8.13) has a nasty segfault issue, so the requirement is either 1.8.12 or the latest 1.8.14 dev build (
brew install --HEAD doxygenworks nicely on macOS). Appropriate versions are installed on readthedocs and travis.Let me know what you think. If this looks OK, it can be expanded to cover more code.