2021-10-06 00:00:35 +03:00
|
|
|
# D-Bus XML documentation extension, compatibility gunk for <sphinx4
|
|
|
|
#
|
|
|
|
# Copyright (C) 2021, Red Hat Inc.
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: LGPL-2.1-or-later
|
|
|
|
#
|
|
|
|
# Author: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
|
|
"""dbus-doc is a Sphinx extension that provides documentation from D-Bus XML."""
|
|
|
|
|
2022-01-04 10:46:49 +03:00
|
|
|
from docutils.parsers.rst import Directive
|
2021-10-06 00:00:35 +03:00
|
|
|
from sphinx.application import Sphinx
|
|
|
|
from typing import Any, Dict
|
|
|
|
|
|
|
|
|
2022-01-04 10:46:49 +03:00
|
|
|
class FakeDBusDocDirective(Directive):
|
2021-10-06 00:00:35 +03:00
|
|
|
has_content = True
|
|
|
|
required_arguments = 1
|
|
|
|
|
|
|
|
def run(self):
|
|
|
|
return []
|
|
|
|
|
|
|
|
|
|
|
|
def setup(app: Sphinx) -> Dict[str, Any]:
|
|
|
|
"""Register a fake dbus-doc directive with Sphinx"""
|
|
|
|
app.add_directive("dbus-doc", FakeDBusDocDirective)
|
2023-05-03 23:39:46 +03:00
|
|
|
|
|
|
|
return dict(
|
|
|
|
parallel_read_safe = True,
|
|
|
|
parallel_write_safe = True
|
|
|
|
)
|