diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 0b3fea6b..e4ede026 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -21,7 +21,7 @@ jobs: run: | pip install -r requirements/development.txt sudo apt-get -y update - sudo apt-get -y install graphviz libclang1-9 libclang-cpp9 + sudo apt-get -y install graphviz libclang1-11 libclang-cpp11 - name: install doxygen from SF binary archives env: diff --git a/breathe/directives/__init__.py b/breathe/directives/__init__.py index 9d9f5516..9988d610 100644 --- a/breathe/directives/__init__.py +++ b/breathe/directives/__init__.py @@ -24,7 +24,7 @@ def warn( self, raw_text: str, *, - rendered_nodes: Sequence[nodes.Node] = None, + rendered_nodes: Optional[Sequence[nodes.Node]] = None, unformatted_suffix: str = "" ) -> List[nodes.Node]: raw_text = self.format(raw_text) + unformatted_suffix diff --git a/breathe/directives/content_block.py b/breathe/directives/content_block.py index dfd6ec2e..bc3f560f 100644 --- a/breathe/directives/content_block.py +++ b/breathe/directives/content_block.py @@ -28,6 +28,7 @@ class _DoxygenContentBlockDirective(BaseDirective): "undoc-members": flag, "no-link": flag, "desc-only": flag, + "sort": flag, } has_content = False diff --git a/breathe/file_state_cache.py b/breathe/file_state_cache.py index 6d2d7193..da302606 100644 --- a/breathe/file_state_cache.py +++ b/breathe/file_state_cache.py @@ -49,7 +49,7 @@ def _get_outdated( return [] stale = [] - for filename, info in app.env.breathe_file_state.items(): # type: ignore + for filename, info in app.env.breathe_file_state.items(): old_mtime, docnames = info if _getmtime(filename) > old_mtime: stale.extend(docnames) @@ -61,14 +61,14 @@ def _purge_doc(app: Sphinx, env: BuildEnvironment, docname: str) -> None: return toremove = [] - for filename, info in app.env.breathe_file_state.items(): # type: ignore + for filename, info in app.env.breathe_file_state.items(): _, docnames = info docnames.discard(docname) if not docnames: toremove.append(filename) for filename in toremove: - del app.env.breathe_file_state[filename] # type: ignore + del app.env.breathe_file_state[filename] def setup(app: Sphinx): diff --git a/breathe/renderer/sphinxrenderer.py b/breathe/renderer/sphinxrenderer.py index 1c9d28d0..dff0c982 100644 --- a/breathe/renderer/sphinxrenderer.py +++ b/breathe/renderer/sphinxrenderer.py @@ -649,10 +649,10 @@ def handle_declaration( node, declaration: str, *, - obj_type: str = None, - content_callback: ContentCallback = None, - display_obj_type: str = None, - declarator_callback: DeclaratorCallback = None, + obj_type: Optional[str] = None, + content_callback: Optional[ContentCallback] = None, + display_obj_type: Optional[str] = None, + declarator_callback: Optional[DeclaratorCallback] = None, options={}, ) -> List[Node]: if obj_type is None: @@ -1399,7 +1399,12 @@ def visit_sectiondef(self, node) -> List[Node]: node_list.extend(self.render_optional(node.description)) # Get all the memberdef info - node_list.extend(self.render_iterable(node.memberdef)) + if "sort" in options: + member_def = sorted(node.memberdef, key=lambda x: x.name) + else: + member_def = node.memberdef + + node_list.extend(self.render_iterable(member_def)) if node_list: if "members-only" in options: