fakedbusdoc.py 786 B

123456789101112131415161718192021222324252627282930
  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. from docutils.parsers.rst import Directive
  10. from sphinx.application import Sphinx
  11. from typing import Any, Dict
  12. class FakeDBusDocDirective(Directive):
  13. has_content = True
  14. required_arguments = 1
  15. def run(self):
  16. return []
  17. def setup(app: Sphinx) -> Dict[str, Any]:
  18. """Register a fake dbus-doc directive with Sphinx"""
  19. app.add_directive("dbus-doc", FakeDBusDocDirective)
  20. return dict(
  21. parallel_read_safe = True,
  22. parallel_write_safe = True
  23. )