question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to render Doxygen xml output into markdown instead of reST (using MyST-Parser)

See original GitHub issue

In summary, my desire: is to know is it possible to fetch Doxygen XML output and dump them in .md file using MyST-Parser?

  • Fetching of Doxygen XML output and dump them in .rst file is done by breathe.

I am preparing a project documentation using Sphinx where to fetch Doxygen XML output I have used breathe. I am using the breathe directive in .rst files.

I am using: Sphinx version : 4.2.0 Doxygen version: 1.8.17 Breathe version: 4.31.0

sample.cpp

namespace X{
class A{
   public:
       int x;
};
}

in my rst file I just added

.. doxygenclass:: X::A
   :members:
   :protected-members:
   :private-members:

After building the project I can see detailed documentation of class A. For some reason, I have the intention to use the markdown file instead of .rst. At that time I have seen myST-Parser in Sphinx Doc.

But, I was unable to catch the Doxygen XML output as like as done by breathe. I have gone through several posts but could not find any fruitful answer. The best one I have got this StackOverflow answer.

  • I have installed myst parser
  • Modified conf.py by adding extensions = ["myst_parser",]

Written a .md file as like as follows:

# sample_md
```{doxygenclass:: X::A}
:members:
:protected-members:
:private-members:
```

But failed while the error message is

WARNING: unknown directive or role name: doxygenclass::A
/net/users/Linux_Home/user_name/project_name/doc/md_files/sample_mark.md:5: WARNING: Unknown directive type "doxygenclass::A".

Also tried

# sample_md
```{doxygenclass}
A
:members:
:protected-members:
:private-members:
```

Failed too and the error message

Exception occurred:
  File "/net/users/Linux_Home/user_name/.local/lib/python3.8/site-packages/myst_parser/docutils_renderer.py", line 973, in run_directive
    if issubclass(directive_class, Include):
TypeError: issubclass() arg 1 must be a class
The full traceback has been saved in /tmp/sphinx-err-guubfd6h.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!
make[2]: *** [doc/CMakeFiles/Sphinx.dir/build.make:63: doc/sphinx/index.html] Error 2
make[1]: *** [CMakeFiles/Makefile2:215: doc/CMakeFiles/Sphinx.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

I have used following snipet in .md file

```{cpp:class} X::A
```

which has shown rendered class but only the name with a clickable link where no documentation of Doxygen XML is present. And I need that info.

No idea what to do at this stage.

Some of my observance:

  • myST is only for collecting Sphinx directive in markdown file
  • breathe is a tool to fetch Doxygen XML output and to write in reST style using Sphinx

Now my desire is to know, is it possible to add Doxygen XML output in the .md file? If Yes, where am I am making the syntax wrong?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
chrisjsewellcommented, Dec 10, 2021

Heya, so firstly to note the syntax should look like:

```{doxygenclass} X::A
:members:
:protected-members:
:private-members:
```

But I think there may still be some issues with using breathe directly, which does some “non-standard” things: #322, #323

As mentioned in thos issues though, I think the workaround is to use the eval-rst directive:

```{eval-rst}
.. doxygenclass:: X::A
   :members:
   :protected-members:
   :private-members:
```
0reactions
jakobandersencommented, Jan 22, 2022

Note, the Breathe issue (https://github.com/executablebooks/MyST-Parser/issues/460#issuecomment-990992776) should be fixed in the next Breathe release.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to render Doxygen xml output into markdown instead of ...
I am preparing a project documentation using Sphinx where to fetch Doxygen XML output I have used breathe. I am using the breathe...
Read more >
[Solved]-How to render Doxygen xml output into markdown ...
Coding example for the question How to render Doxygen xml output into markdown instead of reST (using breathe or MyST-Parser)-C++.
Read more >
Translate non-default directives (breathe extension) · Issue #323
I cannot combine MyST with other non-default Sphinx extensions, ... How to render Doxygen xml output into markdown instead of reST (using ......
Read more >
Customizing the output - Doxygen Manual
The section XML output show how to generate whatever output you want based on the XML output produced by doxygen. Minor Tweaks. The...
Read more >
FAQ - MyST-Parser - Read the Docs
Hallo I'm from an rST file, with a reference. Include Markdown files into an rST file#. To include a MyST file within a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found