ros-infrastructure / rosdoc2

Command-line tool for generating documentation for ROS 2 packages.
Apache License 2.0
29 stars 9 forks source link

Copy user files into docs_build so they can be referenced in conf.py #47

Closed sloretz closed 1 year ago

sloretz commented 1 year ago

In support of https://github.com/locusrobotics/fuse/pull/278

rosdoc2 sphinx_builder copies and wraps a user's conf.py in a separate docs_build directory outside the source tree. Unfortunately this breaks relative paths to things like images and .rst files. I don't see a way to get the correct absolute path because exec(open("...").read()) is used by the wrapping conf.py to load the user's conf.py.

This PR solves it by copying the user_sourcedir content into the build directory.

An alternative solution might be to make the wrapping conf.py import the user's conf.py so that the user could make an absolute path from __file__.

@methylDragon FYI

Yadunund commented 1 year ago

This can be closed via https://github.com/ros-infrastructure/rosdoc2/pull/49

clalancette commented 1 year ago

Yeah, I'm going to close this as I think this is not needed anymore.