gz-cmake icon indicating copy to clipboard operation
gz-cmake copied to clipboard

The doxygen configuration should include more file types that can be used by the `\snippet` command

Open azeey opened this issue 2 years ago • 1 comments

Desired behavior

The EXAMPLE_PATTERN (https://github.com/gazebosim/gz-cmake/blob/200de1b26edbad9ad1d7efd7c29dd4f2080edefa/doc/doxygen/api.in#L904) in the doxygen configuration is limited to C++ and CMake files. It would be great if other types (eg. .proto, .py, .rb, .sdf, CMakeList.txt) were supported. This would allow us to use the \include or \snippet commands in our documentation instead of duplicating code from examples.

azeey avatar Sep 27 '23 22:09 azeey

Is there something non-trivial to be done for this to work?

I tried adding *.sdf to EXAMPLE_PATTERNS and referenced a file with:

    <!-- [render_engine_def] -->
    <plugin
      filename="gz-sim-sensors-system"
      name="gz::sim::systems::Sensors">
      <render_engine>ogre2</render_engine>
    </plugin>
    <!-- [render_engine_def] -->

But the snippet generated in docs is empty.

peci1 avatar Mar 26 '25 12:03 peci1