Skip to content

Commit 2c65658

Browse files
authored
Fix DocFX API fix: Reference 404 and add documentation validation to CI (#71)
1 parent 707a351 commit 2c65658

5 files changed

Lines changed: 60 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@ jobs:
4040
- name: Build (Release)
4141
run: dotnet build PatternKit.slnx --configuration Release --no-restore /p:ContinuousIntegrationBuild=true
4242

43+
- name: Install DocFX
44+
run: dotnet tool update -g docfx
45+
46+
- name: Build Documentation
47+
run: |
48+
docfx metadata docs/docfx.json
49+
docfx build docs/docfx.json
50+
4351
- name: Test with coverage
4452
run: |
4553
dotnet test PatternKit.slnx \

.github/workflows/docs.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ jobs:
3030

3131
- run: dotnet tool update -g docfx
3232
- run: dotnet build -c Release
33-
- run: docfx docs/docfx.json
33+
- run: docfx metadata docs/docfx.json
34+
- run: docfx build docs/docfx.json
3435

3536
- name: Upload artifact
3637
uses: actions/upload-pages-artifact@v3

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ riderModule.iml
55
/_ReSharper.Caches/
66
.idea/
77
_site/
8-
api/
8+
# Exclude generated API metadata files but keep index.md
9+
docs/api/*.yml
10+
docs/api/.manifest
911
*.user
1012
TestResults/

docs/api/index.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# API Reference
2+
3+
Welcome to the PatternKit API reference documentation.
4+
5+
PatternKit provides fluent, modern implementations of classic design patterns for .NET 9+.
6+
7+
## Namespaces
8+
9+
Browse the API documentation by namespace:
10+
11+
- **PatternKit.Behavioral** - Behavioral patterns (Strategy, Chain, Iterator, Visitor, etc.)
12+
- **PatternKit.Creational** - Creational patterns (Factory, Builder, Prototype, Singleton)
13+
- **PatternKit.Structural** - Structural patterns (Decorator, Proxy, Facade, Adapter, etc.)
14+
- **PatternKit.Generators** - Source generators for reducing boilerplate
15+
16+
## Getting Started
17+
18+
If you're new to PatternKit, check out:
19+
20+
- [Home](../index.md) - Overview and quick start guide
21+
- [Patterns](../patterns/) - Pattern documentation and examples
22+
- [Generators](../generators/) - Source generator guides
23+
24+
## Additional Resources
25+
26+
- [GitHub Repository](https://github.com/JerrettDavis/PatternKit)
27+
- [NuGet Package](https://www.nuget.org/packages/PatternKit)

docs/docfx.json

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,25 @@
11
{
22
"$schema": "https://raw.githubusercontent.com/dotnet/docfx/main/schemas/docfx.schema.json",
3-
"metadata": [],
3+
"metadata": [
4+
{
5+
"src": [
6+
{
7+
"files": [
8+
"src/PatternKit.Core/**.csproj",
9+
"src/PatternKit.Generators.Abstractions/**.csproj"
10+
],
11+
"src": ".."
12+
}
13+
],
14+
"dest": "api",
15+
"includePrivateMembers": false,
16+
"disableGitFeatures": false,
17+
"disableDefaultFilter": false,
18+
"properties": {
19+
"TargetFramework": "net9.0"
20+
}
21+
}
22+
],
423
"build": {
524
"content": [
625
{

0 commit comments

Comments
 (0)