Skip to content

Commit 76a96fa

Browse files
committed
add reference doc generation
1 parent a383ae4 commit 76a96fa

File tree

6 files changed

+135
-0
lines changed

6 files changed

+135
-0
lines changed

.github/workflows/docs.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Deploy Documentation
2+
3+
on:
4+
push:
5+
branches: [master, develop]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: pages
15+
cancel-in-progress: false
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
24+
- name: Setup .NET
25+
uses: actions/setup-dotnet@v4
26+
with:
27+
dotnet-version: 8.0.x
28+
29+
- name: Install DocFX
30+
run: dotnet tool install -g docfx
31+
32+
- name: Build Documentation
33+
run: |
34+
cp README.md docs/index.md
35+
docfx docs/docfx.json
36+
37+
- name: Upload artifact
38+
uses: actions/upload-pages-artifact@v3
39+
with:
40+
path: docs/_site
41+
42+
deploy:
43+
environment:
44+
name: github-pages
45+
url: ${{ steps.deployment.outputs.page_url }}
46+
runs-on: ubuntu-latest
47+
needs: build
48+
steps:
49+
- name: Deploy to GitHub Pages
50+
id: deployment
51+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,3 +330,8 @@ ASALocalRun/
330330
.mfractor/
331331
coverage
332332
CoverageReport
333+
334+
# DocFX
335+
docs/_site/
336+
docs/api/
337+
docs/index.md

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ See the [examples project](Secp256k1.Net.Examples/) for more complete working ex
5656

5757
## API Reference
5858

59+
**[Full API Documentation](https://zone117x.github.io/Secp256k1.Net/api/Secp256k1Net.Secp256k1.html)**
60+
5961
The `Secp256k1` class exposes static functions that are idiomatic C#, using a thread-safe internal context:
6062

6163
#### Key Generation & Validation

docs/build.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
set -e
3+
4+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
5+
ROOT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
6+
7+
# Check if docfx is installed
8+
if ! command -v docfx &> /dev/null; then
9+
echo "DocFX not found. Installing..."
10+
dotnet tool install -g docfx
11+
fi
12+
13+
cd "$SCRIPT_DIR"
14+
15+
# Copy README.md as index.md
16+
cp "$ROOT_DIR/README.md" "$SCRIPT_DIR/index.md"
17+
18+
# Build the documentation
19+
docfx docfx.json "$@"
20+
21+
echo ""
22+
echo "Documentation built successfully in docs/_site/"
23+
echo "To preview, run: ./docs/build.sh --serve"

docs/docfx.json

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/dotnet/docfx/main/schemas/docfx.schema.json",
3+
"metadata": [
4+
{
5+
"src": [
6+
{
7+
"files": ["Secp256k1.Net/Secp256k1.Net.csproj"],
8+
"src": ".."
9+
}
10+
],
11+
"dest": "api",
12+
"includePrivateMembers": false,
13+
"disableGitFeatures": false,
14+
"disableDefaultFilter": false,
15+
"properties": {
16+
"TargetFramework": "net8.0"
17+
}
18+
}
19+
],
20+
"build": {
21+
"content": [
22+
{
23+
"files": ["api/**.yml", "api/index.md"]
24+
},
25+
{
26+
"files": ["toc.yml", "index.md"]
27+
}
28+
],
29+
"resource": [
30+
{
31+
"files": ["images/**"]
32+
}
33+
],
34+
"output": "_site",
35+
"template": ["default", "modern"],
36+
"globalMetadata": {
37+
"_appTitle": "Secp256k1.Net",
38+
"_appName": "Secp256k1.Net",
39+
"_appFooter": "Secp256k1.Net - Cross-platform .NET wrapper for bitcoin-core/secp256k1",
40+
"_enableSearch": true,
41+
"_enableNewTab": true
42+
},
43+
"fileMetadata": {},
44+
"postProcessors": [],
45+
"keepFileLink": false,
46+
"disableGitFeatures": false
47+
}
48+
}

docs/toc.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
- name: Home
2+
href: index.md
3+
- name: API Reference
4+
href: api/
5+
- name: GitHub
6+
href: https://github.com/zone117x/Secp256k1.Net

0 commit comments

Comments
 (0)