Skip to content

Commit be01cb1

Browse files
Merge pull request #83 from Chris-Wolfgang/copilot/fix-docfx-configuration
Fix DocFX configuration to build API documentation via CI/CD workflow
2 parents 08bb992 + c527886 commit be01cb1

File tree

7 files changed

+48
-11
lines changed

7 files changed

+48
-11
lines changed

.github/workflows/docfx.yaml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,18 @@ jobs:
4040

4141
- name: Verify build output
4242
run: |
43-
if [ ! -d "docfx_project/_site" ]; then
44-
echo "Error: _site directory not found!"
43+
if [ ! -d "docs" ]; then
44+
echo "Error: docs directory not found!"
4545
exit 1
4646
fi
47-
echo "Build successful. Contents of _site:"
48-
ls -la docfx_project/_site
47+
echo "Build successful. Contents of docs:"
48+
ls -la docs
49+
echo "API documentation:"
50+
ls -la docs/api
4951
5052
- name: Deploy to GitHub Pages
5153
uses: peaceiris/actions-gh-pages@v4
5254
with:
5355
github_token: ${{ secrets.GITHUB_TOKEN }}
54-
publish_dir: ./docfx_project/_site
56+
publish_dir: ./docs
5557
force_orphan: true

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,3 +424,7 @@ CoverageReport/
424424
# DocFX generated files
425425
docfx_project/_site/
426426
docfx_project/obj/
427+
428+
# Generated documentation (built by CI/CD)
429+
docs/*
430+
!docs/.gitkeep

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,40 @@ dotnet format --verify-no-changes
146146

147147
See [README-FORMATTING.md](README-FORMATTING.md) for detailed formatting guidelines.
148148

149+
### Building Documentation
150+
151+
This project uses [DocFX](https://dotnet.github.io/docfx/) to generate API documentation:
152+
153+
```bash
154+
# Install DocFX (one-time setup)
155+
dotnet tool install -g docfx
156+
157+
# Generate API metadata and build documentation
158+
cd docfx_project
159+
docfx metadata # Extract API metadata from source code
160+
docfx build # Build HTML documentation
161+
162+
# Documentation is generated in the docs/ folder at the repository root
163+
```
164+
165+
The documentation is automatically built and deployed to GitHub Pages when changes are pushed to the `main` branch.
166+
167+
**Local Preview:**
168+
```bash
169+
# Serve documentation locally (with live reload)
170+
cd docfx_project
171+
docfx build --serve
172+
173+
# Open http://localhost:8080 in your browser
174+
```
175+
176+
**Documentation Structure:**
177+
- `docfx_project/` - DocFX configuration and source files
178+
- `docs/` - Generated HTML documentation (published to GitHub Pages)
179+
- `docfx_project/index.md` - Main landing page content
180+
- `docfx_project/docs/` - Additional documentation articles
181+
- `docfx_project/api/` - Auto-generated API reference YAML files
182+
149183
---
150184

151185
## 🤝 Contributing

docfx_project/api/Wolfgang.Extensions.IAsyncEnumerable.IAsyncEnumerableExtensions.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ items:
5454
source:
5555
remote:
5656
path: src/Wolfgang.Extensions.IAsyncEnumerable/IAsyncEnumerableExtensions.cs
57-
branch: copilot/fix-docfx-documentation-build
57+
branch: main
5858
repo: https://github.com/Chris-Wolfgang/IAsyncEnumerable-Extensions
5959
id: ChunkAsync
6060
path: ../src/Wolfgang.Extensions.IAsyncEnumerable/IAsyncEnumerableExtensions.cs

docfx_project/docfx.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
]
3737
}
3838
],
39-
"output": "_site",
39+
"output": "../docs",
4040
"template": [
4141
"default",
4242
"modern",
@@ -50,6 +50,7 @@
5050
"_disableSidebar": false,
5151
"_disableTocFilter": false,
5252
"_enableDarkMode": true,
53+
"_baseUrl": "/IAsyncEnumerable-Extensions/",
5354
"pdf": true
5455
}
5556
}

docs/.gitkeep

Whitespace-only changes.

docs/index.html

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)