Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,18 @@
"commands": [
"spdx-tool"
]
},
"demaconsulting.pandoctool": {
"version": "3.8.3",
"commands": [
"pandoc"
]
},
"demaconsulting.weasyprinttool": {
"version": "67.0.0",
"commands": [
"weasyprint"
]
}
}
}
53 changes: 53 additions & 0 deletions .github/workflows/build_docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
name: Build Documentation

on:
workflow_call:

jobs:
build-docs:
permissions:
contents: read # To read repository contents

runs-on: windows-latest

steps:

- name: Checkout
uses: actions/checkout@v6

- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: 'lts/*'

- name: Setup dotnet
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
10.x

- name: Install npm dependencies
run: npm install

- name: Install dotnet tools
run: dotnet tool restore

- name: Generate HTML with Pandoc
run: >
dotnet pandoc
docs/guide/title.txt
--defaults docs/guide/definition.yaml
--output docs/guide/guide.html

- name: Generate PDF with Weasyprint
run: >
dotnet weasyprint
docs/guide/guide.html
docs/guide/guide.pdf

- name: Upload Documentation
uses: actions/upload-artifact@v6
with:
name: documentation
path: docs/guide/guide.pdf
7 changes: 7 additions & 0 deletions .github/workflows/build_on_push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,10 @@ jobs:
version: 0.0.0-run.${{ github.run_number }}
secrets:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

build-docs:
name: Build Documentation
needs: quality-checks
permissions:
contents: read # To read repository contents
uses: ./.github/workflows/build_docs.yaml
6 changes: 6 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ jobs:
secrets:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

build-docs:
name: Build Documentation
permissions:
contents: read # To read repository contents
uses: ./.github/workflows/build_docs.yaml

release:
permissions:
contents: write # To create releases
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ coverage/
# Temporary files
*.tmp
.DS_Store

# Node.js dependencies
node_modules/
13 changes: 13 additions & 0 deletions docs/guide/definition.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
resource-path:
- docs/guide
- docs/template

input-files:
- docs/guide/guide.md

template: guide_template.html

table-of-contents: true

number-sections: true
14 changes: 14 additions & 0 deletions docs/guide/title.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: TestResults Library
subtitle: Developer Guide
lang: en-US
keywords:
- TestResults
- C#
- .NET
- TRX
- JUnit
- Test Results
- Testing
- Documentation
---
178 changes: 178 additions & 0 deletions docs/template/guide_template.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
line-height: 1.6;
color: #333;
max-width: 800px;
margin: 0 auto;
padding: 20px;
}

h1, h2, h3, h4, h5, h6 {
margin-top: 24px;
margin-bottom: 16px;
font-weight: 600;
line-height: 1.25;
}

h1 {
font-size: 2em;
border-bottom: 1px solid #eaecef;
padding-bottom: 0.3em;
}

h2 {
font-size: 1.5em;
border-bottom: 1px solid #eaecef;
padding-bottom: 0.3em;
}

h3 {
font-size: 1.25em;
}

h4 {
font-size: 1em;
}

h5 {
font-size: 0.875em;
}

h6 {
font-size: 0.85em;
color: #6a737d;
}

code {
background-color: #f6f8fa;
border-radius: 3px;
font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
font-size: 85%;
padding: 0.2em 0.4em;
}

pre {
background-color: #f6f8fa;
border-radius: 3px;
font-size: 85%;
line-height: 1.45;
overflow: auto;
padding: 16px;
}

pre code {
background-color: transparent;
border: 0;
display: inline;
line-height: inherit;
margin: 0;
max-width: auto;
overflow: visible;
padding: 0;
word-wrap: normal;
}

blockquote {
border-left: 0.25em solid #dfe2e5;
color: #6a737d;
padding: 0 1em;
margin: 0 0 16px 0;
}

table {
border-collapse: collapse;
margin: 16px 0;
width: 100%;
}

table th, table td {
border: 1px solid #dfe2e5;
padding: 6px 13px;
}

table tr {
background-color: #fff;
border-top: 1px solid #c6cbd1;
}

table tr:nth-child(2n) {
background-color: #f6f8fa;
}

ul, ol {
padding-left: 2em;
margin-bottom: 16px;
}

li + li {
margin-top: 0.25em;
}

a {
color: #0366d6;
text-decoration: none;
}

a:hover {
text-decoration: underline;
}

.title-page {
text-align: center;
margin-top: 100px;
margin-bottom: 100px;
}

.title-page h1 {
font-size: 3em;
border-bottom: none;
}

.title-page h2 {
font-size: 2em;
color: #6a737d;
border-bottom: none;
}

#TOC {
border: 1px solid #dfe2e5;
border-radius: 3px;
padding: 16px;
margin: 24px 0;
background-color: #f6f8fa;
}

#TOC ul {
list-style-type: none;
padding-left: 0;
}

#TOC ul ul {
padding-left: 20px;
}

#TOC > ul > li {
margin-top: 8px;
}

#TOC a {
color: #0366d6;
}

@media print {
body {
max-width: none;
}

.title-page {
page-break-after: always;
}

h1, h2, h3 {
page-break-after: avoid;
}

pre, blockquote {
page-break-inside: avoid;
}
}
28 changes: 28 additions & 0 deletions docs/template/guide_template.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!DOCTYPE html>
<html lang="$lang$">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>$if(title)$$title$$endif$</title>
<link rel="stylesheet" href="../template/guide_template.css">
</head>
<body>
$if(title)$
<div class="title-page">
<h1>$title$</h1>
$if(subtitle)$
<h2>$subtitle$</h2>
$endif$
</div>
$endif$

$if(toc)$
<nav id="TOC">
<h2>Table of Contents</h2>
$toc$
</nav>
$endif$

$body$
</body>
</html>
7 changes: 7 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"private": true,
"devDependencies": {
"@mermaid-js/mermaid-cli": "11.12.0",
"mermaid-filter": "1.4.7"
}
}