summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2020-07-16 13:07:38 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2020-09-18 13:17:54 +0200
commit83fe0c2ccf062619b0b2419f874537d98d7d44b0 (patch)
tree69ace1080ff5daf97064faedd687b5b6fa9dc34f
parentspecdoc: Make label prefix configurable (diff)
downloadrtems-central-83fe0c2ccf062619b0b2419f874537d98d7d44b0.tar.bz2
specdoc: Make section texts configurable
-rw-r--r--config.yml10
-rw-r--r--rtemsspec/specdoc.py13
-rw-r--r--rtemsspec/tests/test_specdoc.py21
3 files changed, 32 insertions, 12 deletions
diff --git a/config.yml b/config.yml
index cf188b05..d6d93dfe 100644
--- a/config.yml
+++ b/config.yml
@@ -98,6 +98,12 @@ interface-documentation:
spec-verification:
root-type: /spec/root
spec-documentation:
- root-type: /spec/root
doc-target: modules/rtems-docs/eng/req/items.rst
- label-prefix: SpecType
+ hierarchy-subsection-name: Specification Item Hierarchy
+ hierarchy-text: |
+ The specification item types have the following hierarchy:
+ item-types-subsection-name: Specification Item Types
+ root-type: /spec/root
+ section-label-prefix: ReqEng
+ section-name: Specification Items
+ value-types-subsection-name: Specification Attribute Sets and Value Types
diff --git a/rtemsspec/specdoc.py b/rtemsspec/specdoc.py
index 823a7d55..7ab38fe2 100644
--- a/rtemsspec/specdoc.py
+++ b/rtemsspec/specdoc.py
@@ -558,15 +558,14 @@ def document(config: dict, item_cache: ItemCache) -> None:
for documenter in documenter_map.values():
documenter.resolve_used_by()
documenter_names = set(documenter_map)
- content.section_label_prefix = "ReqEng"
- with content.section("Specification Items"):
- with content.section("Specification Item Hierarchy"):
- content.add(
- "The specification item types have the following hierarchy:")
+ content.section_label_prefix = config["section-label-prefix"]
+ with content.section(config["section-name"]):
+ with content.section(config["hierarchy-subsection-name"]):
+ content.add(config["hierarchy-text"])
root_documenter.hierarchy(content)
- with content.section("Specification Item Types"):
+ with content.section(config["item-types-subsection-name"]):
root_documenter.document(content, documenter_names)
- with content.section("Specification Attribute Sets and Value Types"):
+ with content.section(config["value-types-subsection-name"]):
documenters = [documenter_map[name] for name in documenter_names]
for documenter in sorted(documenters, key=lambda x: x.section):
documenter.document(content)
diff --git a/rtemsspec/tests/test_specdoc.py b/rtemsspec/tests/test_specdoc.py
index 0a3d2941..1c0ae586 100644
--- a/rtemsspec/tests/test_specdoc.py
+++ b/rtemsspec/tests/test_specdoc.py
@@ -39,9 +39,24 @@ def test_document(tmpdir):
assert item_cache["/root"].type == "spec"
doc_target = os.path.join(tmpdir, "items.rst")
config = {
- "root-type": "/root",
- "doc-target": doc_target,
- "label-prefix": "SpecType",
+ "doc-target":
+ doc_target,
+ "hierarchy-subsection-name":
+ "Specification Item Hierarchy",
+ "hierarchy-text":
+ "The specification item types have the following hierarchy:",
+ "item-types-subsection-name":
+ "Specification Item Types",
+ "label-prefix":
+ "SpecType",
+ "root-type":
+ "/root",
+ "section-label-prefix":
+ "ReqEng",
+ "section-name":
+ "Specification Items",
+ "value-types-subsection-name":
+ "Specification Attribute Sets and Value Types",
}
document(config, item_cache)
with open(doc_target, "r") as src: