diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 24c4e4fd..d33d66f1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -123,8 +123,6 @@ jobs: - name: Install Node dependencies working-directory: ./src/attack_flow_builder/ run: npm ci - - name: Install Mermaid - run: npm install -g @mermaid-js/mermaid-cli - name: Create client directory run: mkdir docs/extra/ui - name: Download Attack Flow Builder diff --git a/Makefile b/Makefile index 2b7801c5..dbf5ade2 100644 --- a/Makefile +++ b/Makefile @@ -24,7 +24,6 @@ docs-examples: src/attack_flow_builder/dist/cli.common.js ## Build example flows ls -1 corpus/*.json | sed 's/corpus\/\(.*\)\.json/\1/' | xargs -t -I {} af graphviz "corpus/{}.json" "docs/extra/corpus/{}.dot" ls -1 docs/extra/corpus/*.dot | xargs -t -I {} dot -Tpng -O -q1 "{}" ls -1 corpus/*.json | sed 's/corpus\/\(.*\)\.json/\1/' | xargs -t -I {} af mermaid "corpus/{}.json" "docs/extra/corpus/{}.mmd" - ls -1 corpus/*.json | sed 's/corpus\/\(.*\)\.json/\1/' | xargs -t -I {} mmdc -i "docs/extra/corpus/{}.mmd" -o "docs/extra/corpus/{}.mmd.png" af doc-examples corpus/ docs/example_flows.rst docs-matrix: ## Build the Navigator visualization JS code diff --git a/src/attack_flow/docs.py b/src/attack_flow/docs.py index 1a761809..5b876c80 100644 --- a/src/attack_flow/docs.py +++ b/src/attack_flow/docs.py @@ -319,7 +319,7 @@ def generate_example_flows(jsons, afds): formats.append( f'
Download: JSON | ' f'GraphViz (PNG) | ' - f'Mermaid (PNG)' + f'Mermaid' ) doc_lines.append(f" * - **{name}**") doc_lines.append("") diff --git a/tests/test_docs.py b/tests/test_docs.py index 0d43e2eb..a7c96c7c 100644 --- a/tests/test_docs.py +++ b/tests/test_docs.py @@ -381,29 +381,29 @@ def test_generate_example_flows(): afds = [Path("tests/fixtures/flow1.afd")] result = generate_example_flows(jsons, afds) assert result == [ - '.. list-table::', - ' :widths: 30 20 50', - ' :header-rows: 1', - '', - ' * - Report', - ' - Authors', - ' - Description', - ' * - **Test Flow 1**', - '', - ' .. raw:: html', - '', + ".. list-table::", + " :widths: 30 20 50", + " :header-rows: 1", + "", + " * - Report", + " - Authors", + " - Description", + " * - **Test Flow 1**", + "", + " .. raw:: html", + "", '
Open: Attack Flow Builder
', - 'Download: JSON | GraphViz (PNG) | Mermaid (PNG)', - ' - John Doe', - ' - Test flow 1 is used for unit tests.', - '', - ' * - **Test Flow 2**', - '', - ' .. raw:: html', - '', - '
Download: JSON | GraphViz (PNG) | Mermaid (PNG)', - ' - Jane Doe', - ' - Test flow 2 is used for unit tests.', - '', - '' + '
Download: JSON | GraphViz (PNG) | Mermaid', + " - John Doe", + " - Test flow 1 is used for unit tests.", + "", + " * - **Test Flow 2**", + "", + " .. raw:: html", + "", + '
Download: JSON | GraphViz (PNG) | Mermaid', + " - Jane Doe", + " - Test flow 2 is used for unit tests.", + "", + "", ]