Skip to contentSkip to conversation

qapi: Documentation improvements

PATCH In review Markus Armbruster 4 participants 7 messages Oct 26, 2021

lore
Share & tools
lore
#0 lore raw

cover qapi: Documentation improvements

Markus Armbruster (2):
docs/devel/qapi-code-gen: Drop a duplicate paragraph docs/devel/qapi-code-gen: Belatedly document feature documentation

 docs/devel/qapi-code-gen.rst | 29 +++++++++++++++--------------
 1 file changed, 15 insertions(+), 14 deletions(-)
Signature · 1 line
2.31.1
#1 lore raw

PATCH 1/2 docs/devel/qapi-code-gen: Drop a duplicate paragraph

Commit 55ec69f8b1 "docs/devel/qapi-code-gen.txt: Update to new rST backend conventions" accidentally duplicated a paragraph. Drop it.

---
 docs/devel/qapi-code-gen.rst | 6 ------
 1 file changed, 6 deletions(-)
docs/devel/qapi-code-gen.rst +0 -6
index b2569de486..1f6805a705 100644
@@ -993,12 +993,6 @@ multiline argument descriptions.
 A 'Since: x.y.z' tagged section lists the release that introduced the
 definition.
 
-The text of a section can start on a new line, in
-which case it must not be indented at all.  It can also start
-on the same line as the 'Note:', 'Returns:', etc tag.  In this
-case if it spans multiple lines then second and subsequent
-lines must be indented to match the first.
-
 An 'Example' or 'Examples' section is automatically rendered
 entirely as literal fixed-width text.  In other sections,
 the text is formatted, and rST markup can be used.
Signature · 1 line
2.31.1
Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] docs/devel/qapi-code-gen: Drop a duplicate paragraph

Quoted 8 lines · Markus Armbruster

Commit 55ec69f8b1 "docs/devel/qapi-code-gen.txt: Update to new rST backend conventions" accidentally duplicated a paragraph. Drop it.

---
 docs/devel/qapi-code-gen.rst | 6 ------
 1 file changed, 6 deletions(-)
Reviewed-by on v1 1/2
#3 lore raw

Re: [PATCH 1/2] docs/devel/qapi-code-gen: Drop a duplicate paragraph

In reply to Markus Armbruster
Quoted 4 lines · Markus Armbruster

Commit 55ec69f8b1 "docs/devel/qapi-code-gen.txt: Update to new rST backend conventions" accidentally duplicated a paragraph. Drop it.

Fixes 55ec69f8b1

.... well, on second thought, that backport would have to go backwards through a ReST conversion, so ... maybe not. Nevermind.

Quoted 3 lines
Quoted 25 lines
---
 docs/devel/qapi-code-gen.rst | 6 ------
 1 file changed, 6 deletions(-)
docs/devel/qapi-code-gen.rst +0 -7
index b2569de486..1f6805a705 100644
@@ -993,12 +993,6 @@ multiline argument descriptions.
 A 'Since: x.y.z' tagged section lists the release that introduced the
 definition.
 
-The text of a section can start on a new line, in
-which case it must not be indented at all.  It can also start
-on the same line as the 'Note:', 'Returns:', etc tag.  In this
-case if it spans multiple lines then second and subsequent
-lines must be indented to match the first.
-
 An 'Example' or 'Examples' section is automatically rendered
 entirely as literal fixed-width text.  In other sections,
 the text is formatted, and rST markup can be used.
--

2.31.1

#4 lore raw

PATCH 2/2 docs/devel/qapi-code-gen: Belatedly document feature documentation

In reply to Markus Armbruster

Commit 6a8c0b5102 "qapi: Add feature flags to struct types" neglected to document how to document feature flags. Make up for that.

---
 docs/devel/qapi-code-gen.rst | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)
docs/devel/qapi-code-gen.rst +15 -8
index 1f6805a705..4b79623f51 100644
@@ -949,15 +949,16 @@ definition must have documentation.
 Definition documentation starts with a line naming the definition,
 followed by an optional overview, a description of each argument (for
 commands and events), member (for structs and unions), branch (for
-alternates), or value (for enums), and finally optional tagged
-sections.
+alternates), or value (for enums), a description of each feature (if
+any), and finally optional tagged sections.
 
