From 709169a4d8dbf60a1109f9b654cf75b57efdfd97 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Sat, 15 Jun 2024 08:55:22 -0700 Subject: [PATCH] Set the anchors --- support/python/mkdocstrings_handlers/cxx/__init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/support/python/mkdocstrings_handlers/cxx/__init__.py b/support/python/mkdocstrings_handlers/cxx/__init__.py index d0432100..1aac39ec 100644 --- a/support/python/mkdocstrings_handlers/cxx/__init__.py +++ b/support/python/mkdocstrings_handlers/cxx/__init__.py @@ -3,10 +3,11 @@ import os from pathlib import Path -import xml.etree.ElementTree as et -from mkdocstrings.handlers.base import BaseHandler from typing import Any, List, Mapping, Optional from subprocess import CalledProcessError, PIPE, Popen, STDOUT +import xml.etree.ElementTree as et + +from mkdocstrings.handlers.base import BaseHandler class Definition: '''A definition extracted by Doxygen.''' @@ -288,6 +289,8 @@ class CxxHandler(BaseHandler): return self.collect_compound(identifier, cls) def render(self, d: Definition, config: dict) -> str: + if d.id is not None: + self.do_heading('', 0, id=d.id) text = '
\n' text += render_decl(d) text += '
\n'