Skip to content

Commit 301d953

Browse files
authored
feat(docs): Integrate Rust docs to our general mkDocs (#173)
* Add rust docs deployment * fix * fix * update * embed Rust docs * add dependency graphs * update * fix * update * fix * fix * update Earthly versions * fix Rust build
1 parent f164369 commit 301d953

File tree

12 files changed

+74
-23
lines changed

12 files changed

+74
-23
lines changed

catalyst-gateway/.cargo/config.toml

+3-1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ rustflags = [
4949
]
5050

5151
rustdocflags = [
52+
"--enable-index-page",
53+
"-Z",
54+
"unstable-options",
5255
"-D",
5356
"warnings",
5457
"-D",
@@ -104,7 +107,6 @@ lto = "thin"
104107
incremental = false
105108
codegen-units = 16
106109

107-
108110
[alias]
109111
lint = "clippy -- -D warnings -D clippy::pedantic -D clippy::unwrap_used -D clippy::expect_used -D clippy::exit -D clippy::get_unwrap -D clippy::index_refutable_slice -D clippy::indexing_slicing -D clippy::match_on_vec_items -D clippy::match_wild_err_arm -D clippy::missing_panics_doc -D clippy::panic -D clippy::string_slice -D clippy::unchecked_duration_subtraction -D clippy::unreachable -D clippy::missing_docs_in_private_items"
110112
lintfix = "clippy -- -D warnings -D clippy::pedantic -D clippy::unwrap_used -D clippy::expect_used -D clippy::exit -D clippy::get_unwrap -D clippy::index_refutable_slice -D clippy::indexing_slicing -D clippy::match_on_vec_items -D clippy::match_wild_err_arm -D clippy::missing_panics_doc -D clippy::panic -D clippy::string_slice -D clippy::unchecked_duration_subtraction -D clippy::unreachable"

catalyst-gateway/Earthfile

+6-5
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ VERSION 0.7
44

55
# Set up our target toolchains, and copy our files.
66
builder:
7-
FROM github.com/input-output-hk/catalyst-ci/earthly/rust:v2.0.3+rust-base
7+
FROM github.com/input-output-hk/catalyst-ci/earthly/rust:v2.0.11+rust-base
88

9-
DO github.com/input-output-hk/catalyst-ci/earthly/rust:v2.0.3+SETUP --toolchain=rust-toolchain.toml
9+
DO github.com/input-output-hk/catalyst-ci/earthly/rust:v2.0.11+SETUP --toolchain=rust-toolchain.toml
1010

1111
COPY --dir .cargo .config Cargo.* clippy.toml deny.toml rustfmt.toml bin crates .
1212

1313
# Test rust build container - Use best architecture host tools.
1414
check-hosted:
1515
FROM +builder
1616

17-
DO github.com/input-output-hk/catalyst-ci/earthly/rust:v2.0.3+CHECK
17+
DO github.com/input-output-hk/catalyst-ci/earthly/rust:v2.0.11+CHECK
1818

1919
# Test which runs check with all supported host tooling. Needs qemu or rosetta to run.
2020
# Only used to validate tooling is working across host toolsets.
@@ -27,9 +27,9 @@ build-hosted:
2727
# Build the service
2828
FROM +builder
2929

30-
RUN /scripts/std_build.sh
30+
DO github.com/input-output-hk/catalyst-ci/earthly/rust:v2.0.11+BUILD --bins="cat-gateway/cat-gateway"
3131

32-
DO github.com/input-output-hk/catalyst-ci/earthly/rust:v2.0.3+SMOKE_TEST --bin=cat-gateway
32+
DO github.com/input-output-hk/catalyst-ci/earthly/rust:v2.0.11+SMOKE_TEST --bin="cat-gateway"
3333

3434
SAVE ARTIFACT target/$TARGETARCH/doc doc
3535
SAVE ARTIFACT target/$TARGETARCH/release/cat-gateway cat-gateway
@@ -39,6 +39,7 @@ build-hosted:
3939
build-all-hosts:
4040
BUILD --platform=linux/amd64 --platform=linux/arm64 +build-hosted
4141

42+
4243
## -----------------------------------------------------------------------------
4344
##
4445
## Standard CI targets.

catalyst-gateway/bin/Cargo.toml

-8
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,6 @@ edition.workspace = true
99
license.workspace = true
1010
repository.workspace = true
1111

12-
[[bin]]
13-
name = "cat-gateway"
14-
path = "src/main.rs"
15-
16-
[lib]
17-
name = "lib"
18-
path = "src/lib.rs"
19-
2012
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
2113

2214
[dependencies]

catalyst-gateway/clippy.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
allow-unwrap-in-tests = true
1+
allow-expect-in-tests = true

docs/Earthfile

+5-3
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,23 @@ VERSION 0.7
66
# Copy all the source we need to build the docs
77
src:
88
# Common src setup
9-
DO github.com/input-output-hk/catalyst-ci/earthly/docs:v2.0.8+SRC
9+
DO github.com/input-output-hk/catalyst-ci/earthly/docs:v2.0.11+SRC
1010

1111
# Now copy into that any artifacts we pull from the builds.
1212
COPY --dir ../+repo-docs/repo /docs/includes
13+
# copy Rust docs
14+
COPY ./../catalyst-gateway+build-hosted/doc /docs/src/api/catalyst-gateway/rust-docs
1315

1416
# Build the docs here.
1517
docs:
1618
FROM +src
1719

18-
DO github.com/input-output-hk/catalyst-ci/earthly/docs:v2.0.8+BUILD
20+
DO github.com/input-output-hk/catalyst-ci/earthly/docs:v2.0.11+BUILD
1921

2022
# Make a locally runable container that can serve the docs.
2123
local:
2224
# Build a self contained service to show built docs locally.
23-
DO github.com/input-output-hk/catalyst-ci/earthly/docs:v2.0.8+PACKAGE
25+
DO github.com/input-output-hk/catalyst-ci/earthly/docs:v2.0.11+PACKAGE
2426

2527
# Copy the static pages into the container
2628
COPY +docs/ /usr/share/nginx/html

docs/src/.pages

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
arrange:
2-
- index.md
1+
nav:
2+
- 'Home': index.md
33
- getting-started
44
- catalyst-standards
5+
- 'API': api
56
- architecture
67
- appendix

docs/src/api/.pages

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
nav:
2+
- index.md
3+
- 'Catalyst gateway': catalyst-gateway.md

docs/src/api/catalyst-gateway.md

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
icon: material/gate
3+
---
4+
5+
<!-- cspell: words RUSTDOC graphviz -->
6+
7+
# Catalyst Gateway Rust docs
8+
9+
<!-- markdownlint-disable no-inline-html -->
10+
<iframe src="rust-docs/index.html" title="RUSTDOC Documentation" style="height:800px;width:100%;"></iframe>
11+
12+
[OPEN FULL PAGE](./catalyst-gateway/rust-docs/index.html)
13+
14+
## Workspace Dependency Graph
15+
16+
```kroki-graphviz
17+
@from_file:./api/catalyst-gateway/rust-docs/workspace.dot
18+
```
19+
20+
## External Dependencies Graph
21+
22+
```kroki-graphviz
23+
@from_file:./api/catalyst-gateway/rust-docs/full.dot
24+
```
25+
26+
## Build and Development Dependencies Graph
27+
28+
```kroki-graphviz
29+
@from_file:./api/catalyst-gateway/rust-docs/all.dot
30+
```
31+
32+
## Module trees
33+
34+
### cat-gateway crate
35+
36+
```rust
37+
{{ include_file('src/api/catalyst-gateway/rust-docs/cat-gateway.cat-gateway.bin.modules.tree') }}
38+
```
39+
40+
## Module graphs
41+
42+
### cat-gateway crate
43+
44+
```kroki-graphviz
45+
@from_file:./api/catalyst-gateway/rust-docs/cat-gateway.cat-gateway.bin.modules.dot
46+
```

docs/src/api/index.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
icon: material/api
3+
---
4+
5+
# Catalyst Voices API docs

docs/src/appendix/important/.pages

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
arrange:
1+
nav:
22
- index.md
33
- contributing.md
44
- coc.md

docs/src/architecture/.pages

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
arrange:
1+
nav:
22
- index.md
33
- 01_introduction_and_goals.md
44
- 02_architecture_constraints.md

docs/src/catalyst-standards/index.md

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
icon: material/pillar
33
---
44

5-
<!-- markdownlint-disable MD025-->
65
# Catalyst Standards
76

87
These are documents that relate to standardized specifications of the catalyst stack.

0 commit comments

Comments
 (0)