提交 8867bf08 编写于 作者: M Marc-André Lureau 提交者: Markus Armbruster

qapi: add 'If:' condition to struct members documentation

Signed-off-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20181213123724.4866-20-marcandre.lureau@redhat.com>
Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
上级 a35c9bf8
...@@ -143,10 +143,10 @@ def texi_member(member, desc, suffix): ...@@ -143,10 +143,10 @@ def texi_member(member, desc, suffix):
"""Format a table of members item for an object type member""" """Format a table of members item for an object type member"""
typ = member.type.doc_type() typ = member.type.doc_type()
membertype = ': ' + typ if typ else '' membertype = ': ' + typ if typ else ''
return '@item @code{%s%s}%s%s\n%s' % ( return '@item @code{%s%s}%s%s\n%s%s' % (
member.name, membertype, member.name, membertype,
' (optional)' if member.optional else '', ' (optional)' if member.optional else '',
suffix, desc) suffix, desc, texi_if(member.ifcond, prefix='@*'))
def texi_members(doc, what, base, variants, member_func): def texi_members(doc, what, base, variants, member_func):
......
...@@ -72,7 +72,8 @@ ...@@ -72,7 +72,8 @@
# #
# Another paragraph (but no @var: line) # Another paragraph (but no @var: line)
## ##
{ 'struct': 'Variant1', 'data': { 'var1': 'str' } } { 'struct': 'Variant1',
'data': { 'var1': { 'type': 'str', 'if': 'defined(IFSTR)' } } }
## ##
# @Variant2: # @Variant2:
......
...@@ -18,6 +18,7 @@ object Base ...@@ -18,6 +18,7 @@ object Base
member base1: Enum optional=False member base1: Enum optional=False
object Variant1 object Variant1
member var1: str optional=False member var1: str optional=False
if ['defined(IFSTR)']
object Variant2 object Variant2
object Object object Object
base Base base Base
......
...@@ -119,6 +119,7 @@ Another paragraph (but no @code{var}: line) ...@@ -119,6 +119,7 @@ Another paragraph (but no @code{var}: line)
@table @asis @table @asis
@item @code{var1: string} @item @code{var1: string}
Not documented Not documented
@*@b{If:} @code{defined(IFSTR)}
@end table @end table
@end deftp @end deftp
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册