Skip to content

Commit 931f824

Browse files
committed
chore: documentation
1 parent 4d2591d commit 931f824

23 files changed

Lines changed: 909 additions & 164 deletions

.github/workflows/docs.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: Docs
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
paths:
7+
- 'docs/**'
8+
- '.github/workflows/docs.yml'
9+
pull_request:
10+
branches: [ main ]
11+
paths:
12+
- 'docs/**'
13+
- '.github/workflows/docs.yml'
14+
workflow_dispatch:
15+
16+
permissions:
17+
contents: read
18+
pages: write
19+
id-token: write
20+
21+
concurrency:
22+
group: pages
23+
cancel-in-progress: false
24+
25+
jobs:
26+
build:
27+
runs-on: ubuntu-latest
28+
outputs:
29+
pages_enabled: ${{ steps.pages.outputs.enabled }}
30+
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v5
34+
35+
- name: Setup mdBook
36+
uses: peaceiris/actions-mdbook@v2
37+
with:
38+
mdbook-version: latest
39+
40+
- name: Build docs
41+
run: mdbook build docs
42+
43+
- name: Check Pages status
44+
if: github.event_name == 'push'
45+
id: pages
46+
uses: actions/github-script@v7
47+
with:
48+
script: |
49+
try {
50+
await github.rest.repos.getPages({
51+
owner: context.repo.owner,
52+
repo: context.repo.repo,
53+
});
54+
core.setOutput('enabled', 'true');
55+
} catch (error) {
56+
if (error.status === 404) {
57+
core.notice('GitHub Pages is not enabled. Enable it in Settings -> Pages with Source set to GitHub Actions, then rerun this workflow.');
58+
core.setOutput('enabled', 'false');
59+
} else {
60+
throw error;
61+
}
62+
}
63+
64+
- name: Setup Pages
65+
if: github.event_name == 'push' && steps.pages.outputs.enabled == 'true'
66+
uses: actions/configure-pages@v5
67+
68+
- name: Upload Pages artifact
69+
if: github.event_name == 'push' && steps.pages.outputs.enabled == 'true'
70+
uses: actions/upload-pages-artifact@v3
71+
with:
72+
path: docs/book
73+
74+
deploy:
75+
if: github.event_name == 'push' && needs.build.outputs.pages_enabled == 'true'
76+
needs: build
77+
runs-on: ubuntu-latest
78+
environment:
79+
name: github-pages
80+
url: ${{ steps.deployment.outputs.page_url }}
81+
82+
steps:
83+
- name: Deploy to GitHub Pages
84+
id: deployment
85+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,9 @@ x64
33
*.vcxproj.*
44
RivetDoorstop.ini
55
vcpkg_installed
6-
.idea
6+
.idea
7+
.scratch/
8+
.cargo/
9+
.tools/
10+
docs/book/
11+
docs/*.log

README.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,23 @@
11
# Rivet
22

3-
Rivet is a modding toolkit for Scrap Mechanic. It gives you a clean way to inject DLLs into the game process and to load mods in a structured, discoverable way.
3+
Rivet is a native modding toolkit for Scrap Mechanic. It injects a loader into the game process, loads mod DLLs from a configured directory, and gives mods shared event and hook APIs so they can coordinate without overwriting each other.
44

5-
At a high level Rivet consists of:
5+
Rivet consists of:
66

7-
- `RivetDoorstop`: gets a DLL into the game as early as possible using DLL hijacking. You can imagine this alike to [Unity Doorstop](https://github.com/NeighTools/UnityDoorstop).
8-
- `RivetLoader`: discovers and loads mods, using metadata and interfaces where available. You can imagine this like [BepInEx](https://github.com/BepInEx/BepInEx).
9-
- `RivetLib`: the library that mods use to integrate with Rivet, similar in spirit to how BepInEx and Harmony are used for Unity. You can imagine this like [BepInEx's API](https://docs.bepinex.dev/api/index.html) and [Harmony](https://github.com/pardeike/Harmony).
7+
- `RivetDoorstop`: a `version.dll` proxy that loads Rivet into the game process.
8+
- `RivetLoader`: the runtime loader that discovers mods, owns hooks, and dispatches events.
9+
- `RivetLib`: the public headers mods include to use Rivet APIs.
1010

11-
If you just want to get started, the [Installation Guide](./docs/installation.md) walks through setting up Rivet for a game, and the [Overview](./docs/overview.md) explains how these pieces fit together.
11+
Documentation lives in [`docs/`](./docs/src/introduction.md), is built with mdBook, and publishes to GitHub Pages.
1212

1313
> [!WARNING]
1414
> Currently under heavy development, not ready for real use.
1515
16-
> [!NOTE]
17-
> Please refer to the [Installation Guide](./docs/installation.md) to set up Rivet for Scrap Mechanic. There is also an [Overview](./docs/overview.md) document that explains how Rivet works and what each component does.
18-
1916
## Thanks
2017

2118
This project would not exist without the help and feedback of many people.
2219

2320
- [@VeraDev0](https://github.com/VeraDev0): For contributing to the repository and helping development
2421
- [@QuestionableM](https://github.com/QuestionableM): For helping with proxying knowledge (e.g. for prompting me to look into asm thunks for proxying DLL exports).
2522
- [@crackx02](https://github.com/crackx02): For helping debug various issues with the DLL loading process.
26-
- Everyone in the [@ReDoIngMods](https://github.com/ReDoIngMods) organization for ideas, testing, and general support.
23+
- Everyone in the [@ReDoIngMods](https://github.com/ReDoIngMods) organization for ideas, testing, and general support.

docs/book.toml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[book]
2+
title = "Rivet"
3+
description = "A modding framework"
4+
authors = ["Ben McAvoy"]
5+
language = "en"
6+
src = "src"
7+
8+
[output.html]
9+
default-theme = "navy"
10+
preferred-dark-theme = "navy"
11+
git-repository-url = "https://github.com/ReDoIngMods/Rivet"
12+
edit-url-template = "https://github.com/ReDoIngMods/Rivet/edit/main/docs/src/{path}"
13+
no-section-label = true
14+
15+
[output.html.fold]
16+
enable = true
17+
level = 1
18+
19+
[output.html.search]
20+
enable = true
21+
limit-results = 30
22+
use-boolean-and = true
23+
boost-title = 2
24+
boost-hierarchy = 1
25+
boost-paragraph = 1
26+
expand = true
27+
heading-split-level = 3

docs/config.md

Lines changed: 0 additions & 104 deletions
This file was deleted.

docs/installation.md

Lines changed: 0 additions & 13 deletions
This file was deleted.

docs/overview.md

Lines changed: 0 additions & 24 deletions
This file was deleted.

docs/src/SUMMARY.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Summary
2+
3+
[Introduction](introduction.md)
4+
5+
# Getting Started
6+
7+
- [Installation](getting-started/installation.md)
8+
- [Writing Your First Mod](getting-started/writing-your-first-mod.md)
9+
10+
# Guides
11+
12+
- [The Event System](guides/events.md)
13+
- [The Hook System](guides/hooks.md)
14+
- [Mod Lifecycle](guides/mod-lifecycle.md)
15+
16+
# Reference
17+
18+
- [Built-in Events](reference/built-in-events.md)
19+
- [Configuration](reference/configuration.md)
20+
- [Versioning](reference/versioning.md)
21+
22+
# Internals
23+
24+
- [Architecture](internals/architecture.md)
25+
- [The Loader](internals/loader.md)
26+
- [Doorstop](internals/doorstop.md)
27+
- [Cross-DLL Type Identity](internals/type-identity.md)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Installation
2+
3+
This page is for end users who want to play modded games. If you are writing a mod, see [Writing Your First Mod](writing-your-first-mod.md).
4+
5+
## Steps
6+
7+
1. **Download Rivet.** Grab the latest release from the [releases page](https://github.com/ReDoIngMods/Rivet/releases) (e.g. `Rivet_0.1.0-alpha.zip`).
8+
2. **Extract the archive** to a temporary location.
9+
3. **Copy the files into your game's directory.** This is the folder containing the game's `.exe`. In Steam you can find it via *right-click the game in your library -> Properties -> Installed Files -> Browse*.
10+
4. **Launch the game.** Rivet will automatically create a `Rivet.ini` file in the game directory on first run.
11+
5. **(Optional) Configure Rivet** by editing `Rivet.ini` or by passing CLI flags. See [Configuration](../reference/configuration.md) for the full list of options.
12+
13+
## Verifying it worked
14+
15+
When Rivet starts, it opens a console window logging the loader status and any mods that were found. If the console does not appear, check that:
16+
17+
- The game directory contains both `version.dll` (Doorstop) and `Rivet.dll` (the loader).
18+
- `Doorstop.enable=true` is set in `Rivet.ini`, or `-rivetEnable` is passed on the command line.
19+
- No antivirus is quarantining the DLLs (Rivet's hooking can look suspicious to some scanners).
20+
21+
## Updating
22+
23+
To update, replace the Rivet files in the game directory with the new release. Your `Rivet.ini` and the `Mods` directory are not touched.

0 commit comments

Comments
 (0)