doxyrest icon indicating copy to clipboard operation
doxyrest copied to clipboard

Extra unwanted `.. ref-code-block:: c`

Open yanis-fourel opened this issue 2 years ago • 0 comments

Extra .. ref-code-block:: c appear in front of my code block whenever I use doxygen's \include instead of \verbinclude

See this xml snippet (manually beautified):

<para><verbatim> 
 .. raw:: html   
   &lt;div class=&quot;codeSample Ada&quot; id=&quot;hello_world-adb&quot;&gt;
</verbatim></para>
<para>
    .. ref-code-block:: ada
    <programlisting filename="hello_world.adb">
        <codeline>
            <highlight class="normal"> 
                --<sp/>Simple<sp/>Program<sp/>&quot;Hello<sp/>World&quot;
            </highlight>
        </codeline>
    <codeline>
        <highlight class="normal">
            with<sp/>MyLib;
        </highlight>
    </codeline>

This gets translated to the following rst

.. raw:: html 
    
         <div class="codeSample Ada" id="hello_world-adb">
      
.. ref-code-block:: ada
      
.. ref-code-block:: c
      
      	-- Simple Program "Hello World"
        with MyLib;

Notice that extra unwanted .. ref-code-block:: c This results in a first empty Ada code block, then a C code block with an Ada snippet, which messes up the syntax highlight:

image

If I swap out my \include by an \verbinclude, it works just fine but I need to use \skip and \until to include only part of the file, which is not possible with \verbinclude. I want to do something similar to this example of \dontinclude from doxygen's doc

yanis-fourel avatar Dec 13 '21 15:12 yanis-fourel