Skip to content

Commit f6a4943

Browse files
docs: publish generated documentation site
1 parent 270c72d commit f6a4943

34 files changed

Lines changed: 47456 additions & 159 deletions
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Documentation
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- 'docs/**'
7+
- 'Example Scripts/**'
8+
- 'language_specification.md'
9+
- 'PROJECT_GUIDE.md'
10+
- 'website/**'
11+
- '.github/workflows/documentation.yml'
12+
push:
13+
branches: [main]
14+
paths:
15+
- 'docs/**'
16+
- 'Example Scripts/**'
17+
- 'language_specification.md'
18+
- 'PROJECT_GUIDE.md'
19+
- 'website/**'
20+
- '.github/workflows/documentation.yml'
21+
workflow_dispatch:
22+
23+
permissions:
24+
contents: read
25+
26+
concurrency:
27+
group: documentation-${{ github.ref }}
28+
cancel-in-progress: true
29+
30+
jobs:
31+
build:
32+
runs-on: ubuntu-latest
33+
steps:
34+
- name: Check out repository
35+
uses: actions/checkout@v6
36+
37+
- name: Set up Node.js
38+
uses: actions/setup-node@v6
39+
with:
40+
node-version: 22
41+
cache: npm
42+
cache-dependency-path: |
43+
website/package-lock.json
44+
Tooling/package-lock.json
45+
46+
- name: Install website dependencies
47+
run: npm ci --prefix website
48+
49+
- name: Build the standalone editor
50+
run: |
51+
npm ci --prefix Tooling
52+
node website/scripts/materialize-manifest.mjs
53+
npm run build --prefix Tooling
54+
55+
- name: Build documentation
56+
run: npm run build --prefix website
57+
58+
- name: Upload Pages artifact
59+
if: github.event_name != 'pull_request'
60+
uses: actions/upload-pages-artifact@v4
61+
with:
62+
path: website/build
63+
64+
deploy:
65+
if: github.event_name != 'pull_request'
66+
needs: build
67+
runs-on: ubuntu-latest
68+
permissions:
69+
pages: write
70+
id-token: write
71+
environment:
72+
name: github-pages
73+
url: ${{ steps.deployment.outputs.page_url }}
74+
steps:
75+
- name: Deploy GitHub Pages
76+
id: deployment
77+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,11 @@ SER.sln.DotSettings.user
1212
/Tooling/node_modules
1313
/Tooling/visual-editor/dist
1414
/artifacts
15+
/website/node_modules
16+
/website/.docusaurus
17+
/website/build
18+
/website/.site-docs
19+
/website/src/data/constructs.json
20+
/website/static/assets
21+
/website/static/ser-blocks
22+
/website/static/img

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,17 @@ All you need to get started is a text editor and a server!
1717
# Nice-to-Haves of SER
1818
- **Simplification** of the most essential features like commands, events, and player management.
1919
- **No compilation required**, while C# plugins require a full development environment, compilation, and DLL management.
20-
- **Lots of built-in features** like AudioPlayer, Databases, Discord webhooks, HTTP, and more!
21-
- **Extendable** with integrations such as UCR, EXILED, Callvote, and ProjectMER.
22-
The LabAPI build discovers each integration only when it is installed, so
23-
optional frameworks do not become base dependencies or interfere with one another.
20+
- **Lots of built-in features** like custom roles, audio, map editor, databases, Discord webhooks, HTTP, and more!
21+
- **Extendable** with integrations such as UCR, EXILED, Callvote, and ProjectMER,
22+
but only when you need it - no unnecessary dependencies!
2423
- **Plugin docs** are available directly on the server using the `serhelp` command.
2524
- **Helpful community** available to help you with any questions you may have.
2625

2726
# SER Tutorials
2827

29-
The 1.0 tutorials are versioned with the plugin:
28+
Want to make something useful before studying the language? Follow the
29+
outcome-first tutorial. Need an exact rule or edge case? Jump to the technical
30+
reference. Both are versioned with the plugin:
3031

3132
> [SER 1.0 documentation](./docs/README.md)
3233
@@ -93,7 +94,7 @@ before execution, whether requested by `serrun`, an event, a callback, or anothe
9394
script. Use the permission-protected `serreload` command to refresh everything on
9495
demand, especially when adding or removing bindings that cannot trigger yet. Reloads
9596
are transactional: a changed file is compiled in full before its flags are replaced,
96-
and if validation fails the last known-good version stays active.
97+
and if validation fails, the last known-good version stays active.
9798

9899
```ser
99100
!-- OnEvent RoundStarted
@@ -104,7 +105,7 @@ Print "A player died"
104105
105106
!-- CustomCommand status
106107
-- requireSender
107-
Reply "Online"
108+
Reply "Hello {@sender -> name}! The server is online"
108109
```
109110

