Skip to content

Commit

Permalink
Add Rust docs page
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Leshiy committed Dec 11, 2023
1 parent f1337d0 commit 848a467
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 8 deletions.
8 changes: 5 additions & 3 deletions docs/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,23 @@ VERSION 0.7
# Copy all the source we need to build the docs
src:
# Common src setup
DO github.com/input-output-hk/catalyst-ci/earthly/docs:v2.0.8+SRC
DO github.com/input-output-hk/catalyst-ci/earthly/docs:v2.0.11+SRC

# Now copy into that any artifacts we pull from the builds.
COPY --dir ../+repo-docs/repo /docs/includes
# copy Rust docs
COPY ./../hermes+build-hosted/doc /docs/src/api/rust-docs

# Build the docs here.
docs:
FROM +src

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

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

# Copy the static pages into the container
COPY +docs/ /usr/share/nginx/html
Expand Down
5 changes: 5 additions & 0 deletions docs/src/.pages
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
nav:
- getting-started
- 'API': api
- architecture
- appendix
46 changes: 46 additions & 0 deletions docs/src/api/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
icon: material/api
---

<!-- cspell: words RUSTDOC graphviz -->

# Hermes Rust docs

<!-- markdownlint-disable no-inline-html -->
<iframe src="rust-docs/index.html" title="RUSTDOC Documentation" style="height:800px;width:100%;"></iframe>

[OPEN FULL PAGE](./rust-docs/index.html)

## Workspace Dependency Graph

```kroki-graphviz
@from_file:./api/rust-docs/workspace.dot
```

## External Dependencies Graph

```kroki-graphviz
@from_file:./api/rust-docs/full.dot
```

## Build and Development Dependencies Graph

```kroki-graphviz
@from_file:./api/rust-docs/all.dot
```

## Module trees

### hermes crate

```rust
{{ include_file('src/api/rust-docs/hermes.hermes.bin.modules.tree') }}
```
## Module graphs
### hermes crate
```kroki-graphviz
@from_file:./api/rust-docs/hermes.hermes.bin.modules.dot
```
10 changes: 5 additions & 5 deletions hermes/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ VERSION 0.7

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

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

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

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

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

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

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

DO github.com/input-output-hk/catalyst-ci/earthly/rust:v2.0.3+SMOKE_TEST --bin=hermes
DO github.com/input-output-hk/catalyst-ci/earthly/rust:v2.0.11+SMOKE_TEST --bin=hermes

SAVE ARTIFACT target/$TARGETARCH/doc doc
SAVE ARTIFACT target/$TARGETARCH/release/hermes hermes
Expand Down

0 comments on commit 848a467

Please sign in to comment.