[rtems-central commit] specdoc: Fix item description

Sebastian Huber sebh at rtems.org
Fri Sep 18 11:31:55 UTC 2020


Module:    rtems-central
Branch:    master
Commit:    b730b190b26b40a94daa61b60cc28e1e37ae6d9d
Changeset: http://git.rtems.org/rtems-central/commit/?id=b730b190b26b40a94daa61b60cc28e1e37ae6d9d

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Thu Jul 23 15:38:26 2020 +0200

specdoc: Fix item description

---

 rtemsspec/specdoc.py            | 8 +++++---
 rtemsspec/tests/spec-doc/a.yml  | 2 +-
 rtemsspec/tests/test_specdoc.py | 2 +-
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/rtemsspec/specdoc.py b/rtemsspec/specdoc.py
index 7ab38fe..94c7de3 100644
--- a/rtemsspec/specdoc.py
+++ b/rtemsspec/specdoc.py
@@ -258,7 +258,6 @@ class _Documenter:
                  config: dict):
         self._name = item["spec-type"]
         self.section = item["spec-name"]
-        self._description = item["spec-description"]
         self._info_map = item["spec-info"]
         self._item = item
         self._documenter_map = documenter_map
@@ -267,6 +266,7 @@ class _Documenter:
         self._mapper = SphinxMapper(item)
         self._mapper.add_get_value("spec:/spec-name",
                                    self._get_ref_specification_type)
+        self._description = self._substitute(item["spec-description"])
         assert self._name not in documenter_map
         documenter_map[self._name] = self
 
@@ -370,9 +370,9 @@ class _Documenter:
                                   "attributes are mandatory:")
                     for attribute in sorted(mandatory_attributes):
                         content.add_list_item(f"``{attribute}``")
-                    content.add_blank_line()
+                    content.ensure_blank_line()
                 else:
-                    content.add_blank_line()
+                    content.ensure_blank_line()
             content.paste("The explicit attributes for this type are:")
             self._document_attributes(content, info["attributes"])
         if "generic-attributes" in info:
@@ -426,6 +426,8 @@ class _Documenter:
                              "This type refines the following types:",
                              add_blank_line=True)
             content.wrap(self._description)
+        if self._description:
+            content.add_blank_line()
 
     def document(self,
                  content: SphinxContent,
diff --git a/rtemsspec/tests/spec-doc/a.yml b/rtemsspec/tests/spec-doc/a.yml
index 2384ae3..721852c 100644
--- a/rtemsspec/tests/spec-doc/a.yml
+++ b/rtemsspec/tests/spec-doc/a.yml
@@ -9,7 +9,7 @@ links:
   spec-key: type
   spec-value: spec
   uid: root
-spec-description: null
+spec-description: A description.
 spec-example: |
   a: null
 spec-info:
diff --git a/rtemsspec/tests/test_specdoc.py b/rtemsspec/tests/test_specdoc.py
index 1c0ae58..77fbbbd 100644
--- a/rtemsspec/tests/test_specdoc.py
+++ b/rtemsspec/tests/test_specdoc.py
@@ -216,7 +216,7 @@ A
 ^
 
 This type refines the :ref:`SpecTypeRoot` though the ``type`` attribute if the
-value is ``spec``.
+value is ``spec``. A description.
 
 The explicit attributes for this type are:
 



More information about the vc mailing list