110111
ProjectMER integrations can use the dedicated optional event entry point:
@@ -120,6 +121,7 @@ MER.PlayAnimation *evSchematic "Open"
120121
### Welcome message
121122
```
122123
!-- OnEvent Joined
124+
-- require @evPlayer
123125
124126
Broadcast @evPlayer 10s "Welcome to the server {@evPlayer -> name}!"
125127
```

Tooling/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ The build:
2626
4. copies the shared language core and extension source into `out`;
2727
5. copies the repository license and third-party notices into the extension.
2828

29-
`npm run verify` also checks generated-file synchronization, all 16 local
29+
`npm run verify` also checks generated-file synchronization, all local
3030
documentation files, JavaScript behavior, third-party notice coverage, and
3131
whether C# method implementations read every argument they declare (without
3232
reading undeclared names).

Tooling/scripts/build.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const paths = {
2222
core: path.join(toolingDirectory, "shared", "ser-language-core.js"),
2323
blockly: path.join(toolingDirectory, "node_modules", "blockly", "blockly.min.js"),
2424
blocklyMedia: path.join(toolingDirectory, "node_modules", "blockly", "media"),
25+
websiteManifest: path.join(repositoryDirectory, "website", "data", "ser-truth-table.json"),
2526
extensionSource: path.join(extensionSourceDirectory, "extension.js"),
2627
extensionEditorLogic: path.join(extensionSourceDirectory, "ser-editor-logic.js")
2728
};
@@ -70,6 +71,7 @@ fs.writeFileSync(path.join(extensionOutputDirectory, "ser-language-core.js"), co
7071
fs.writeFileSync(path.join(extensionOutputDirectory, "ser_method_info.js"), manifestModuleSource(manifest));
7172
fs.writeFileSync(path.join(extensionOutputDirectory, "visual-editor.html"), extensionHtml);
7273
fs.writeFileSync(path.join(extensionOutputDirectory, "ser-language.json"), manifestJson);
74+
fs.writeFileSync(paths.websiteManifest, manifestJson);
7375
fs.copyFileSync(paths.license, path.join(extensionDirectory, "LICENSE"));
7476
fs.copyFileSync(
7577
paths.thirdPartyLicenses,

Tooling/scripts/check.mjs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ const files = {
2222
thirdPartyLicenses: path.join(repositoryDirectory, "THIRD_PARTY_LICENSES.txt"),
2323
extensionThirdPartyLicenses: path.join(extensionDirectory, "THIRD_PARTY_LICENSES.txt"),
2424
manifest: path.join(repositoryDirectory, "ser_method_info.js"),
25-
extensionManifest: path.join(extensionDirectory, "out", "ser_method_info.js")
25+
extensionManifest: path.join(extensionDirectory, "out", "ser_method_info.js"),
26+
websiteManifest: path.join(repositoryDirectory, "website", "data", "ser-truth-table.json")
2627
};
2728

2829
for (const [name, filename] of Object.entries(files)) {
@@ -44,6 +45,11 @@ for (const filename of [
4445
const manifest = readGeneratedManifest(files.manifest);
4546
const extensionManifest = readGeneratedManifest(files.extensionManifest);
4647
assert.deepEqual(extensionManifest, manifest, "The extension manifest is out of sync with SER.");
48+
assert.deepEqual(
49+
JSON.parse(fs.readFileSync(files.websiteManifest, "utf8")),
50+
manifest,
51+
"The documentation website manifest is out of sync with SER."
52+
);
4753
assert.ok(Object.keys(manifest.methods).length > 0, "The manifest contains no methods.");
4854
assert.ok(
4955
Object.values(manifest.methods).some(method => method.requiredFramework),

docs/README.md

Lines changed: 48 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,46 @@
1-
# SER 1.0 documentation
2-
3-
This directory is the canonical user documentation for Scripted Events
4-
Reloaded 1.0. It lives beside the implementation so a
5-
change to syntax, commands, examples, or tooling can update the matching
6-
tutorial in the same pull request.
7-
8-
Start here:
9-
10-
1. [Install SER](getting-started/installation.md)
11-
2. [Create and run your first script](getting-started/first-script.md)
12-
3. [Understand files, names, and reloads](getting-started/files-and-reloads.md)
13-
4. [Learn methods and values](language/methods-and-values.md)
14-
5. [Learn variables and properties](language/variables-and-properties.md)
15-
6. [Add conditions and loops](language/conditions-and-loops.md)
16-
7. [Work with collections](language/collections.md)
17-
8. [Pause and resume execution safely](language/timing-and-yielding.md)
18-
9. [Connect scripts to commands and events](guides/flags-events-and-commands.md)
19-
10. [Organize larger scripts](language/functions-scopes-and-errors.md)
20-
11. [Debug a script](guides/debugging.md)
21-
22-
For complete examples that are compiled during every build, see the
23-
[example index](guides/examples.md). Experienced authors can use the compact
24-
[language specification](../language_specification.md).
1+
# Make your server do something new
2+
3+
SER is a programming language, but you do not need to study a programming
4+
language before you can enjoy it. Start with one method, turn it into a player
5+
command or game event, and watch the server change. Learn variables and control
6+
flow later, when a script you actually want to build needs them.
7+
8+
These docs therefore have two different reading paths.
9+
10+
## Tutorial: build first, learn as you need it
11+
12+
Follow this path in order if SER is new to you:
13+
14+
1. [Install SER and generate its examples](getting-started/installation.md)
15+
2. [Make the server say something](getting-started/first-script.md)
16+
3. [Discover methods that change the game](tutorial/methods.md)
17+
4. [Make a command or react to an event](tutorial/flags.md)
18+
5. [Choose which players are affected](tutorial/player-targets.md)
19+
6. [Remember values and inspect players](tutorial/variables-and-properties.md)
20+
7. [Add decisions, chance, and timing](tutorial/decisions-and-time.md)
21+
8. [Build a Hot Potato event](tutorial/hot-potato.md)
22+
23+
You will make useful scripts before the tutorial introduces loops, collections,
24+
functions, or memory lifetimes. That is intentional.
25+
26+
## Reference: find the exact rule
27+
28+
Use the reference when you need a complete or technical answer:
29+
30+
- [script files, identity, and reload behavior](getting-started/files-and-reloads.md);
31+
- [methods, values, expressions, and return types](language/methods-and-values.md);
32+
- [variable families and properties](language/variables-and-properties.md);
33+
- [conditions and loops](language/conditions-and-loops.md);
34+
- [collections](language/collections.md);
35+
- [timing and yielding](language/timing-and-yielding.md);
36+
- [functions, variable visibility and lifetime, and errors](language/functions-scopes-and-errors.md);
37+
- [flags, events, and commands](guides/flags-events-and-commands.md);
38+
- [optional integrations](guides/integrations.md);
39+
- [debugging](guides/debugging.md).
40+
41+
The compact [language specification](../language_specification.md) is for
42+
experienced authors and tool builders. The [validated example index](guides/examples.md)
43+
points to complete scripts that compile during every SER build.
2544

2645
## Documentation boundaries
2746

@@ -36,9 +55,11 @@ For complete examples that are compiled during every build, see the
3655

3756
## Contributing
3857

39-
Keep tutorials task-oriented. A beginner should know what a command changes,
40-
what they should see after running it, and which diagnostic command to use when
41-
the result differs.
58+
Keep the tutorial outcome-oriented and the reference precise. A tutorial page
59+
should begin with something worth adding to a server, introduce only the
60+
language features needed to build it, show the expected result, and then offer
61+
one safe experiment. Put exhaustive behavior and implementation-shaped edge
62+
cases in the reference instead of interrupting the first learning path.
4263

4364
When changing the language or user workflow:
4465

docs/SUMMARY.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
11
# Table of contents
22

3-
- [Documentation home](README.md)
4-
- Getting started
5-
- [Installation](getting-started/installation.md)
6-
- [First script](getting-started/first-script.md)
7-
- [Files and reloads](getting-started/files-and-reloads.md)
8-
- Language
3+
- [Start here](README.md)
4+
- Tutorial: make something
5+
- [Install and verify SER](getting-started/installation.md)
6+
- [Make the server say something](getting-started/first-script.md)
7+
- [Methods change the game](tutorial/methods.md)
8+
- [Commands and events with flags](tutorial/flags.md)
9+
- [Choose your players](tutorial/player-targets.md)
10+
- [Remember and inspect values](tutorial/variables-and-properties.md)
11+
- [Decisions, chance, and timing](tutorial/decisions-and-time.md)
12+
- [Build Hot Potato](tutorial/hot-potato.md)
13+
- Reference: exact behavior
14+
- [Files, names, and reloads](getting-started/files-and-reloads.md)
915
- [Methods and values](language/methods-and-values.md)
1016
- [Variables and properties](language/variables-and-properties.md)
1117
- [Conditions and loops](language/conditions-and-loops.md)
1218
- [Collections](language/collections.md)
1319
- [Timing and yielding](language/timing-and-yielding.md)
14-
- [Functions, scopes, and errors](language/functions-scopes-and-errors.md)
15-
- Guides
1620
- [Flags, events, and commands](guides/flags-events-and-commands.md)
21+
- [Functions, lifetimes, and errors](language/functions-scopes-and-errors.md)
1722
- [Optional integrations](guides/integrations.md)
1823
- [Debugging](guides/debugging.md)
1924
- [Validated examples](guides/examples.md)

0 commit comments

Comments
 (0)