Skip to content

Commit e739307

Browse files
deallocsreece52
authored andcommitted
DocFX documentation (helldivers-2#52)
* setup DocFX install DocFX and setup docfx.json move OpenAPI specs to docfx files * disable file serve as wwwroot is empty
1 parent a2db2ba commit e739307

File tree

15 files changed

+96
-2708
lines changed

15 files changed

+96
-2708
lines changed

.github/workflows/pages.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,28 +30,32 @@ jobs:
3030
uses: actions/setup-dotnet@v4
3131
with:
3232
dotnet-version: 8.0.x
33+
- name: Install DocFX
34+
run: dotnet tool install -g docfx
3335
- name: Initial static JSON schema submodule
3436
run: git submodule update --init ./src/Helldivers-2-Models/json
3537
- name: Generate OpenAPI JSON files
3638
run: dotnet build -c Debug
37-
- name: Rename Swagger HTML file to index
38-
run: mv src/Helldivers-2-API/wwwroot/swagger-ui.html src/Helldivers-2-API/wwwroot/index.html
39-
- name: Upload OpenAPI artifact
39+
- name: Generate DocFX metadata
40+
run: docfx metadata
41+
- name: Generate DocFX site
42+
run: docfx build docfx.json
43+
- name: Upload DocFX website
4044
uses: actions/upload-artifact@master
4145
with:
42-
name: 'OpenAPI-artifact'
43-
path: './src/Helldivers-2-API/wwwroot'
46+
name: 'docfx'
47+
path: './_site/'
4448
deploy:
4549
needs: build
4650
environment:
4751
name: github-pages
4852
url: ${{ steps.deployment.outputs.page_url }}
4953
runs-on: ubuntu-latest
5054
steps:
51-
- name: Download generated OpenAPI files
55+
- name: Download DocFX website
5256
uses: actions/download-artifact@master
5357
with:
54-
name: 'OpenAPI-artifact'
58+
name: 'docfx'
5559
path: '.'
5660
- name: Setup Pages
5761
uses: actions/configure-pages@v4

.gitignore

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,4 +363,11 @@ MigrationBackup/
363363
FodyWeavers.xsd
364364

365365
# Jetbrains generated folders
366-
.idea/
366+
.idea/
367+
368+
# DocFX generates files
369+
_site/
370+
api/
371+
372+
# Ignore OpenAPI documents
373+
docs/openapi/*.json

Helldivers-2.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1313
Directory.Build.props = Directory.Build.props
1414
fly.toml = fly.toml
1515
.dockerignore = .dockerignore
16+
docfx.json = docfx.json
1617
EndProjectSection
1718
EndProject
1819
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Helldivers-2-Models", "src\Helldivers-2-Models\Helldivers-2-Models.csproj", "{9B017849-C756-4B98-9B98-885AEBE9EAD4}"

docfx.json

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"metadata": [
3+
{
4+
"src": [
5+
{
6+
"files": [
7+
"**/*.csproj"
8+
]
9+
}
10+
],
11+
"dest": "api"
12+
}
13+
],
14+
"build": {
15+
"content": [
16+
{
17+
"files": [
18+
"**/*.{md,yml}"
19+
],
20+
"exclude": [
21+
"_site/**",
22+
"src/Helldivers-2-Models/json/**"
23+
]
24+
}
25+
],
26+
"resource": [
27+
{
28+
"files": [
29+
"images/**",
30+
"docs/openapi/**"
31+
]
32+
}
33+
],
34+
"output": "_site",
35+
"template": [
36+
"default",
37+
"modern"
38+
],
39+
"globalMetadata": {
40+
"_appName": "Helldivers-2 API",
41+
"_appTitle": "Helldivers-2 API",
42+
"_enableSearch": true,
43+
"pdf": false
44+
}
45+
}
46+
}

docs/getting-started.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Getting Started

docs/introduction.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Introduction
File renamed without changes.

docs/toc.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
- name: Introduction
2+
href: introduction.md
3+
- name: Getting Started
4+
href: getting-started.md
5+
- name: SwaggerUI
6+
href: ./openapi/swagger-ui.html
7+
- name: Contributing
8+
href: ../contributing.md
9+
- name: Code of conduct
10+
href: ../CODE_OF_CONDUCT.md
11+
- name: Reporting vulnerabilities
12+
href: ../SECURITY.md

index.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
_layout: landing
3+
---
4+
5+
# This is the **HOMEPAGE**.
6+
7+
Refer to [Markdown](http://daringfireball.net/projects/markdown/) for how to write markdown files.
8+
9+
## Quick Start Notes:
10+
11+
1. Add images to the *images* folder if the file is referencing an image.

0 commit comments

Comments
 (0)