vovkos / doxyrest

A compiler from Doxygen XML to reStructuredText -- hence, the name. It parses XML databases generated by Doxygen and produces reStructuredText for the Python documentation generator Sphinx.
MIT License
306 stars 23 forks source link

Syntax Type for Fenced Code Blocks Is Lost #53

Open KeithBallard opened 1 year ago

KeithBallard commented 1 year ago

In Markdown files, if a fenced code block specifies the syntax, such as:

```code_type
some fenced code...

Doxygen translates this to the XML:
```xml
<codeline><highlight class="normal">```code_type</highlight></codeline>
<codeline><highlight class="normal">some<sp/>fenced<sp/>code...</highlight></codeline>
<codeline><highlight class="normal">```</highlight></codeline>

Since Sphinx supports quite a few languages, the information is there for Doxyrest to pass along. However, Doxyrest creates the .rst file with the following block:

.. ref-code-block:: cpp

    some fenced code...

This occurs even if you specify python, shell, console, etc. Somehow, Doxyrest is assigning cpp as the syntax for all code blocks regardless of what is specified in the Markdown. What I am unsure about is how to fix it. I cannot locate the part of the code that generates this rst output. Any thoughts on where this occurs and how it might be resolved? I am happy to put in a pull request if I can get some direction.