[PATCH 03/23] docs/qapidoc: remove example section support

John Snow posted 23 patches 4 months, 3 weeks ago
There is a newer version of this series
[PATCH 03/23] docs/qapidoc: remove example section support
Posted by John Snow 4 months, 3 weeks ago
Since 3c5f6114 we no longer actually generate Example sections, so this
support in qapidoc is now dead code.

Signed-off-by: John Snow <jsnow@redhat.com>
---
 docs/sphinx/qapidoc.py | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/docs/sphinx/qapidoc.py b/docs/sphinx/qapidoc.py
index 5a4d7388b29..61997fd21af 100644
--- a/docs/sphinx/qapidoc.py
+++ b/docs/sphinx/qapidoc.py
@@ -254,10 +254,6 @@ def _nodes_for_features(self, doc):
         section += dlnode
         return [section]
 
-    def _nodes_for_example(self, exampletext):
-        """Return list of doctree nodes for a code example snippet"""
-        return [nodes.literal_block(exampletext, exampletext)]
-
     def _nodes_for_sections(self, doc):
         """Return list of doctree nodes for additional sections"""
         nodelist = []
@@ -275,10 +271,7 @@ def _nodes_for_sections(self, doc):
                 continue
 
             snode = self._make_section(section.tag)
-            if section.tag.startswith('Example'):
-                snode += self._nodes_for_example(dedent(section.text))
-            else:
-                self._parse_text_into_node(dedent(section.text), snode)
+            self._parse_text_into_node(dedent(section.text), snode)
             nodelist.append(snode)
         return nodelist
 
-- 
2.47.0
Re: [PATCH 03/23] docs/qapidoc: remove example section support
Posted by Markus Armbruster 4 months, 3 weeks ago
John Snow <jsnow@redhat.com> writes:

> Since 3c5f6114 we no longer actually generate Example sections, so this

Suggest s/generate/support/

> support in qapidoc is now dead code.

Oversight, I guess.

>
> Signed-off-by: John Snow <jsnow@redhat.com>

Reviewed-by: Markus Armbruster <armbru@redhat.com>
Re: [PATCH 03/23] docs/qapidoc: remove example section support
Posted by John Snow 4 months, 3 weeks ago
On Wed, Dec 18, 2024, 7:27 AM Markus Armbruster <armbru@redhat.com> wrote:

> John Snow <jsnow@redhat.com> writes:
>
> > Since 3c5f6114 we no longer actually generate Example sections, so this
>
> Suggest s/generate/support/
>

I meant to say: because the parser doesn't support them, it no longer
creates such section objects, so there's no need to handle them.


> > support in qapidoc is now dead code.
>
> Oversight, I guess.
>

O:-)


> >
> > Signed-off-by: John Snow <jsnow@redhat.com>
>
> Reviewed-by: Markus Armbruster <armbru@redhat.com>
>
>
Re: [PATCH 03/23] docs/qapidoc: remove example section support
Posted by Markus Armbruster 4 months ago
John Snow <jsnow@redhat.com> writes:

> On Wed, Dec 18, 2024, 7:27 AM Markus Armbruster <armbru@redhat.com> wrote:
>
>> John Snow <jsnow@redhat.com> writes:
>>
>> > Since 3c5f6114 we no longer actually generate Example sections, so this
>>
>> Suggest s/generate/support/
>>
>
> I meant to say: because the parser doesn't support them, it no longer
> creates such section objects, so there's no need to handle them.

"Since commit 3c5f6114d9f (qapi: remove "Example" doc section), Example
sections no longer exist, so ..."?

>> > support in qapidoc is now dead code.
>>
>> Oversight, I guess.
>>
>
> O:-)
>
>
>> >
>> > Signed-off-by: John Snow <jsnow@redhat.com>
>>
>> Reviewed-by: Markus Armbruster <armbru@redhat.com>