Skip to content

Commit 6b5d8f6

Browse files
committed
Rework documentation
Signed-off-by: Yuki Kishimoto <yukikishimoto@protonmail.com>
1 parent 9e57ecb commit 6b5d8f6

233 files changed

Lines changed: 4303 additions & 8846 deletions

File tree

Some content is hidden

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

.github/workflows/ci.yml

Lines changed: 64 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -2,104 +2,112 @@ name: CI
22

33
on:
44
push:
5-
branches: [ master ]
5+
branches: [master]
66
pull_request:
7-
branches: [ master ]
7+
branches: [master]
88

9-
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
109
permissions:
1110
contents: read
12-
pages: write
13-
id-token: write
14-
15-
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
16-
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
17-
concurrency:
18-
group: "pages"
19-
cancel-in-progress: false
2011

2112
jobs:
2213
check-book:
2314
runs-on: ubuntu-latest
2415
steps:
2516
- name: Checkout
26-
uses: actions/checkout@v4
17+
uses: actions/checkout@v7
2718

2819
- name: Setup just
2920
uses: extractions/setup-just@v3
3021

31-
- name: Rust Cache
32-
uses: Swatinem/rust-cache@v2.7.8
22+
- name: Cache Rust tools
23+
uses: Swatinem/rust-cache@v2.9.1
3324

34-
- name: Check
25+
- name: Build book and check links
3526
run: just build
3627

37-
- name: Upload built book
38-
uses: actions/upload-artifact@v4
28+
- name: Upload Pages artifact
29+
if: github.event_name == 'push'
30+
uses: actions/upload-pages-artifact@v4
3931
with:
40-
name: built-book
41-
path: ./output/html
32+
path: output/html
4233

4334
check-rust:
4435
runs-on: ubuntu-latest
4536
steps:
4637
- name: Checkout
47-
uses: actions/checkout@v4
38+
uses: actions/checkout@v7
4839

49-
- name: Rust Cache
50-
uses: Swatinem/rust-cache@v2.7.8
40+
- name: Cache Rust dependencies
41+
uses: Swatinem/rust-cache@v2.9.1
42+
with:
43+
workspaces: snippets/rust
5144

5245
- name: Check
5346
working-directory: snippets/rust
54-
run: cargo build
47+
run: cargo check --all-targets
5548

5649
check-python:
5750
runs-on: ubuntu-latest
5851
steps:
5952
- name: Checkout
60-
uses: actions/checkout@v4
53+
uses: actions/checkout@v7
6154

6255
- name: Setup Python
63-
uses: actions/setup-python@v4
56+
uses: actions/setup-python@v6
6457
with:
65-
python-version: "3.12"
58+
python-version: '3.12'
59+
cache: pip
60+
cache-dependency-path: snippets/python/requirements.txt
6661

6762
- name: Check
6863
working-directory: snippets/python
6964
run: bash check.sh
7065

7166
check-js:
7267
runs-on: ubuntu-latest
68+
strategy:
69+
fail-fast: false
70+
matrix:
71+
runtime: [node, web, react-native]
7372
steps:
7473
- name: Checkout
75-
uses: actions/checkout@v4
74+
uses: actions/checkout@v7
75+
76+
- name: Setup Node.js
77+
uses: actions/setup-node@v7
78+
with:
79+
node-version: '22'
80+
81+
- name: Install dependencies
82+
working-directory: snippets/js/${{ matrix.runtime }}
83+
run: npm install --legacy-peer-deps
7684

7785
- name: Check
78-
working-directory: snippets/js
79-
run: bash check.sh
86+
working-directory: snippets/js/${{ matrix.runtime }}
87+
run: npm run check
8088

8189
check-kotlin:
8290
runs-on: ubuntu-latest
8391
steps:
8492
- name: Checkout
85-
uses: actions/checkout@v4
93+
uses: actions/checkout@v7
8694

87-
# Required for kotlin snippets
88-
- name: Set up Java 17
89-
uses: actions/setup-java@v2
95+
- name: Setup Java 17
96+
uses: actions/setup-java@v5
9097
with:
91-
distribution: "temurin"
92-
java-version: 17
98+
distribution: temurin
99+
java-version: '17'
100+
cache: gradle
93101

94102
- name: Check
95103
working-directory: snippets/kotlin
96-
run: ./gradlew build
104+
run: ./gradlew build --no-daemon
97105

98106
check-swift:
99107
runs-on: macos-latest
100108
steps:
101109
- name: Checkout
102-
uses: actions/checkout@v4
110+
uses: actions/checkout@v7
103111

104112
- name: Check
105113
working-directory: snippets/swift
@@ -109,10 +117,10 @@ jobs:
109117
runs-on: ubuntu-latest
110118
steps:
111119
- name: Checkout
112-
uses: actions/checkout@v4
120+
uses: actions/checkout@v7
113121

114-
- name: Setup dotnet
115-
uses: actions/setup-dotnet@v4
122+
- name: Setup .NET
123+
uses: actions/setup-dotnet@v6
116124
with:
117125
dotnet-version: '10.0.x'
118126

@@ -122,27 +130,26 @@ jobs:
122130

