diff --git a/.cspell.json b/.cspell.json index c976dec..0397e65 100644 --- a/.cspell.json +++ b/.cspell.json @@ -19,6 +19,7 @@ "Dependabot", "dependabot", "doctitle", + "docversion", "dotnet", "dotnettool", "editorconfig", diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index a7154a4..f49fa2a 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -356,6 +356,8 @@ jobs: dotnet pandoc --defaults docs/guide/definition.yaml --filter node_modules/.bin/mermaid-filter.cmd + --metadata version="${{ inputs.version }}" + --metadata date="$(date +'%Y-%m-%d')" --output docs/guide/guide.html - name: Generate PDF with Weasyprint @@ -370,6 +372,8 @@ jobs: dotnet pandoc --defaults docs/requirements/definition.yaml --filter node_modules/.bin/mermaid-filter.cmd + --metadata version="${{ inputs.version }}" + --metadata date="$(date +'%Y-%m-%d')" --output docs/requirements/requirements.html - name: Generate Requirements PDF with Weasyprint @@ -384,6 +388,8 @@ jobs: dotnet pandoc --defaults docs/tracematrix/definition.yaml --filter node_modules/.bin/mermaid-filter.cmd + --metadata version="${{ inputs.version }}" + --metadata date="$(date +'%Y-%m-%d')" --output docs/tracematrix/tracematrix.html - name: Generate Trace Matrix PDF with Weasyprint @@ -417,6 +423,8 @@ jobs: dotnet pandoc --defaults docs/quality/definition.yaml --filter node_modules/.bin/mermaid-filter.cmd + --metadata version="${{ inputs.version }}" + --metadata date="$(date +'%Y-%m-%d')" --output docs/quality/quality.html - name: Generate Code Quality PDF with Weasyprint diff --git a/docs/template/template.html b/docs/template/template.html index 1a34602..eb2ac3a 100644 --- a/docs/template/template.html +++ b/docs/template/template.html @@ -56,6 +56,13 @@ margin-bottom: 1rem; } +.version { + font-size: 1rem; + color: #888; + margin-bottom: 1rem; + font-style: italic; +} + .author, .date { font-size: 1rem; color: #888; @@ -153,7 +160,7 @@ border: 1px solid #ddd; border-radius: 4px; padding: 1rem; - overflow-x: auto; + overflow: auto; margin-bottom: 1rem; page-break-inside: avoid; } @@ -250,26 +257,32 @@ size: letter; margin: 1in 0.75in; - @top-center { + @top-left { content: string(doctitle); font-size: 10pt; color: #666; - border-bottom: 1px solid #e0e0e0; - padding-bottom: 0.25in; + } + + @top-right { + content: string(docversion); + font-size: 10pt; + color: #666; } @bottom-center { content: "Page " counter(page) " of " counter(pages); font-size: 10pt; color: #666; - border-top: 1px solid #e0e0e0; - padding-top: 0.25in; } } /* Don't show header/footer on title page */ @page :first { - @top-center { + @top-left { + content: none; + } + + @top-right { content: none; } @@ -283,6 +296,11 @@ string-set: doctitle content(); } +/* Set the document version for the header */ +.version { + string-set: docversion content(); +} + /* Add page numbers to TOC entries using target-counter */ #TOC a::after { content: leader('.') target-counter(attr(href), page); @@ -309,6 +327,9 @@

$title$

$if(subtitle)$

$subtitle$

$endif$ +$if(version)$ +

Version $version$

+$endif$ $for(author)$

$author$

$endfor$