Skip to content

Commit f510f0e

Browse files
docs: add mdbook site sourced from existing markdown docs
1 parent 59dfcbf commit f510f0e

9 files changed

Lines changed: 85 additions & 0 deletions

File tree

.github/workflows/docs.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Docs
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- "book/**"
8+
- "README.md"
9+
- "CONTRACT.md"
10+
- "INTEGRATION.md"
11+
- "CONTRIBUTING.md"
12+
- ".github/workflows/docs.yml"
13+
workflow_dispatch:
14+
15+
permissions:
16+
contents: read
17+
pages: write
18+
id-token: write
19+
20+
concurrency:
21+
group: pages
22+
cancel-in-progress: false
23+
24+
jobs:
25+
build:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/checkout@v4
29+
30+
- name: Install mdBook
31+
uses: peaceiris/actions-mdbook@v2
32+
with:
33+
mdbook-version: "latest"
34+
35+
- name: Build book
36+
run: mdbook build book
37+
38+
- uses: actions/configure-pages@v5
39+
40+
- uses: actions/upload-pages-artifact@v3
41+
with:
42+
path: book/book
43+
44+
deploy:
45+
needs: build
46+
runs-on: ubuntu-latest
47+
environment:
48+
name: github-pages
49+
url: ${{ steps.deployment.outputs.page_url }}
50+
steps:
51+
- id: deployment
52+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
/target
2+
/book/book

CONTRIBUTING.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,17 @@ There are two layers, and they catch different things:
7878
a storage key without either handling the "missing" case explicitly or having a
7979
preceding check in the same function that guarantees it exists.
8080

81+
## Docs site
82+
83+
`book/` is an [mdBook](https://rust-lang.github.io/mdBook/) that publishes this
84+
repo's markdown docs as a site, deployed automatically from `main` by
85+
`.github/workflows/docs.yml`. It does not contain its own content: `book/src/*.md`
86+
files are one-line `{{#include}}`s pointing at the real files at the repo root
87+
(`README.md`, `CONTRACT.md`, `INTEGRATION.md`, this file), so there's a single
88+
source of truth. Edit the root file, not the file under `book/src/`.
89+
90+
Preview locally with `mdbook serve book` (requires `cargo install mdbook`).
91+
8192
## Before opening a PR
8293

8394
Run the same checks CI runs, in this order (see the note above on why the wasm

book/book.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[book]
2+
title = "Tholos"
3+
description = "Bonded assertion and dispute oracle for resolving real world outcomes"
4+
authors = ["drydocs"]
5+
language = "en"
6+
src = "src"
7+
8+
[output.html]
9+
git-repository-url = "https://github.com/drydocs/tholos"
10+
edit-url-template = "https://github.com/drydocs/tholos/edit/main/book/{path}"

book/src/CONTRACT.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{{#include ../../CONTRACT.md}}

book/src/CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{{#include ../../CONTRIBUTING.md}}

book/src/INTEGRATION.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{{#include ../../INTEGRATION.md}}

book/src/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{{#include ../../README.md}}

book/src/SUMMARY.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Summary
2+
3+
[Introduction](README.md)
4+
5+
- [Contract Reference](CONTRACT.md)
6+
- [Integration Guide](INTEGRATION.md)
7+
- [Contributing](CONTRIBUTING.md)

0 commit comments

Comments
 (0)