Skip to content

Commit 139b157

Browse files
rjaegersCopilot
andauthored
docs: reduce custom code (#1173)
* docs: remove custom scripting in favor of native SBDL functionality * docs: Update SRS template * docs: fix artifact paths * docs: change paths * docs: homogonize titles * docs: try to create a valid Gherkin SBDL hybrid * docs: remove leftover from previous experiment * docs: unconfuse Gherkin parser by commenting @sbdl-[begin|end] The @sbdl markers were seen as tags * docs: update all scenarios * chore: disable megalinter built-in gherkin-lint * ci: minor refactor of run steps * docs: test different formatting * docs: formatting changes * Update compilation.feature Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Ron <45816308+rjaegers@users.noreply.github.com> --------- Signed-off-by: Ron <45816308+rjaegers@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent c16822b commit 139b157

12 files changed

+411
-462
lines changed

.github/workflows/wc-document-generation.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,18 @@ jobs:
2323
run: |
2424
set -Eeuo pipefail
2525
sudo apt-get update && sudo apt-get install --no-install-recommends -y plantuml
26-
python -m pip install gherkin-official==35.1.0 sbdl==1.16.4
26+
python -m pip install gherkin-official==38.0.0 sbdl==1.21.3
27+
- name: Build & Validate SBDL model
28+
run: sbdl -m compile test/cpp/features/*.feature > amp-devcontainer.sbdl
2729
- name: Generate SRS document
28-
run: |
29-
set -Eeuo pipefail
30-
python docs/support/gherkin-to-sbdl.py test/cpp/features/*.feature
31-
sbdl -m template-fill --template docs/templates/software-requirements-specification.md.j2 output.sbdl > software-requirements-specification.md
32-
- uses: docker://pandoc/extra:3.7.0@sha256:a703d335fa237f8fc3303329d87e2555dca5187930da38bfa9010fa4e690933a
30+
run: sbdl -m template-fill --template docs/templates/software-requirements-specification.md.j2 amp-devcontainer.sbdl > software-requirements-specification.md
31+
- uses: docker://pandoc/extra:3.9.0.0-ubuntu@sha256:72afa9c8d3300e5f10c9c4330e101725687f2179bffd912fb859c6d2ae85de62
3332
with:
34-
args: --template eisvogel --listings --number-sections --output software-requirements-specification.pdf software-requirements-specification.md
33+
args: --template eisvogel --syntax-highlighting idiomatic --number-sections --output software-requirements-specification.pdf software-requirements-specification.md
3534
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
3635
with:
3736
name: documents
38-
path: "*.pdf"
37+
path: |
38+
*.pdf
39+
*.sbdl
3940
retention-days: 2

.mega-linter.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
ENABLE:
22
- ACTION
33
- DOCKERFILE
4-
- GHERKIN
54
- JSON
65
- MARKDOWN
76
- REPOSITORY

docs/support/gherkin-to-sbdl.py

Lines changed: 0 additions & 39 deletions
This file was deleted.

docs/support/gherkin_mapping_config.py

Lines changed: 0 additions & 106 deletions
This file was deleted.

docs/support/gherkin_sbdl_converter.py

Lines changed: 0 additions & 157 deletions
This file was deleted.

docs/templates/software-requirements-specification.md.j2

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: "Software requirements specification for amp-devcontainer"
33
author: ["@rjaegers"]
44
colorlinks: true
5-
date: "October-2025"
5+
date: "February-2026"
66
keywords: [Software, Requirements, SRS, amp-devcontainer]
77
lang: "en"
88
titlepage: true
@@ -46,24 +46,26 @@ The containers may be used both for local development and continuous integration
4646
{{ text.encode('utf-8').decode('unicode_escape') }}
4747
{%- endmacro -%}
4848

49-
{%- macro sbdl_id_to_header(text) -%}
50-
{{ text.replace('_', ' ') }}
49+
{%- macro strip_gherkin_prefix(text) -%}
50+
{{ text | replace('Rule: ', '') | replace('Feature: ', '') }}
5151
{%- endmacro -%}
5252

53-
{%- for req_id, requirement in sbdl.items() %}
54-
{%- if requirement.type == 'requirement' and 'parent' not in requirement %}
53+
{%- for aspect_id, aspect in sbdl.items() %}
54+
{%- if aspect.type == 'aspect' %}
5555

56-
## {{ reencode(sbdl_id_to_header(req_id)) }}
56+
## {{ reencode(strip_gherkin_prefix(aspect['custom:title'])) }}
5757

58-
{{ reencode(requirement.description) }}
58+
{{ reencode(aspect.description) }}
5959

60-
{%- if 'child' in requirement %}
61-
{%- for child in requirement.child %}
62-
{%- set child_req = sbdl[child.identifier] %}
60+
{%- if 'requirement' in aspect %}
61+
{%- for req_ref in aspect.requirement %}
62+
{%- set req = sbdl[req_ref.identifier] %}
6363

64-
### {{ reencode(sbdl_id_to_header(child.identifier)) }}
64+
### {{ req_ref.identifier }}: {{ reencode(strip_gherkin_prefix(req['custom:title'])) }}
6565

66-
{{ reencode(child_req.description) }}
66+
{{ reencode(req.description) }}
67+
68+
{{ reencode(req.remark) }}
6769

6870
{%- endfor %}
6971
{%- endif %}

0 commit comments

Comments
 (0)