Skip to content

Commit 4369024

Browse files
author
vp
committed
feat(docs): add mkdocs configuration for site documentation and navigation
1 parent 574ec3d commit 4369024

19 files changed

Lines changed: 1550 additions & 75 deletions

.github/workflows/pages.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
12+
defaults:
13+
run:
14+
shell: bash
15+
16+
jobs:
17+
publish:
18+
name: Build and publish landing site
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
25+
26+
- name: Build site
27+
shell: pwsh
28+
run: |
29+
./docs/site/scripts/build-pages.ps1
30+
31+
- name: Verify static output
32+
run: |
33+
test -f .github/pages/index.html
34+
35+
- name: Publish to gh-pages
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
run: |
39+
set -euo pipefail
40+
41+
SITE_DIR="${GITHUB_WORKSPACE}/.github/pages"
42+
TARGET_DIR="$(mktemp -d)"
43+
REMOTE_URL="https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
44+
45+
git config --global user.name "github-actions[bot]"
46+
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
47+
48+
if git ls-remote --exit-code --heads "${REMOTE_URL}" gh-pages >/dev/null 2>&1; then
49+
git clone --depth 1 --branch gh-pages "${REMOTE_URL}" "${TARGET_DIR}"
50+
else
51+
git init "${TARGET_DIR}"
52+
(
53+
cd "${TARGET_DIR}"
54+
git checkout --orphan gh-pages
55+
git remote add origin "${REMOTE_URL}"
56+
)
57+
fi
58+
59+
find "${TARGET_DIR}" -mindepth 1 -maxdepth 1 ! -name .git -exec rm -rf {} +
60+
cp -R "${SITE_DIR}/." "${TARGET_DIR}/"
61+
touch "${TARGET_DIR}/.nojekyll"
62+
63+
(
64+
cd "${TARGET_DIR}"
65+
git add -A
66+
if git diff --cached --quiet; then
67+
echo "No site changes to publish."
68+
exit 0
69+
fi
70+
git commit -m "docs: publish site for ${GITHUB_SHA}"
71+
git push origin HEAD:gh-pages --force
72+
)

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ dlldata.c
5757

5858
# Benchmark Results
5959
BenchmarkDotNet.Artifacts/
60+
.github/pages/
61+
docs/site/reference/
6062

6163
# .NET Core
6264
project.lock.json
@@ -423,4 +425,4 @@ FodyWeavers.xsd
423425
/.tmp/
424426
.claude
425427
_tmp**
426-
.temp**
428+
.temp**