-Descriptions of arguments can span multiple lines.  The description
-text can start on the line following the '\@argname:', in which case it
-must not be indented at all.  It can also start on the same line as
-the '\@argname:'.  In this case if it spans multiple lines then second
-and subsequent lines must be indented to line up with the first
-character of the first line of the description::
+The description of an argument or feature 'name' starts with
+'\@name:'.  The description text can start on the line following the
+'\@argname:', in which case it must not be indented at all.  It can
+also start on the same line as the '\@argname:'.  In this case if it
+spans multiple lines then second and subsequent lines must be indented
+to line up with the first character of the first line of the
+description::
 
  # @argone:
  # This is a two line description
@@ -979,6 +980,12 @@ The number of spaces between the ':' and the text is not significant.
 Extensions added after the definition was first released carry a
 '(since x.y.z)' comment.
 
+The feature descriptions must be preceded by a line "Features:", like
+this::
+
+  # Features:
+  # @feature: Description text
+
 A tagged section starts with one of the following words:
 "Note:"/"Notes:", "Since:", "Example"/"Examples", "Returns:", "TODO:".
 The section ends with the start of a new section.
Signature · 1 line
2.31.1
#5 lore raw

Re: [PATCH 2/2] docs/devel/qapi-code-gen: Belatedly document feature documentation

Am 26.10.2021 um 13:10 hat Markus Armbruster geschrieben:

Quoted 25 lines

Commit 6a8c0b5102 "qapi: Add feature flags to struct types" neglected to document how to document feature flags. Make up for that.

---
 docs/devel/qapi-code-gen.rst | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)
docs/devel/qapi-code-gen.rst +2 -5
index 1f6805a705..4b79623f51 100644
@@ -949,15 +949,16 @@ definition must have documentation.
 Definition documentation starts with a line naming the definition,
 followed by an optional overview, a description of each argument (for
 commands and events), member (for structs and unions), branch (for
-alternates), or value (for enums), and finally optional tagged
-sections.
+alternates), or value (for enums), a description of each feature (if
+any), and finally optional tagged sections.
 
-Descriptions of arguments can span multiple lines.  The description
-text can start on the line following the '\@argname:', in which case it
-must not be indented at all.  It can also start on the same line as

docs/devel/qapi-code-gen.rst definition must have documentation. · line 961

Quoted 10 lines
docs/devel/qapi-code-gen.rst +7 -3
-the '\@argname:'.  In this case if it spans multiple lines then second
-and subsequent lines must be indented to line up with the first
-character of the first line of the description::
+The description of an argument or feature 'name' starts with
+'\@name:'.  The description text can start on the line following the
+'\@argname:', in which case it must not be indented at all.  It can
+also start on the same line as the '\@argname:'.  In this case if it
+spans multiple lines then second and subsequent lines must be indented
+to line up with the first character of the first line of the
+description::

I'm confused. Are @name and @argname really two different things? What does each one mean?

Kevin

#6 lore raw

Re: [PATCH 2/2] docs/devel/qapi-code-gen: Belatedly document feature documentation

Quoted 23 lines · Kevin Wolf

Am 26.10.2021 um 13:10 hat Markus Armbruster geschrieben:

Quoted 22 lines

Commit 6a8c0b5102 "qapi: Add feature flags to struct types" neglected to document how to document feature flags. Make up for that.

---
 docs/devel/qapi-code-gen.rst | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)
docs/devel/qapi-code-gen.rst +2 -2
index 1f6805a705..4b79623f51 100644
@@ -949,15 +949,16 @@ definition must have documentation.
 Definition documentation starts with a line naming the definition,
 followed by an optional overview, a description of each argument (for
 commands and events), member (for structs and unions), branch (for
-alternates), or value (for enums), and finally optional tagged
-sections.
+alternates), or value (for enums), a description of each feature (if
+any), and finally optional tagged sections.
 
Quoted 16 lines

docs/devel/qapi-code-gen.rst definition must have documentation. · line 961

Quoted 13 lines
docs/devel/qapi-code-gen.rst +7 -6
-Descriptions of arguments can span multiple lines.  The description
-text can start on the line following the '\@argname:', in which case it
-must not be indented at all.  It can also start on the same line as
-the '\@argname:'.  In this case if it spans multiple lines then second
-and subsequent lines must be indented to line up with the first
-character of the first line of the description::
+The description of an argument or feature 'name' starts with
+'\@name:'.  The description text can start on the line following the
+'\@argname:', in which case it must not be indented at all.  It can
+also start on the same line as the '\@argname:'.  In this case if it
+spans multiple lines then second and subsequent lines must be indented
+to line up with the first character of the first line of the
+description::

I'm confused. Are @name and @argname really two different things? What does each one mean?

Editing screwup! I meant to use @name every time.