123131
deploy:
124132
name: Deploy book
125-
needs: [check-book, check-rust, check-python, check-js, check-kotlin, check-swift, check-csharp]
126-
if: github.ref == 'refs/heads/master'
133+
needs:
134+
- check-book
135+
- check-rust
136+
- check-python
137+
- check-js
138+
- check-kotlin
139+
- check-swift
140+
- check-csharp
141+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
142+
runs-on: ubuntu-latest
143+
permissions:
144+
pages: write
145+
id-token: write
146+
concurrency:
147+
group: pages
148+
cancel-in-progress: false
127149
environment:
128150
name: github-pages
129151
url: ${{ steps.deployment.outputs.page_url }}
130-
runs-on: ubuntu-latest
131152
steps:
132-
- name: Checkout
133-
uses: actions/checkout@v4
134-
135-
- name: Download built book
136-
uses: actions/download-artifact@v4
137-
with:
138-
name: built-book
139-
path: ./output/html
140-
141-
- name: Upload pages artifact
142-
uses: actions/upload-pages-artifact@v3
143-
with:
144-
path: './output/html'
145-
146153
- name: Deploy to GitHub Pages
147154
id: deployment
148155
uses: actions/deploy-pages@v4

README.md

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,30 @@
1-
# Rust Nostr Book
1+
# Nostr Dev Kit Book
22

3-
## Developers
3+
This repository contains the source for the Nostr Dev Kit onboarding guide.
44

5-
### Requirements
5+
## Requirements
66

7-
* [Just](https://github.com/casey/just): install with `cargo install just`
7+
- [Rust](https://www.rust-lang.org/tools/install)
8+
- [just](https://github.com/casey/just)
9+
- The toolchains for any binding snippets you want to check
810

9-
Serve the book with:
11+
Install the pinned mdBook tools and serve the book:
1012

1113
```bash
14+
just init
1215
just serve
1316
```
1417

15-
To test all the snippets:
18+
Run the book build, link checker, and all locally supported snippet checks with:
1619

1720
```bash
18-
just test
21+
just check
1922
```
23+
24+
Swift snippets are compiled by CI on macOS. The generated site is written to
25+
`output/html`.
26+
27+
## Updating the SDK release
28+
29+
Update the SDK pins in the snippet manifests and installation examples. Run `just build` and the snippet checks supported
30+
by the local toolchains; CI runs the complete language matrix.

RELEASE.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
# Release steps
1+
# Release checklist
22

3-
## Bump versions
3+
1. Update the SDK pins in the snippet manifests and installation examples.
4+
2. Update examples and platform requirements affected by the release.
5+
3. Run `just build` and the snippet checks supported by the local toolchains.
6+
4. Review the rendered book in `output/html`.
7+
5. Open a pull request and wait for every CI job, including the macOS Swift build.
8+
6. Merge to `master`; deployment starts only after the complete CI matrix passes.
49

5-
- Bump versions in `src/sdk/install.md`
6-
- Bump versions in snippets (`rust/Cargo.toml`, `python/requirements.txt`, ...)
7-
8-
## Bump supported platforms
9-
10-
Update the supported platforms and requirements, according to the last bindings changed.
10+
API reference links intentionally target the current documentation instead of a pinned release. Only installation
11+
examples and validation manifests are versioned.

book.toml

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,29 @@
11
[book]
2-
title = "Nostr Dev Kit Book"
3-
description = ""
2+
title = "Nostr Dev Kit"
3+
description = "A practical introduction to the Nostr Dev Kit libraries and native bindings."
44
authors = ["Yuki Kishimoto <yukikishimoto@protonmail.com>", "Nostr Dev Kit Developers"]
55
language = "en"
66
src = "src"
77

88
[build]
99
build-dir = "output"
10+
create-missing = false
1011

1112
[output.html]
12-
theme="theme"
13-
default-theme = "ayu"
13+
default-theme = "auto"
1414
preferred-dark-theme = "ayu"
15-
additional-js = ["./tabs.js"]
16-
git-repository-url = "https://github.com/nostrdevkit"
17-
18-
# This line change the path of the main book build from `book/` to `book/html`.
19-
# If this line will be removed, the deploy book CI must be updated.
20-
[output.linkcheck]
21-
command = "mdbook-linkcheck2"
15+
additional-js = ["tabs.js"]
16+
git-repository-url = "https://github.com/nostrdevkit/book"
17+
site-url = "/"
18+
cname = "doc.nostrdevkit.org"
19+
input-404 = "404.md"
20+
sidebar-header-nav = false
2221

2322
[preprocessor.snippets]
2423
after = ["links"]
24+
25+
[output.html.playground]
26+
runnable = false
27+
28+
[output.linkcheck]
29+
command = "mdbook-linkcheck2"

contrib/content-tabs-template.md

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,42 +3,64 @@
33
<div slot="title">Rust</div>
44
<section>
55

6-
TODO
6+
<!-- Rust example -->
77

88
</section>
99

1010
<div slot="title">Python</div>
1111
<section>
1212

13-
TODO
13+
<!-- Python example -->
1414

1515
</section>
1616

1717
<div slot="title">JavaScript</div>
1818
<section>
1919

20-
TODO
20+
<custom-tabs category="javascript-runtime">
21+
22+
<div slot="title">Node.js</div>
23+
<section>
24+
25+
<!-- Node.js example -->
26+
27+
</section>
28+
29+
<div slot="title">Web</div>
30+
<section>
31+
32+
<!-- Web example -->
33+
34+
</section>
35+
36+
<div slot="title">React Native</div>
37+
<section>
38+
39+
<!-- React Native example -->
40+
41+
</section>
42+
</custom-tabs>
2143

2244
</section>
2345

2446
<div slot="title">Kotlin</div>
2547
<section>
2648

27-
TODO
49+
<!-- Kotlin example -->
2850

2951
</section>
3052

3153
<div slot="title">Swift</div>
3254
<section>
3355

34-
TODO
56+
<!-- Swift example -->
3557

3658
</section>
3759

3860
<div slot="title">C#</div>
3961
<section>
4062

41-
TODO
63+
<!-- C# example -->
4264

4365
</section>
4466
</custom-tabs>

0 commit comments

Comments
 (0)