diff --git a/breathe/process.py b/breathe/process.py index e26553ff..dd2a7cdd 100644 --- a/breathe/process.py +++ b/breathe/process.py @@ -26,6 +26,7 @@ GENERATE_XML = YES ALIASES = "rst=\verbatim embed:rst" ALIASES += "endrst=\endverbatim" +ALIASES += "inlinerst=\verbatim embed:rst:inline" {extra} """.strip() diff --git a/documentation/source/markups.rst b/documentation/source/markups.rst index a76c7a6d..ff1c7532 100644 --- a/documentation/source/markups.rst +++ b/documentation/source/markups.rst @@ -127,6 +127,38 @@ This will appropriately handle the leading slashes and render as: ---- +Inline rST +~~~~~~~~~~ + +.. cpp:namespace:: @ex_markups_inline + +Normal verbatim elements result in block elements. But sometimes you'll want +to generate rST references where they need to be rendered inline with the text. +For example:: + + /// Some kind of method + /// + /// @param something a parameter + /// @returns the same value provided in something param + /// + /// @verbatim embed:rst:inline some inline text @endverbatim + +For these kinds of references, you can use an **embed:rst:inline** tag as +shown in the above example. + +This will appropriately handle the leading slashes and render as: + +---- + +.. doxygenfunction:: TestClass::rawInlineVerbatim + :project: rst + +.. doxygenfunction:: TestClass::rawVerbatim + :project: rst + :outline: + +---- + Aliases ~~~~~~~ diff --git a/examples/specific/rst.cfg b/examples/specific/rst.cfg index 296f3755..73b85299 100644 --- a/examples/specific/rst.cfg +++ b/examples/specific/rst.cfg @@ -12,3 +12,4 @@ GENERATE_XML = YES ALIASES = "rst=\verbatim embed:rst" ALIASES += "endrst=\endverbatim" +ALIASES += "inlinerst=\verbatim embed:rst:inline" diff --git a/examples/specific/rst.h b/examples/specific/rst.h index dd83d229..7c9a54b1 100644 --- a/examples/specific/rst.h +++ b/examples/specific/rst.h @@ -12,7 +12,7 @@ class TestClass This is some funky non-XML compliant text: <& !>< .. note:: - + This reStructuredText has been handled correctly. \endrst @@ -67,6 +67,12 @@ class TestClass ////////////////////////////////////////////////////////////// virtual void rawLeadingSlashesVerbatim(int something) const = 0; + /*! + Inserting an inline reStructuredText snippet. + Linking to another function: \inlinerst :cpp:func:`TestClass::rawVerbatim` \endrst + */ + virtual void rawInlineVerbatim() const = 0; + //! Brief description virtual void testFunction() const {}; };