| 
									
										
										
										
											2021-10-06 01:00:35 +04: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 11:46:49 +04:00
										 |  |  | from docutils.parsers.rst import Directive | 
					
						
							| 
									
										
										
										
											2021-10-06 01:00:35 +04:00
										 |  |  | from sphinx.application import Sphinx | 
					
						
							|  |  |  | from typing import Any, Dict | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-01-04 11:46:49 +04:00
										 |  |  | class FakeDBusDocDirective(Directive): | 
					
						
							| 
									
										
										
										
											2021-10-06 01:00:35 +04: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) |