Skip to content

Commit 5e5b449

Browse files
VaclavEliasikpil
authored andcommitted
feat: docfx added with a github workflow
1 parent ee2e5b1 commit 5e5b449

File tree

11 files changed

+279
-1
lines changed

11 files changed

+279
-1
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# More GitHub Actions for Azure: https://github.com/Azure/actions
2+
3+
name: Build Box2D Docs for GitHub Pages
4+
5+
env:
6+
COMMON_SETTINGS_PATH: docs/docfx.json
7+
8+
on:
9+
workflow_dispatch:
10+
11+
jobs:
12+
publish-docs:
13+
runs-on: windows-latest
14+
15+
steps:
16+
- name: .NET SDK Setup
17+
uses: actions/setup-dotnet@v4
18+
with:
19+
dotnet-version: 9.x
20+
21+
- name: Checkout Box2D.NET
22+
uses: actions/checkout@v4
23+
24+
- name: Run Box2D.NET.CommentConverter.csproj
25+
run: dotnet build tools/Box2D.NET.CommentConverter/Box2D.NET.CommentConverter.csproj --configuration Release --no-restore
26+
27+
- name: Install DocFX
28+
# This installs the latest version of DocFX and may introduce breaking changes
29+
# run: dotnet tool update -g docfx
30+
# This installs a specific, tested version of DocFX.
31+
run: dotnet tool update -g docfx --version 2.78.2
32+
33+
- name: Build Box2D.NET API Docs
34+
run: docfx metadata ${{ env.COMMON_SETTINGS_PATH }}
35+
36+
- name: Build Box2D.NET Docs
37+
run: docfx build ${{ env.COMMON_SETTINGS_PATH }}
38+
39+
- name: Deploy
40+
uses: peaceiris/[email protected]
41+
with:
42+
github_token: ${{ secrets.GITHUB_TOKEN }}
43+
publish_dir: docs/_site
44+
publish_branch: gh-pages

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Ignore Visual Studio temporary files, build results, and
1+
## Ignore Visual Studio temporary files, build results, and
22
## files generated by popular Visual Studio add-ons.
33
##
44
## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
@@ -399,3 +399,7 @@ FodyWeavers.xsd
399399
.idea/
400400
imgui.ini
401401
settings.ini
402+
403+
# DocFX API Generated Pages
404+
docs/api/*
405+
docs/_site/*

docs/docfx.json

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/dotnet/docfx/main/schemas/docfx.schema.json",
3+
"metadata": [
4+
{
5+
"src": [
6+
{
7+
"src": "..",
8+
"files": [
9+
"src/Box2D.NET/Box2D.NET.csproj"
10+
]
11+
}
12+
],
13+
"dest": "api"
14+
}
15+
],
16+
"build": {
17+
"content": [
18+
{
19+
"files": [
20+
"**/*.{md,yml}"
21+
],
22+
"exclude": [
23+
"_site/**"
24+
]
25+
}
26+
],
27+
"resource": [
28+
{
29+
"files": [
30+
"favicon.ico",
31+
"favicon.png",
32+
"images/**"
33+
]
34+
}
35+
],
36+
"output": "_site",
37+
"template": [
38+
"default",
39+
"modern",
40+
"template"
41+
],
42+
"fileMetadata": {
43+
"_appTitle": {
44+
"api/**/*.md": "Box2D API",
45+
"api/**/*.yml": "Box2D API"
46+
}
47+
},
48+
"globalMetadata": {
49+
"_appName": "",
50+
"_appTitle": "Box2D Docs",
51+
"_appLogoPath": "images/box2d_logo.svg",
52+
"_enableSearch": true,
53+
"pdf": false,
54+
"_gitContribute": {
55+
"repo": "https://github.com/ikpil/Box2D.NET",
56+
"branch": "master"
57+
},
58+
"_gitUrlPattern": "github",
59+
"_gitRepo": "https://github.com/ikpil/Box2D.NET"
60+
}
61+
}
62+
}

docs/docs/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
_disableToc: false
3+
---
4+
# Box2D.NET Docs

docs/docs/toc.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
- name: 📚 Docs
2+
href: index.md
3+
- name: Original Box2D
4+
href: https://box2d.org/
5+
- name: Overview
6+
href: https://box2d.org/documentation/index.html
7+
- name: FAQ
8+
href: https://box2d.org/documentation/md_faq.html

docs/favicon.ico

9.52 KB
Binary file not shown.

docs/images/box2d_logo.svg

Lines changed: 126 additions & 0 deletions
Loading

docs/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
_disableToc: false
3+
---
4+
[!INCLUDE [readme](../readme.md)]

docs/template/public/main.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/* Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License.txt in the project root for license information. */
2+
3+
.navbar-brand #logo {
4+
height: 56px;
5+
}

docs/template/public/main.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
const app = {
2+
languageDropdownCreated: false,
3+
iconLinks: [
4+
{
5+
icon: 'github',
6+
href: 'https://github.com/ikpil/Box2D.NET',
7+
title: 'GitHub'
8+
},
9+
{
10+
icon: 'discord',
11+
href: 'https://github.com/ikpil/Box2D.NET',
12+
title: 'Discord'
13+
}
14+
]
15+
};
16+
17+
export default app;

0 commit comments

Comments
 (0)