summaryrefslogtreecommitdiff
path: root/giscanner/girwriter.py
diff options
context:
space:
mode:
authorMathieu Duponchelle <mathieu@centricular.com>2020-06-06 02:13:38 +0200
committerMathieu Duponchelle <mathieu@centricular.com>2020-07-12 04:10:40 +0200
commitb8c92fddbfbadc910ef0c0c6c65bd5648b8e86ca (patch)
tree24fb56f6eed5696ef96473d2debce108b422fb5f /giscanner/girwriter.py
parente7c17469ef3eb1c3a1c4c717800c277ee231405c (diff)
downloadgobject-introspection-b8c92fddbfbadc910ef0c0c6c65bd5648b8e86ca.tar.gz
Add the notion of standalone doc sections.
Up to now, section annotations had to match a class or interface name in order to be serialized in the gir. With this commit, they now get serialized as docsection nodes, for potential use by documentation tools.
Diffstat (limited to 'giscanner/girwriter.py')
-rw-r--r--giscanner/girwriter.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/giscanner/girwriter.py b/giscanner/girwriter.py
index d1333cb7..05f4434e 100644
--- a/giscanner/girwriter.py
+++ b/giscanner/girwriter.py
@@ -113,6 +113,8 @@ class GIRWriter(XMLWriter):
self._write_alias(node)
elif isinstance(node, ast.Constant):
self._write_constant(node)
+ elif isinstance(node, ast.DocSection):
+ self._write_doc_section(node)
else:
print('WRITER: Unhandled node', node)
@@ -442,6 +444,11 @@ class GIRWriter(XMLWriter):
with self.tagcontext('member', attrs):
self._write_generic(member)
+ def _write_doc_section(self, doc_section):
+ attrs = [('name', doc_section.name)]
+ with self.tagcontext('docsection', attrs):
+ self._write_generic(doc_section)
+
def _write_constant(self, constant):
attrs = [('name', constant.name),
('value', constant.value),