Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate Github Pages from the XML Documentation #559

Merged
merged 7 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/generate-doc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: C# API XML Documentation To Github Pages

on:
push:
branches:
- master
workflow_dispatch:

jobs:
publish-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

- name: Build
run: dotnet build -c Release

- name: Build Documentation
uses: nunit/docfx-action@v3.4.2
with:
args: docs/docfx.json

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_site
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
release_legacy_package:
description: 'Release legacy package'
required: true
default: 'false'
default: false
type: boolean

jobs:
Expand Down
2 changes: 1 addition & 1 deletion R2API.Items/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Finally, ItemAPI includes the ability to add new ItemTags to the game, which can

## Related Pages

A detailed tutorial on how to make custom items using ItewmAPI can be found [here](https://risk-of-thunder.github.io/R2Wiki/Mod-Creation/Assets/Items/)
A detailed tutorial on how to make custom items using ItemAPI can be found [here](https://risk-of-thunder.github.io/R2Wiki/Mod-Creation/Assets/Items/)

## Changelog

Expand Down
2 changes: 1 addition & 1 deletion R2API.Networking/NetworkingAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace R2API.Networking;
// ReSharper disable once InconsistentNaming
/// <summary>
/// Allow easy sending of custom networked messages, check
/// <see href="https://github.com/risk-of-thunder/R2Wiki/wiki/Networking-with-R2API.NetworkingAPI-(INetMessage)">
/// <see href="https://risk-of-thunder.github.io/R2Wiki/Mod-Creation/C%23-Programming/Networking/R2API.NetworkingAPI/">
/// the tutorial for example usage.</see>
/// </summary>
#pragma warning disable CS0436 // Type conflicts with imported type
Expand Down
5 changes: 5 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
api/*.yml
gh-pages
dist_pdf
api/R2API.*
dist/
5 changes: 5 additions & 0 deletions docs/api/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
###############
# temp file #
###############
*.yml
.manifest
7 changes: 7 additions & 0 deletions docs/api/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# R2API C# API Documentation

Welcome to the R2API C# API Documentation.

This documentation was built from XML Docs in the C# code. Any updates or changes should be made there and submitted as a Pull Request to the project.

Further documentation, guides and examples may be found in the [modding wiki](https://risk-of-thunder.github.io/R2Wiki/) and the respective R2API submodules README files
80 changes: 80 additions & 0 deletions docs/docfx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{
"metadata": [
{
"src": [
{
"src": "..",
"files": [
"**/*.csproj"
],
"exclude": [
"**/obj/**",
"**/bin/**",
"_site/**",
"BuildCI/**",
"R2API.AutoVersionGen/**",
"R2API.Analyzer/**"
]
}
],
"dest": "api",
"disableGitFeatures": false,
"properties": {
"TargetFramework": "netstandard2.1"
}
}
],
"build": {
"content": [
{
"files": [
"api/**.yml",
"api/index.md"
]
},
{
"files": [
"*.md",
"toc.yml"
]
}
],
"resource": [
{
"files": [
"images/**",
"**/images/**"
],
"exclude": [
"obj/**",
"_site/**"
]
}
],
"overwrite": [
{
"files": [
"apidoc/**.md"
],
"exclude": [
"obj/**",
"_site/**"
]
}
],
"dest": "_site",
"globalMetadataFiles": [],
"fileMetadataFiles": [],
"template": [
"default"
],
"postProcessors": [],
"noLangKeyword": false,
"keepFileLink": false,
"cleanupCacheHistory": false,
"disableGitFeatures": true,
"xref": [
"https://docs.microsoft.com/dotnet/xrefmap.yml"
]
}
}
7 changes: 7 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# R2API C# API Documentation

This site contains the [API Documentation for R2API](/R2API/api/).

This documentation was built from XML Docs in the C# code. Any updates or changes should be made there and submitted as a Pull Request to the project.

Further documentation, guides and examples may be found in the [modding wiki](https://risk-of-thunder.github.io/R2Wiki/) and the respective R2API submodules README files
2 changes: 2 additions & 0 deletions docs/toc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- name: API Documentation
href: /R2API/api/
Loading