Skip to content

Commit c3c7f03

Browse files
colour coding should and musts. Added extra meta data support. see NF examples.
1 parent 2a9792c commit c3c7f03

38 files changed

+285
-36
lines changed

_data/primary-navigation.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
- title: Home
22
link: /
33

4-
54
- title: Guidance
65
link: /guidance/
76

87
- title: The Framework
98
link: /safs/
109

10+
- title: Tags
11+
link: /tags/
12+
1113
- title: Dimensions
1214
link: /saf_dimensions/
1315

_includes/saf.html

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
{% include construction.html %}
2-
<h1>{{ page.title }}: <a href="{{ saf_dimension.url | relative_url }}">{{ saf_dimension.title }}</a> </h1>
3-
{{ content }}
2+
3+
{%- if page.description -%}
4+
<h1>{{ page.title }}: {{ page.description }}</a></h1>
5+
<p><a href="{{ saf_dimension.url | relative_url }}">{{ saf_dimension.title }}</a></p>
6+
{%- else -%}
7+
<h1>{{ page.title }}: <a href="{{ saf_dimension.url | relative_url }}">{{ saf_dimension.title }}</a> </h1>
8+
{%- endif -%}
9+
{% include saf_content.html summary_only=false saf=page %}

_includes/saf_content.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
{% assign saf_to_render = include.saf %}
3+
{% if include.summary_only == true %}
4+
{% include saf_content_summary.html saf=saf_to_render %}
5+
{% else %}
6+
{% include saf_content_full.html saf=saf_to_render %}
7+
{% endif %}

_includes/saf_content_full.html

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
{% assign saf_to_render = include.saf %}
2+
3+
{% if saf_to_render.requirement != null %}
4+
<div>
5+
<h2>Requirement</h2>
6+
{{ saf_to_render.requirement | markdownify }}
7+
</div>
8+
{% endif %}
9+
10+
{% if saf_to_render.more_info != null %}
11+
<div>
12+
<h2>More information</h2>
13+
{{ saf_to_render.more_info | markdownify }}
14+
</div>
15+
{% endif %}
16+
17+
{% if saf_to_render.examples != null %}
18+
<div>
19+
<h2>Examples</h2>
20+
{% for example in saf_to_render.examples %}
21+
<div>
22+
<h3>{{ example.title }}</h3>
23+
{{ example.content | markdownify }}
24+
</div>
25+
{% endfor %}
26+
</div>
27+
{% endif %}
28+
29+
{% if saf_to_render.technology != null %}
30+
<div>
31+
<h2>Technology</h2>
32+
{% for technology in saf_to_render.technology %}
33+
<div>
34+
<h3>{{ technology.title }}</h3>
35+
{{ technology.content | markdownify }}
36+
</div>
37+
{% endfor %}
38+
</div>
39+
{% endif %}
40+
41+
{% if saf_to_render.further_reading != null %}
42+
<div>
43+
<h2>Further Reading</h2>
44+
{% for reading in saf_to_render.further_reading %}
45+
<div>
46+
<h3>
47+
{% if reading.url %}
48+
<a href="{{reading.url | relative_url}}">
49+
{% endif %}
50+
{{ reading.title }}
51+
{% if reading.url %}
52+
</a>
53+
{% endif %}
54+
</h3>
55+
{{ reading.content | markdownify }}
56+
</div>
57+
{% endfor %}
58+
</div>
59+
{% endif %}
60+
61+
{% assign content = saf_to_render.content %}
62+
{% assign requirement = saf_to_render.requirement | markdownify %}
63+
64+
{% if content != requirement %}
65+
<div>
66+
{{ content }}
67+
</div>
68+
{% endif %}

_includes/saf_content_summary.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
{% assign saf_to_render = include.saf %}
2+
{{saf_to_render.requirement | default: saf_to_render.content | markdownify | remove: '<p>' | remove: '</p>' }}

_includes/saf_dimension.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</a>
1313
</td>
1414
<td>
15-
{{saf.content | markdownify | remove: '<p>' | remove: '</p>' }}
15+
{{saf.requirement | default: saf.content | markdownify | remove: '<p>' | remove: '</p>' }}
1616
</td>
1717
</tr>
1818

_includes/safs.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@ <h3> <a href="{{ saf_dimension.url | relative_url }}">{{saf_dimension.title}}</
88
{% continue %}
99
{% endif %}
1010
<tr>
11-
<td>
11+
<td {%- if saf.requirement -%} {%- if saf.requirement contains '**MUST**' %} style="background-color: red;" {%- elsif saf.requirement contains '**SHOULD**' %} style="background-color: orange;" {%- else %} style="background-color: blue;" {%- endif -%}{%- endif -%}>
1212
<a href="{{ saf.url | relative_url }}">
1313
{{ saf.title }}
1414
</a>
1515
</td>
16-
<td>
17-
{{saf.content | markdownify | remove: '<p>' | remove: '</p>' }}
16+
<td >
17+
18+
{% include saf_content.html summary_only=true saf=saf %}
1819
</td>
1920
</tr>
2021
{% endfor %}

_includes/tags.html

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{%- assign site_pages_only = site.pages -%}
2+
{%- assign site_saf_dimensions = site.saf_dimensions -%}
3+
{%- assign site_safs = site.safs -%}
4+
5+
{% assign site_pages = site_pages_only | concat: site_saf_dimensions | concat: site_safs %}
6+
7+
{% assign alldocs = site_pages %}
8+
9+
{% assign alltags = alldocs | map: 'tags' | join: ',' | split: ',' | where_exp: "item", "item != ''" | group_by_exp: "item", "item" %}
10+
11+
{%- for tag in alltags -%}
12+
<h3> {{tag.name}}: {{tag.size}}</h3>
13+
14+
<ul>
15+
{%- for doc in site_pages -%}
16+
{%- if doc.tags contains tag.name -%}
17+
<li><a href="{{doc.url | relative_url}}">{{doc.title}}</a></li>
18+
{%- endif -%}
19+
{%- endfor -%}
20+
</ul>
21+
{%- endfor -%}
22+

_safs/d/d01.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: D01
33
dimension: documentation
4-
tags: [req]
4+
tags: []
55
nav_order: 2.71
66
---
77

_safs/dm/dm01.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: DM01
33
dimension: decisions
4-
tags: [saf,DM]
4+
tags: []
55
nav_order: 2.21
66
---
77

0 commit comments

Comments
 (0)