xref: /openbmc/qemu/docs/sphinx/fakedbusdoc.py (revision e068b57d)
1# D-Bus XML documentation extension, compatibility gunk for <sphinx4
2#
3# Copyright (C) 2021, Red Hat Inc.
4#
5# SPDX-License-Identifier: LGPL-2.1-or-later
6#
7# Author: Marc-André Lureau <marcandre.lureau@redhat.com>
8"""dbus-doc is a Sphinx extension that provides documentation from D-Bus XML."""
9
10from sphinx.application import Sphinx
11from sphinx.util.docutils import SphinxDirective
12from typing import Any, Dict
13
14
15class FakeDBusDocDirective(SphinxDirective):
16    has_content = True
17    required_arguments = 1
18
19    def run(self):
20        return []
21
22
23def setup(app: Sphinx) -> Dict[str, Any]:
24    """Register a fake dbus-doc directive with Sphinx"""
25    app.add_directive("dbus-doc", FakeDBusDocDirective)
26