ros-infrastructure / rosdoc2

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

Add markdown parsing support to `rosdoc2` #21

Closed aprotyas closed 2 years ago

aprotyas commented 2 years ago

This PR introduces markdown parsing support in two separate ways.

  1. If there are markdown files in the Sphinx project where the SphinxBuilder object is run, previously those files were treated as restructured text files. By adding the myst-parser to the list of extensions and by registering the .md source suffix to correspond to markdown files, the appropriate parser will be called for any markdown files in the Sphinx project tree. This is the less likely situation because when a default Sphinx project tree is generated, no files from the existing package repository is transferred.
  2. If a project's Doxygen configuration includes any markdown files, then exhale provides those files with a file_<>.rst and a program_listing_<>.rst page, where the latter is included as a codeblock in the former. This is not ideal - as exhale should be providing such files with :doxygenpage: directives (issue raised here). Regardless, the appropriate Pygments lexer (md) needs to be registered for markdown code blocks, which this patch addresses.

Signed-off-by: Abrar Rahman Protyasha abrar@openrobotics.org

aprotyas commented 2 years ago

@wjwwood can you merge this PR?