Skip to content

Commit 4c1c58c

Browse files
committed
Merge branch 'main' into docs/prereqs-rust
2 parents 02e4760 + 7f7681a commit 4c1c58c

7 files changed

Lines changed: 49 additions & 15 deletions

File tree

.github/workflows/mdbook.yml

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,40 +24,58 @@ concurrency:
2424
group: "pages"
2525
cancel-in-progress: false
2626

27+
env:
28+
MDBOOK_VERSION: 0.4.21
29+
MDBOOK_ALERTS_VERSION: 0.6.7
30+
MDBOOK_LINKCHECK_VERSION: 0.7.7
31+
PUBLISH_DOMAIN: component-model.bytecodealliance.org
32+
ARTIFACT_PATH: ./component-model/book/html
33+
2734
jobs:
28-
# Build job
2935
build:
3036
runs-on: ubuntu-latest
31-
env:
32-
MDBOOK_VERSION: 0.4.21
33-
ALERTS_VERSION: 0.6.7
34-
PUBLISH_DOMAIN: component-model.bytecodealliance.org
3537
steps:
3638
- uses: actions/checkout@v3
3739
- name: Install mdBook
3840
run: |
3941
curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf -y | sh
4042
rustup update
41-
cargo install --version ${MDBOOK_VERSION} mdbook
42-
cargo install --version ${ALERTS_VERSION} mdbook-alerts
43-
- name: Setup Pages
44-
id: pages
45-
uses: actions/configure-pages@v3
43+
cargo install --version ${{ env.MDBOOK_VERSION }} mdbook
44+
cargo install --version ${{ env.MDBOOK_ALERTS_VERSION }} mdbook-alerts
45+
cargo install --version ${{ env.MDBOOK_LINKCHECK_VERSION }} mdbook-linkcheck
46+
4647
- name: Build with mdBook
4748
run: mdbook build component-model
49+
4850
- name: Setup Python
4951
uses: actions/setup-python@v5
5052
with:
5153
python-version: '3.13'
54+
55+
# Ensure the build generated properly
56+
- name: Ensure build outputs are present
57+
shell: bash
58+
run: |
59+
if [[ ! -f "${{ env.ARTIFACT_PATH }}/index.html" ]]; then
60+
echo "[error] index.html @ [${{ env.ARTIFACT_PATH }}] is missing. Build or path misconfigured";
61+
exit 1;
62+
fi
63+
5264
- name: Generate sitemap
65+
shell: bash
5366
run: |
54-
cd component-model
55-
python3 ../scripts/generate_sitemap.py --domain "component-model.bytecodealliance.org" --higher-priority "design" --output-path book/sitemap.xml
56-
cd ..
67+
cd ${{ env.ARTIFACT_PATH }}
68+
python3 ../../../scripts/generate_sitemap.py --domain "component-model.bytecodealliance.org" --higher-priority "design" --output-path sitemap.xml
69+
cd ../../../
70+
71+
- name: Setup Pages
72+
id: pages
73+
uses: actions/configure-pages@v3
74+
5775
- name: Upload artifact
5876
uses: actions/upload-pages-artifact@v3
5977
with:
60-
path: ./component-model/book
78+
path: ${{ env.ARTIFACT_PATH }}
6179

6280
# Deployment job
6381
deploy:

component-model/src/language-support/c.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,3 +216,6 @@ or any other host.
216216

217217
See the [Rust Tooling guide](../language-support/rust.md#running-a-component-from-rust-applications) for instructions on how to run this component from
218218
the Rust `example-host` (replacing the path to `add.wasm` with your `add-component` above).
219+
220+
[!NOTE]: #
221+
[!WARNING]: #

component-model/src/language-support/csharp.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ This kind of error normally indicates that the host in question does not contain
152152

153153
[host]: https://github.com/bytecodealliance/component-docs/tree/main/component-model/examples/example-host
154154
[add-to-linker]: https://docs.wasmtime.dev/api/wasmtime_wasi/fn.add_to_linker_sync.html
155+
[example-host]: https://github.com/bytecodealliance/component-docs/tree/main/component-model/examples/example-host
155156

156157
## Building a component that exports an interface
157158

@@ -325,3 +326,6 @@ wasmtime run ./dist/main.wasm
325326
Check out the [componentize-dotnet docs][componentize-dotnet-docs] for more configurations options.
326327

327328
[componentize-dotnet-docs]: https://github.com/bytecodealliance/componentize-dotnet
329+
330+
[!NOTE]: #
331+
[!WARNING]: #

component-model/src/language-support/go.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,3 +321,6 @@ cargo run --release -- 1 2 /path/to/add.wasm
321321
```
322322

323323
[example-host]: https://github.com/bytecodealliance/component-docs/tree/main/component-model/examples/example-host
324+
325+
[!NOTE]: #
326+
[!WARNING]: #

component-model/src/language-support/javascript.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,3 +548,7 @@ reverseAndUppercase('!dlroW olleH') = HELLO WORLD!
548548

549549
[wac]: https://github.com/bytecodealliance/wac
550550
[jco-examples-string-reverse-upper]: https://github.com/bytecodealliance/jco/tree/main/examples/components/string-reverse-upper
551+
552+
[!TIP]: #
553+
[!NOTE]: #
554+
[!WARNING]: #

component-model/src/language-support/python.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,3 +154,5 @@ $ python3 host.py
154154
[add-wasm]: https://github.com/bytecodealliance/component-docs/blob/main/component-model/examples/example-host/add.wasm
155155

156156
[adder-wit]: https://github.com/bytecodealliance/component-docs/tree/main/component-model/examples/tutorial/wit/adder/world.wit
157+
158+
[!NOTE]: #

scripts/generate_sitemap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
def parse_summary():
77
"""Parse URLs from the SUMMARY.md file."""
8-
with open("src/SUMMARY.md", "r") as file:
8+
with open("../../src/SUMMARY.md", "r") as file:
99
for line in file:
1010
if "](" in line:
1111
url = line.split("](")[1].split(")")[0]

0 commit comments

Comments
 (0)