Shorten the title for D-Bus interface docs

The title of an interface can be arbitrarily long, considering that
reverse DNS namespaces can be pretty complex. Instead of using the whole
interface name, we can use the name without the prefix.
This commit is contained in:
Emmanuele Bassi 2023-12-29 00:50:57 +00:00
parent eddd04add1
commit 2b2b04d188
2 changed files with 4 additions and 3 deletions

View File

@ -88,7 +88,7 @@ class MdCodeGenerator:
f"Title: {iface.name} D-Bus Interface",
f"Slug: {iface.name}",
"",
"# " + iface.name,
"# " + iface.name_without_prefix,
"",
"## Description",
"",

View File

@ -82,12 +82,13 @@ class RstCodeGenerator:
def _generate_header(self, iface):
"""Generates the header and preamble of the document."""
header_len = len(iface.name)
iface_name = iface.name_without_prefix
header_len = len(iface_name)
res = [
f".. _{iface.name}:",
"",
"=" * header_len,
iface.name,
iface_name,
"=" * header_len,
"",
"-----------",