mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-09-06 09:55:55 +00:00
qapi2texi: Generate reference to base type members
The generated documentation doesn't mention object type members inherited from a base type. Fix that. Example change (qemu-qmp-ref.txt): -- Struct: VncServerInfo The network connection information for server Members: 'auth' (optional) authentication method used for the plain (non-websocket) VNC server + The members of 'VncBasicInfo' Since: 2.1 Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <1489582656-31133-27-git-send-email-armbru@redhat.com>
This commit is contained in:
parent
691e03133e
commit
88f63467c5
|
@ -143,7 +143,7 @@ def texi_member(member):
|
||||||
' (optional)' if member.optional else '')
|
' (optional)' if member.optional else '')
|
||||||
|
|
||||||
|
|
||||||
def texi_members(doc, what, member_func):
|
def texi_members(doc, what, base, member_func):
|
||||||
"""Format the table of members"""
|
"""Format the table of members"""
|
||||||
items = ''
|
items = ''
|
||||||
for section in doc.args.itervalues():
|
for section in doc.args.itervalues():
|
||||||
|
@ -152,6 +152,8 @@ def texi_members(doc, what, member_func):
|
||||||
else:
|
else:
|
||||||
desc = 'Not documented'
|
desc = 'Not documented'
|
||||||
items += member_func(section.member) + texi_format(desc) + '\n'
|
items += member_func(section.member) + texi_format(desc) + '\n'
|
||||||
|
if base:
|
||||||
|
items += '@item The members of @code{%s}\n' % base.doc_type()
|
||||||
if not items:
|
if not items:
|
||||||
return ''
|
return ''
|
||||||
return '\n@b{%s:}\n@table @asis\n%s@end table\n' % (what, items)
|
return '\n@b{%s:}\n@table @asis\n%s@end table\n' % (what, items)
|
||||||
|
@ -174,9 +176,9 @@ def texi_sections(doc):
|
||||||
return body
|
return body
|
||||||
|
|
||||||
|
|
||||||
def texi_entity(doc, what, member_func=texi_member):
|
def texi_entity(doc, what, base=None, member_func=texi_member):
|
||||||
return (texi_body(doc)
|
return (texi_body(doc)
|
||||||
+ texi_members(doc, what, member_func)
|
+ texi_members(doc, what, base, member_func)
|
||||||
+ texi_sections(doc))
|
+ texi_sections(doc))
|
||||||
|
|
||||||
|
|
||||||
|
@ -205,11 +207,13 @@ def visit_object_type(self, name, info, base, members, variants):
|
||||||
typ = 'Flat Union'
|
typ = 'Flat Union'
|
||||||
else:
|
else:
|
||||||
typ = 'Simple Union'
|
typ = 'Simple Union'
|
||||||
|
if base and base.is_implicit():
|
||||||
|
base = None
|
||||||
if self.out:
|
if self.out:
|
||||||
self.out += '\n'
|
self.out += '\n'
|
||||||
self.out += TYPE_FMT(type=typ,
|
self.out += TYPE_FMT(type=typ,
|
||||||
name=doc.symbol,
|
name=doc.symbol,
|
||||||
body=texi_entity(doc, 'Members'))
|
body=texi_entity(doc, 'Members', base))
|
||||||
|
|
||||||
def visit_alternate_type(self, name, info, variants):
|
def visit_alternate_type(self, name, info, variants):
|
||||||
doc = self.cur_doc
|
doc = self.cur_doc
|
||||||
|
|
Loading…
Reference in a new issue