Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to hide in which headers the struct is defined #725

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions breathe/directives/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ def setup(app: Sphinx) -> None:
app.add_config_value("breathe_default_members", (), True)
app.add_config_value("breathe_show_define_initializer", False, 'env')
app.add_config_value("breathe_show_enumvalue_initializer", False, 'env')
app.add_config_value("breathe_show_include", True, 'env')
app.add_config_value("breathe_implementation_filename_extensions", ['.c', '.cc', '.cpp'], True)
app.add_config_value("breathe_doxygen_config_options", {}, True)
app.add_config_value("breathe_use_project_refids", False, "env")
Expand Down
3 changes: 3 additions & 0 deletions breathe/renderer/sphinxrenderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1655,6 +1655,9 @@ def visit_verbatim(self, node) -> List[Node]:
return [rst_node]

def visit_inc(self, node) -> List[Node]:
if not self.app.config.breathe_show_include:
return []

if node.local == u"yes":
text = '#include "%s"' % node.content_[0].getValue()
else:
Expand Down
17 changes: 17 additions & 0 deletions documentation/source/directives.rst
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,23 @@ Config Values
For example an enum value ``TWO = 2`` would be shown with the value 2 if this is set to ``True``,
and without if it is set to ``False``.

.. confval:: breathe_show_include

A boolean flag which can be set to ``False`` to hide the header in which each
entity (struct, function, macro, etc.) is defined.

For example, when set to ``True`` (the default) a ``struct Foo`` is rendered
similarly to::

struct Foo
#include <foo.hpp>
Description of Foo.

but when set to ``False`` it is instead rendered as::

struct Foo
Description of Foo.

.. confval:: breathe_use_project_refids

True or False setting to control if the refids generated by breathe for doxygen
Expand Down