Skip to content

Commit 7c1fa80

Browse files
authored
add nim api docs (#116)
1 parent b53dd5d commit 7c1fa80

File tree

4 files changed

+18
-2
lines changed

4 files changed

+18
-2
lines changed

.github/workflows/docs.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,14 @@ jobs:
1818
uses: actions/checkout@v4
1919
with:
2020
submodules: true
21-
- uses: Swatinem/rust-cache@v2
21+
- uses: actions/cache@v4
22+
with:
23+
path: |
24+
~/.cargo/bin/
25+
~/.cargo/registry/index/
26+
~/.cargo/registry/cache/
27+
~/.cargo/git/db/
28+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/*.nimble') }}
2229
- uses: jiro4989/setup-nim-action@v1
2330
with:
2431
nim-version: '2.2.4'

docs/src/introduction.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,8 @@ Via `nimble install`:
1515
```text
1616
nimble install json_serialization
1717
```
18+
19+
## API documentation
20+
21+
This guide covers basic usage of `json_serialization` - for details, see the
22+
[API reference](./api/).

docs/src/reference.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
<!-- toc -->
44

5+
This page provides an overview of the `json_serialization` API - for details, see the
6+
[API reference](./api/).
7+
58
## Parsing
69

710
### Common API
@@ -283,7 +286,7 @@ type
283286
Seven = "Seven"
284287
```
285288

286-
`nim-json-serialization` automatically detects the expected representation for each enum based on its declaration.
289+
`json_serialization` automatically detects the expected representation for each enum based on its declaration.
287290
- `Fruit` expects string literals.
288291
- `Drawer` and `Number` expect numeric literals.
289292
- `Mixed` (with both string and numeric values) is disallowed by default.

json_serialization.nimble

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,4 @@ task mdbook, "Install mdbook (requires cargo)":
5959

6060
task docs, "Generate API documentation":
6161
exec "mdbook build docs"
62+
exec nimc & " doc " & "--git.url:https://github.com/status-im/nim-json-serialization --git.commit:master --outdir:docs/book/api --project json_serialization"

0 commit comments

Comments
 (0)