-
Notifications
You must be signed in to change notification settings - Fork 9
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
Resolve TODO sections in README.md regarding C++ and Python API documentation #58
Comments
I was in the very same position just a few hours ago, and wrote down some notes on my blog, perhaps they are of use to you! (I will see if i can add this in a nicer form to the official docs perhaps?) |
@ottojo Just followed your blog and it's nothing short of awesome. Worked first shot for me and will be useful for many others who are in the same situation: have a README.md and would like to see that show up in a nicer formatted form together with links to the API documentation. Alas following your blog I only get C++ API generation, but since my package is a pybind11 wrapper, the generated C++ docs are useless, I really need the python API. Now I have to figure out how to extract that from pybind11. Your blog gave me a good starting point for that. Thanks again! |
Hi @berndpfrommer, We should definitely update the README to replace those TODO statements (all except In the meanwhile, I hope you can get an idea of how to setup Let's consider the Cpp + Python package use case.
Another relevant example is
|
@Yadunund thank you very much for the pointers. They fill in the gaps left from @ottojo 's blog and in combination with the tricks from @ottojo 's blog I get very satisfying results, at least when I locally build with rosdoc2. Why the page at docs.ros.org is not updating I don't quite understand. I'll probably have to release the package again. |
I assume your package already has an entry in a |
Yes, the package has a doc entry in distribution.yaml, and I see it actually rebuilt the docs on Feb 23rd so that is working, thanks again for the pointers! However, an error occurs that I don't see when building locally:
I think that is why the Python API documentation is not generated (that works when running rosdoc2 locally). |
Glad to head that the doc job rebuilt. Regarding the import errors, this usually happens when I'm curious if when you run The |
It is as you expected: if I don't source my local workspace, I get the error below, if I source it, the error disappears:
I checked my |
Is |
Yes, |
I see thanks for that information. You could rely on |
If I put this line into package.xml:
I get this error:
It doesn't look to me like it would depend on any other modules except maybe on rclpy, which I also tried but it makes no difference, whether I doc_depend or exec_depend on it. Lastly, I ran
Not sure if that causes the import to fail. |
@berndpfrommer maybe you are not configuring the python module search path correctly in spinx conf.py. rclpy adds and the autogenerated edit: Since rosdoc2 wraps the custom |
@ottojo That may really be it, and in fact I pushed some changes along those lines yesterday night but the doc job run is not triggered for some reason: https://build.ros2.org/job/Idoc__event_camera_py__ubuntu_jammy_amd64/ |
Meanwhile the job has run (whatever triggered it I don't know) but just adding the line |
Oh, i did not realize that the python module in To do this, it would probably be necessary to build the package (creating the python module) before running sphinx (which must import the python package, which doesnt exist without building the c++ code...). I don' t know if the documentation CI job has a way to do this already... |
I tried to document my package using rosdoc2, but alas, the sections of the rosdoc2 README file have "TODO" entries exactly where it gets interesting. I basically want to have a custom landing page with links to auto-generated C++ API and Python API documentation. In fact I have a pybind11 (C++/Python) code base that I'd like to get working as well. If you don't have time to write documentation, could you please provide a link to a working example in place of the "TODO" entries. Much appreciated!
PS: I would offer to help filling in the documentation blanks but it really takes a while to get the knack of these document generators. I couldn't get much working without cook-book style instructions.
The text was updated successfully, but these errors were encountered: