mosra / m.css

A no-nonsense, no-JavaScript CSS framework, site and documentation theme for content-oriented websites
https://mcss.mosra.cz
Other
406 stars 92 forks source link

file inclusion question #188

Closed fnrizzi closed 2 years ago

fnrizzi commented 3 years ago

Hi! I am using the m.css and I have the following issue: i have a mardown document that I compile with the ./doxygen and I would like to include in my markdown file some code from a .cpp file. I could copy and past the code, but that is redundant and I have to redo it everytime the cpp file changes.

I was wondering if the file inclusion explained here: https://mcss.mosra.cz/plugins/math-and-code/#advanced-file-inclusion is also available for doxygen/markdown? If not, is there a way i can mix rst code and markdown to obtain that capability?

Or do you have any other suggestion to solver my problem? Thanks!

mosra commented 2 years ago

(Sorry for embarrassingly late replies, finally got a chance to get back to this project.)

This is achievable using vanilla Doxygen functionality -- please see the @snippet, @include, @skip, @until and @skipline builtin commands. Especially the @snippet command is very powerful, allowing you to include exact delimited pieces of code, while still keeping the code itself compilable.

For an overwhelming exhaustive usage example, here's what I do in Magnum: