mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 04:13:53 -06:00
qapi: Allow documentation for features
Features will be documented in a new part introduced by a "Features:" line, after arguments and before named sections. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Message-Id: <20190606153803.5278-6-armbru@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
parent
03bf06bdc1
commit
f3ed93d545
2 changed files with 51 additions and 4 deletions
|
@ -182,6 +182,17 @@ def texi_members(doc, what, base, variants, member_func):
|
|||
return '\n@b{%s:}\n@table @asis\n%s@end table\n' % (what, items)
|
||||
|
||||
|
||||
def texi_features(doc):
|
||||
"""Format the table of features"""
|
||||
items = ''
|
||||
for section in doc.features.values():
|
||||
desc = texi_format(section.text)
|
||||
items += '@item @code{%s}\n%s' % (section.name, desc)
|
||||
if not items:
|
||||
return ''
|
||||
return '\n@b{Features:}\n@table @asis\n%s@end table\n' % (items)
|
||||
|
||||
|
||||
def texi_sections(doc, ifcond):
|
||||
"""Format additional sections following arguments"""
|
||||
body = ''
|
||||
|
@ -201,6 +212,7 @@ def texi_entity(doc, what, ifcond, base=None, variants=None,
|
|||
member_func=texi_member):
|
||||
return (texi_body(doc)
|
||||
+ texi_members(doc, what, base, variants, member_func)
|
||||
+ texi_features(doc)
|
||||
+ texi_sections(doc, ifcond))
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue