diff --git a/doc/api.md b/doc/api.md index 891466a0..7292e181 100644 --- a/doc/api.md +++ b/doc/api.md @@ -1,4 +1,4 @@ -# API Reference {#string-formatting-api} +# API Reference The {fmt} library API consists of the following parts: @@ -55,12 +55,8 @@ specified otherwise. ::: print(format_string, T&&...) -::: vprint(string_view, format_args) - ::: print(FILE*, format_string, T&&...) -::: vprint(FILE*, string_view, format_args) - ::: println(format_string, T&&...) ::: println(FILE*, format_string, T&&...) @@ -90,7 +86,8 @@ fmt::format_string ::: runtime(string_view) -### Formatting User-Defined Types {#udt} + +### Formatting User-Defined Types The {fmt} library provides formatters for many standard C++ types. See [`fmt/ranges.h`](#ranges-api) for ranges and tuples including standard diff --git a/support/mkdocstrings_handlers/cxx/__init__.py b/support/mkdocstrings_handlers/cxx/__init__.py index d05f3f4e..5cc12f16 100644 --- a/support/mkdocstrings_handlers/cxx/__init__.py +++ b/support/mkdocstrings_handlers/cxx/__init__.py @@ -46,11 +46,11 @@ def doxyxml2html(nodes: list[et.Element]): return out def get_template_params(node: et.Element) -> Optional[list[Definition]]: - param_nodes = node.findall('templateparamlist/param') - if param_nodes is None: + templateparamlist = node.find('templateparamlist') + if templateparamlist is None: return None params = [] - for param_node in param_nodes: + for param_node in templateparamlist.findall('param'): name = param_node.find('declname') param = Definition(name.text if name is not None else '') param.type = param_node.find('type').text @@ -161,10 +161,12 @@ class CxxHandler(BaseHandler): return d def render(self, d: Definition, config: dict) -> str: - text = '
'
+    text = '
\n' + text += '
'
     if d.template_params is not None:
       text += 'template <'
-      text += ', '.join([f'{p.type} {p.name}' for p in d.template_params])
+      text += ', '.join(
+        [f'{p.type} {p.name}'.rstrip() for p in d.template_params])
       text += '>\n'
     text += d.type + ' ' + d.name
     if d.params is not None:
@@ -173,10 +175,11 @@ class CxxHandler(BaseHandler):
       text += '(' + params + ')'
     text += ';'
     text += '
\n' - text += '
\n' + text += '
\n' desc = doxyxml2html(d.desc) text += desc text += '
\n' + text += '
\n' return text def get_handler(theme: str, custom_templates: Optional[str] = None,