-
Notifications
You must be signed in to change notification settings - Fork 10
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
Process user's conf.py and index.rst through templates like the default version #42
Comments
This is going to be a pivotal issue for me to make progress with rosdoc2. I'll be doing a PR to suggest adding this feature, but let me show you where I want to go. Below is the current version of the index.rst template from my experimental rosdoc2 repo branch. There are a lot of things that only are displayed if a package has certain features (like a /doc directory, or a python API for example). It is easier to see what is going on, and manage, this in template code than by piecing it together using python, or using the much less capable python .format_map method. But really a main motivation is that package developers should be able to keep their documentation in-sync with the package code directly, by including things like the package description or release from package.xml, rather than have to constantly edit an index.rst file.
|
I've been experimenting with rosdoc2 for the last month, because I want to make sure that I do proper documentation as I convert my robot to ros2. I have a lot of suggestions, but really the most import is to use templates with user content.
Currently, rosdoc2 can create a default conf.py and index.rst, and when it does so it uses python's format_map method with some template variables. Currently user-provided conf.py and index.rst do not have the same ability to use the template variables.
As a user, there are a few reasons why I want to have the same ability to use the template variables. The two main reasons are:
In addition, if rosdoc2 is expanded to include more documentation beyond the current doxygen material, there are a lot more items that could be available in the template variables. In my demo, I've included:
In PR #28 the template was expanded to include optional Python documentation. The same issue will be faced when msg, service, and action descriptions are added, so the available template variables are going to get more extensive.
The actual templating library is not important. I am not a fan of using python's format_map because it forces me to to do changes to python code away from the template variables to escape common constructs like {}. I should not have to mess with my code outside of adding the template variables in order to use the templating system. In my demo, I used jinja. But which one to use is not important.
My current demo is at https://github.com/rkent/rosdoc2/tree/index_links The default index.rst is included as a file rather than embedded in the code as index.j2
My demo package documentation can be seen here. It's a WIP though.
If this is an acceptable direction, I can submit some pull requests to implement.
The text was updated successfully, but these errors were encountered: