Skip to content
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

Generate documentation for workspace? #381

Closed
mikepurvis opened this issue Jun 5, 2016 · 4 comments
Closed

Generate documentation for workspace? #381

mikepurvis opened this issue Jun 5, 2016 · 4 comments

Comments

@mikepurvis
Copy link
Member

mikepurvis commented Jun 5, 2016

I would like to be able to run rosdoc_lite across a workspace, generating docs for each package into a "doc space". I want the packages to be built in dependency order, supplying each one with a yaml pointing to the tags files of everything it depends on.

It seems fairly clear that this shouldn't be first class functionality of catkin_tools, but I feel like there are a bunch of pieces of c_t that I could possibly take advantage of in building it (dependency resolution, build order, parallel execution engine, etc).

So my question is: how realistic would it be to make a plugin build_docs verb which calls a bunch of the same execute_jobs logic, but feeds it a separate Job/Stage configuration which builds docs rather than binaries? I think for sanity, there'd have to be a base expectation that the environment from which catkin build_docs is called is a result space already containing catkin, genmsg, and rosdoc_lite. So the docs verb is only concerned with building docs, not also building the dependencies required to build docs.

Anyway, thoughts?

@mikepurvis
Copy link
Member Author

Related: ros-infrastructure/rosdoc_lite#66

@mikepurvis
Copy link
Member Author

This is a super-naive bash implementation of what I want to do more efficiently and fault-tolerantly using catkin_tools:

#!/bin/bash

mkdir -p docs
echo "" > docs/tags.yaml

for PKG_PATH in $(catkin_topological_order --only-folders src); do
  PKG=$(basename ${PKG_PATH})
  rosdoc_lite -t docs/tags.yaml -g docs/${PKG}/${PKG}.tag -o docs/${PKG} src/${PKG_PATH}
  echo "- docs_url: file://$(pwd)/docs/${PKG}/html" >> docs/tags.yaml
  echo "  location: file://$(pwd)/docs/${PKG}/${PKG}.tag" >> docs/tags.yaml
done

@mikepurvis
Copy link
Member Author

For interested parties, there's a beginning implementation of this here, built as a catkin_tools plugin: https://github.com/mikepurvis/catkin_tools_document

It's dependent on the change in #391, and still pretty rough around the edges, but will get a more formal release/announcement when those issues are resolved. I ended up not bothering with rosdoc_lite at all; it was easier to just pull in the pieces I needed rather than try to create a dependency. The basic idea is:

rosinstall_generator ros_base --tar --deps --flat > ros_base.rosinstall
rosinstall src ros_base.rosinstall -j8
catkin build
source devel/setup.bash
catkin document
# docs are now organized by package in a "docs space"

@mikepurvis
Copy link
Member Author

Going to close this as done. There are now examples and packages on PyPI and launchpad. I don't think there's any reason to want this as part of catkin_tools proper— it's perfectly logical as an external plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant