Skip to content

Commit 3d7b898

Browse files
committed
Feat: GHA to publish DocFX documentation
1 parent dcf5464 commit 3d7b898

67 files changed

Lines changed: 1180 additions & 2 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/create-docs.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Create swagger documentation
2+
on:
3+
push:
4+
branches:
5+
- docs
6+
workflow_dispatch:
7+
8+
jobs:
9+
generate:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
15+
- name: Set up Dotnet
16+
uses: actions/setup-dotnet@v3
17+
with:
18+
dotnet-version: 9.x
19+
20+
- name: Set up DocFX
21+
run: dotnet tool update -g docfx
22+
23+
- name: Generate DocFX Site
24+
run: docfx ./Documentation/docfx.json
25+
26+
- name: Upload site Artifacts
27+
id: deployment
28+
uses: actions/upload-pages-artifact@v3
29+
with:
30+
path: ./_site
31+
32+
publish:
33+
permissions:
34+
actions: read
35+
pages: write
36+
id-token: write
37+
environment:
38+
name: github-pages
39+
url: ${{ steps.deployment.outputs.page_url }}
40+
runs-on: ubuntu-latest
41+
needs: generate
42+
steps:
43+
- name: Deploy to GitHub Pages
44+
id: deployment
45+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,9 @@ crashlytics-build.properties
7070

7171
# Temporary auto-generated Android Assets
7272
/[Aa]ssets/[Ss]treamingAssets/aa.meta
73-
/[Aa]ssets/[Ss]treamingAssets/aa/*
73+
/[Aa]ssets/[Ss]treamingAssets/aa/*
74+
75+
# DocFX
76+
.cache
77+
/**/_site/
78+
/**/apidocs
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# ServerConnection
2+
3+
This class manages the connection to a server for synchronizing room state.
4+
5+
## Public Properties
6+
7+
- `hostname`: The hostname of the server.
8+
- `roomId`: The ID of the room.
9+
- `updateToken`: The token used for updating the room state.
10+
- `instance`: A static instance of the ServerConnection class.
11+
12+
## Public Methods
13+
14+
- `void Awake()`
15+
- Ensures there's only one ServerConnection object.
16+
- `void Update()`
17+
18+
## Private Fields
19+
20+
- `lastSync`: Stores the last synchronization time.
21+
- `SYNC_FREQUENCY_MS`: Defines the synchronization frequency in milliseconds.
22+
23+
## Private Methods
24+
25+
- `async Task getAndUseRoomState()`
26+
- Fetches the room state and sets settings and equations appropriately.
27+
- `async Task<Boolean> pushRoomState(ParseTreeNode[] parseTrees, GraphSettings graphSettings)`
28+
- Pushes the equations (token parse trees) and the room settings to the server.

Assets/Scripts/API/ServerConnectionController.md.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# API Response Classes
2+
3+
This file defines the JSON response structures expected from various API endpoints.
4+
5+
## API_Response\<T>
6+
7+
A generic class representing a standard API response.
8+
9+
### Generic Type Parameter
10+
11+
- `T`: The type of the data field.
12+
13+
### Public Fields
14+
15+
- `T data`: The data returned by the API.
16+
- `string error`: An error message, if any.
17+
18+
## API_GET_RoomState
19+
20+
Represents the JSON response for retrieving room state.
21+
22+
### Public Fields
23+
24+
- `RoomInfo_RoomState data`: The room state data.
25+
26+
## API_POST_RoomState
27+
28+
Represents the JSON structure for posting room state.
29+
30+
### Public Fields
31+
32+
- `string key`: The update key.
33+
- `RoomInfo_RoomState roomState`: The room state to be posted.
34+
35+
## API_POST_CreateResult
36+
37+
Represents the JSON response for creating a room.
38+
39+
### Public Fields
40+
41+
- `RoomInfo data`: The room information.
42+
43+
## API_ServerPingResponse
44+
45+
Represents the JSON response for a server ping.
46+
47+
### Public Fields
48+
49+
- `string status`: The server status.
50+
- `int protocolVersion`: The server's protocol version.
51+
52+
## RoomInfo
53+
54+
Represents information about a room.
55+
56+
### Public Fields
57+
58+
- `string roomId`: The room ID.
59+
- `string ownerUpdateToken`: The owner's update token.
60+
- `RoomInfo_RoomState roomState`: The room's state.
61+
62+
## RoomInfo_RoomState
63+
64+
Represents the state of a room.
65+
66+
### Public Fields
67+
68+
- `GraphSettings settings`: The graph settings.
69+
- `ParseTreeNode[] equations`: An array of parse tree nodes representing equations.
70+
71+
## ACCEPTED_PROTOCOL
72+
73+
A static class defining the accepted protocol version.
74+
75+
### Public Constants
76+
77+
- `int VERSION`: The accepted protocol version.

Assets/Scripts/API/VREFServerJSON.md.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Scripts/API/toc.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- name: ServerConnectionController
2+
href: ServerConnectionController.md
3+
- name: VRefServerJSON
4+
href: VRefServerJSON.md

Assets/Scripts/API/toc.yml.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# EquationToken
2+
3+
Represents a token within an equation.
4+
5+
## Public Properties
6+
7+
- `string text`: The text of the token.
8+
- `TokenType type`: The type of the token.
9+
10+
## Public Methods
11+
12+
- `EquationToken(string text, TokenType type)`
13+
- Constructor for the EquationToken class. Initializes the text and type of the token.
14+
- `string ToJSON()`
15+
- Converts the EquationToken to a JSON string representation.

Assets/Scripts/DataStructures/EquationToken.md.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)