You can reuse comments that are inside your functions and refer to them inside your documentation. Mark a comment with @znai and use :include-cpp-comments: plugin. int my_func() { // @znai important context information goes here // this information is useful and can be re-used inside a user guide code_goes_here(); // this comment is not marked another_code(); /* @znai another piece of **documentation** in multiple lines, but it will be treated as markdown */ } Specify a file and an entry point to extract comments from. :include-cpp-comments: comments.cpp {entry: "my_func"} Result will be a text rendered as if it was typed inside markup file. See the text immediately below: