I am trying to extract a specific code snippet (a test) from my sources to output it in the documentation.
TEST_CASE("std::vector") {
//! [MyTest]
std::vector<int> v = {42,43};
CHECK( v.size() == 2 );
//! [MyTest]
}
In doxygen, I can refer to it via a \snippet
command.
Now, I would like to display the code inside the snippet directly into the sphinx documentation
You can create a std::vector just like this:
INSERT THE CODE BETWEEN [MyTest] MARKERS HERE
The std::vector class automatically allocates memory for you
How do I do that? I did not find any doxygensnippet
directive in Breathe.
Note: I don't mind sphinx extracting the code for me directly with any kind of tag, I don't need to be doxygen-compliant.