.vscode/tasks.json

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,49 @@
141141
"group": "test",
142142
"problemMatcher": "$msCompile"
143143
},
144+
{
145+
"label": "Docs - sync",
146+
"type": "process",
147+
"command": "pwsh",
148+
"args": [
149+
"-File",
150+
"${workspaceFolder}/docs/site/scripts/sync-docs.ps1"
151+
],
152+
"problemMatcher": []
153+
},
154+
{
155+
"label": "Docs - landing page serve",
156+
"type": "process",
157+
"command": "pwsh",
158+
"args": [
159+
"-File",
160+
"${workspaceFolder}/docs/site/scripts/serve-pages.ps1"
161+
],
162+
"isBackground": true,
163+
"problemMatcher": {
164+
"pattern": [],
165+
"background": {
166+
"activeOnStart": true,
167+
"beginsPattern": ".",
168+
"endsPattern": "Serving on .*:8000/"
169+
}
170+
},
171+
"presentation": {
172+
"reveal": "always",
173+
"panel": "dedicated",
174+
"clear": false
175+
}
176+
},
177+
{
178+
"label": "Docs - landing page build",
179+
"type": "process",
180+
"command": "pwsh",
181+
"args": [
182+
"-File",
183+
"${workspaceFolder}/docs/site/scripts/build-pages.ps1"
184+
],
185+
"problemMatcher": []
186+
},
144187
{
145188
"label": "WeatherForecast - build",
146189
"command": "dotnet",

README.md

Lines changed: 133 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,24 @@
1212
- [](#)
1313
- [Introduction](#introduction)
1414
- [Documentation](#documentation)
15-
- [Feature Highlights](#feature-highlights)
16-
- [Core domain and application](#core-domain-and-application)
17-
- [Execution, messaging and modularity](#execution-messaging-and-modularity)
18-
- [Presentation and host](#presentation-and-host)
19-
- [Storage, scheduling and operations](#storage-scheduling-and-operations)
20-
- [Common building blocks](#common-building-blocks)
15+
- [Features](#features)
16+
- [Common Infrastructure](#common-infrastructure)
17+
- [Core Domain and Application](#core-domain-and-application)
18+
- [Execution, Messaging and Modularity](#execution-messaging-and-modularity)
19+
- [Security and Access](#security-and-access)
20+
- [Presentation and Host](#presentation-and-host)
21+
- [Storage, Scheduling and Utilities](#storage-scheduling-and-utilities)
22+
- [Testing and Test Utilities](#testing-and-test-utilities)
2123
- [Libraries used (excerpt):](#libraries-used-excerpt)
2224
- [Example projects](#example-projects)
2325
- [Performance Benchmarks](#performance-benchmarks)
26+
- [GitHub Pages](#github-pages)
27+
- [Source structure](#source-structure)
28+
- [Which Markdown files get into the site](#which-markdown-files-get-into-the-site)
29+
- [Add a new documentation page](#add-a-new-documentation-page)
30+
- [Local preview and build](#local-preview-and-build)
31+
- [Publishing through GitHub Actions](#publishing-through-github-actions)
32+
- [Typical workflow for docs updates](#typical-workflow-for-docs-updates)
2433
- [Collaboration](#collaboration)
2534
- [Commit Policy](#commit-policy)
2635
- [License](#license)
@@ -43,36 +52,40 @@ the [CHANGELOG](https://raw.githubusercontent.com/bridgingIT/bITdevKit/main/CHAN
4352

4453
## Documentation
4554

46-
The best entry point into the current documentation set is the
47-
[Documentation Index](./docs/INDEX.md).
55+
The public documentation site is available at
56+
[bridgingit-gmbh.github.io/bITdevKit](https://bridgingit-gmbh.github.io/bITdevKit/).
4857

49-
Recommended starting path:
58+
The best entry point into the current documentation set is the
59+
[Documentation](./docs/INDEX.md) and [Introduction to DDD in bITdevKit](./docs/introduction-ddd-guide.md).
5060

51-
- [Domain](./docs/features-domain.md)
52-
- [Results](./docs/features-results.md)
53-
- [Requester and Notifier](./docs/features-requester-notifier.md)
54-
- [Modules](./docs/features-modules.md)
55-
- [Presentation Endpoints](./docs/features-presentation-endpoints.md)
61+
## Features
5662

57-
Additional entry points:
63+
### Common Infrastructure
5864

59-
- [Introduction to DDD in bITdevKit](./docs/introduction-ddd-guide.md)
60-
- [Testing Common XUnit](./docs/testing-common-xunit.md)
61-
- [Fake Authentication for Integration Tests](./docs/testing-fake-authentication.md)
62-
63-
## Feature Highlights
65+
- [Common Extensions](./docs/common-extensions.md)
66+
- [Common Utilities](./docs/common-utilities.md)
67+
- [Common Serialization](./docs/common-serialization.md)
68+
- [Common Options Builders](./docs/common-options-builders.md)
69+
- [Common Mapping](./docs/common-mapping.md)
70+
- [Common Caching](./docs/common-caching.md)
71+
- [Common Observability Tracing](./docs/common-observability-tracing.md)
6472

65-
### Core domain and application
73+
### Core Domain and Application
6674

6775
- [Domain](./docs/features-domain.md)
6876
- [Domain Events](./docs/features-domain-events.md)
77+
- [Event Sourcing](./docs/features-event-sourcing.md)
6978
- [Domain Repositories](./docs/features-domain-repositories.md)
7079
- [Domain Specifications](./docs/features-domain-specifications.md)
80+
- [ActiveEntity](./docs/features-domain-activeentity.md)
81+
- [Domain Policies](./docs/features-domain-policies.md)
82+
- [Rules](./docs/features-rules.md)
7183
- [Results](./docs/features-results.md)
7284
- [Application Commands and Queries](./docs/features-application-commands-queries.md)
7385
- [Application Events](./docs/features-application-events.md)
86+
- [DataPorter](./docs/features-application-dataporter.md)
7487

75-
### Execution, messaging and modularity
88+
### Execution, Messaging and Modularity
7689

7790
- [Requester and Notifier](./docs/features-requester-notifier.md)
7891
- [Messaging](./docs/features-messaging.md)
@@ -81,16 +94,22 @@ Additional entry points:
8194
- [Modules](./docs/features-modules.md)
8295
- [Pipelines](./docs/features-pipelines.md)
8396
- [Filtering](./docs/features-filtering.md)
97+
- [Extensions](./docs/features-extensions.md)
98+
99+
### Security and Access
100+
101+
- [Entity Permissions](./docs/features-entitypermissions.md)
102+
- [Fake Identity Provider](./docs/features-identityprovider.md)
84103

85-
### Presentation and host
104+
### Presentation and Host
86105

87106
- [Presentation Endpoints](./docs/features-presentation-endpoints.md)
88107
- [Console Commands](./docs/features-presentation-console-commands.md)
89108
- [CORS Configuration](./docs/features-presentation-cors.md)
90109
- [Exception Handling](./docs/features-presentation-exception-handling.md)
91110
- [AppState](./docs/features-presentation-appstate.md)
92111

93-
### Storage, scheduling and operations
112+
### Storage, Scheduling and Utilities
94113

95114
- [StartupTasks](./docs/features-startuptasks.md)
96115
- [JobScheduling](./docs/features-jobscheduling.md)
@@ -99,15 +118,10 @@ Additional entry points:
99118
- [Storage Monitoring](./docs/features-storage-monitoring.md)
100119
- [Log Entries](./docs/features-log-entries.md)
101120

102-
### Common building blocks
121+
### Testing and Test Utilities
103122

104-
- [Common Extensions](./docs/common-extensions.md)
105-
- [Common Utilities](./docs/common-utilities.md)
106-
- [Common Serialization](./docs/common-serialization.md)
107-
- [Common Options Builders](./docs/common-options-builders.md)
108-
- [Common Mapping](./docs/common-mapping.md)
109-
- [Common Caching](./docs/common-caching.md)
110-
- [Common Observability Tracing](./docs/common-observability-tracing.md)
123+
- [Fake Authentication for Integration Tests](./docs/testing-fake-authentication.md)
124+
- [Testing Common XUnit](./docs/testing-common-xunit.md)
111125

112126
## Libraries used (excerpt):
113127

@@ -158,6 +172,93 @@ dotnet run -c Release --project benchmarks/Common.Benchmarks/Common.Benchmarks.c
158172

159173
For more details, see the `Common.Benchmarks` project in the `benchmarks/` folder.
160174

175+
## GitHub Pages
176+
177+
The repository includes a MkDocs-based GitHub Pages site with:
178+
179+
- a landing page under `docs/site/`
180+
- curated technical docs synced from `./docs`
181+
182+
Public site:
183+
[https://bridgingit-gmbh.github.io/bITdevKit/](https://bridgingit-gmbh.github.io/bITdevKit/)
184+
185+
### Source structure
186+
187+
- `docs/site/`
188+
- the site-specific source pages such as the landing page, getting started pages, templates page, styling, and helper scripts
189+
- `docs/`
190+
- the framework documentation source that is selectively imported into the public site
191+
- `.github/pages/`
192+
- the generated static MkDocs output
193+
194+
### Which Markdown files get into the site
195+
196+
The sync step currently imports these files from `./docs` into the public site:
197+
198+
- `INDEX.md`
199+
- `introduction-ddd-guide.md`
200+
- `common-*.md`
201+
- `features-*.md`
202+
- `testing-*.md`
203+
204+
The following are intentionally excluded from GitHub Pages:
205+
206+
- `docs/adr/`
207+
- `docs/presentations/`
208+
- `docs/specs/`
209+
- `src/**`
210+
211+
### Add a new documentation page
212+
213+
For a new Markdown page from `./docs` to appear in GitHub Pages:
214+
215+
1. Add or update the Markdown file under `./docs`.
216+
2. Make sure its filename matches one of the currently imported patterns above.
217+
3. If it should appear in navigation, add it to [mkdocs.yml](./mkdocs.yml) under the appropriate section.
218+
4. Regenerate the site locally or push to `main` so GitHub Actions publishes it.
219+
220+
### Local preview and build
221+
222+
Preview the full site locally with Docker:
223+
224+
```powershell
225+
pwsh -File ./docs/site/scripts/serve-pages.ps1
226+
```
227+
228+
or use the VS Code Tasks for the same command.
229+
Build the full static site locally:
230+
231+
```powershell
232+
pwsh -File ./docs/site/scripts/build-pages.ps1
233+
```
234+
235+
That build command performs these steps:
236+
237+
1. Synchronize the selected public docs from `./docs` into `docs/site/reference/`
238+
2. Build the MkDocs site in Docker
239+
3. Write the generated static site to `./.github/pages/`
240+
241+
### Publishing through GitHub Actions
242+
243+
The Pages workflow is defined in [pages.yml](./.github/workflows/pages.yml).
244+
245+
On each push to `main`, it:
246+
247+
1. checks out the repository
248+
2. runs `./docs/site/scripts/build-pages.ps1`
249+
3. verifies that `./.github/pages/index.html` was generated
250+
4. publishes the generated site to the `gh-pages` branch
251+
252+
### Typical workflow for docs updates
253+
254+
Typical documentation workflow:
255+
256+
1. Edit or add Markdown under `./docs`
257+
2. If needed, update [mkdocs.yml](./mkdocs.yml) so the page is reachable in navigation
258+
3. Run `pwsh -File ./docs/site/scripts/serve-pages.ps1` to preview the result
259+
4. Run `pwsh -File ./docs/site/scripts/build-pages.ps1` to generate the final static output
260+
5. Commit and push to `main` to publish via GitHub Actions
261+
161262
## Collaboration
162263

163264
Simply create a pull request with your ideas or contact us.

0 commit comments

Comments
 (0)