Skip to content

Commit

Permalink
Remove enumerator specifier from generated documentation
Browse files Browse the repository at this point in the history
No reason to add a enumerator specifier to all enumerator values. It's
clear what it is from context and this makes it slightly more readable.
  • Loading branch information
laudrup committed Oct 25, 2024
1 parent 2a140d3 commit 82e94be
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion doc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ add_custom_command(OUTPUT ${SPHINX_INDEX_FILE}
${CMAKE_CURRENT_SOURCE_DIR}/templates/layout.html
${CMAKE_CURRENT_SOURCE_DIR}/templates/navbar.html
${CMAKE_CURRENT_SOURCE_DIR}/extensions/toctree_elements.py
${CMAKE_CURRENT_SOURCE_DIR}/extensions/remove_inline_specifier.py
${CMAKE_CURRENT_SOURCE_DIR}/extensions/remove_specifiers.py
${CMAKE_CURRENT_SOURCE_DIR}/logo.jpg
${SPHINX_SOURCE_FILES}
${DOXYGEN_INDEX_FILE}
Expand Down
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
extensions = ['sphinx.ext.autosectionlabel',
'breathe',
'toctree_elements',
'remove_inline_specifier',
'remove_specifiers',
'sphinx_jinja',
'sphinxcontrib.jquery',
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
specifiers = ['enumerator', 'inline']


def doctree_resolved(app, doctree, docname):
for node in doctree.traverse():
if (node.astext() == 'inline' and node.parent.tagname == 'desc_signature_line'):
if node.astext() in specifiers and node.parent.tagname == 'desc_signature_line':
node.parent.remove(node)


Expand Down

0 comments on commit 82e94be

Please sign in to comment.