From b81b74744653c95e30ecefd18f2a286bb95cf4cb Mon Sep 17 00:00:00 2001 From: nhtyy Date: Tue, 3 Dec 2024 18:56:44 -0800 Subject: [PATCH] chore: fix all deadlinks, path adjust script for versioning --- book/README.md | 1 + book/adjust-version-path.sh | 18 ++++++++++++++++++ .../generating-proofs/prover-network/usage.md | 4 ++-- .../verification/onchain/getting-started.mdx | 2 +- book/docs/writing-programs/compiling.mdx | 2 +- .../generating-proofs/prover-network/usage.md | 4 ++-- .../verification/onchain/getting-started.mdx | 2 +- .../writing-programs/compiling.mdx | 2 +- 8 files changed, 27 insertions(+), 8 deletions(-) create mode 100644 book/adjust-version-path.sh diff --git a/book/README.md b/book/README.md index fa7d79fce..6597cdf56 100644 --- a/book/README.md +++ b/book/README.md @@ -32,3 +32,4 @@ This command generates static content into the `build` directory and can be serv - Code snippets from the repo are made through the [gen script](./gen-code-refs.sh). - When adding new code snippets, ensure that the gen script is updated to include the new file. - Check out the [Docusaurus documentation](https://docusaurus.io/docs/versioning) versioning information. + - You can use the [adjustment](./adjust-version-path.sh) script to adjust the import path in the markdown files after changing the version. diff --git a/book/adjust-version-path.sh b/book/adjust-version-path.sh new file mode 100644 index 000000000..0eceaff82 --- /dev/null +++ b/book/adjust-version-path.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +set -e +shopt -s globstar + +pushd "versioned_docs/version-$1" + +if [[ $OSTYPE == "darwin"* ]]; then + # Mac OS X + sed -i '' 's|\.\.\/\.\.\/static|..\/..\/..\/static|g' **/*.md + sed -i '' 's|\.\.\/\.\.\/static|..\/..\/..\/static|g' **/*.mdx +else + # Other OSes + sed -i 's|\.\.\/\.\.\/static|..\/..\/..\/static|g' **/*.md + sed -i 's|\.\.\/\.\.\/static|..\/..\/..\/static|g' **/*.mdx +fi + +popd diff --git a/book/docs/generating-proofs/prover-network/usage.md b/book/docs/generating-proofs/prover-network/usage.md index 6a0db6fa1..12ef4ac4e 100644 --- a/book/docs/generating-proofs/prover-network/usage.md +++ b/book/docs/generating-proofs/prover-network/usage.md @@ -19,8 +19,8 @@ SP1_PROVER=network SP1_PRIVATE_KEY=... RUST_LOG=info cargo run --release - `SP1_PROVER` should be set to `network` when using the prover network. -- `SP1_PRIVATE_KEY` should be set to your [private key](../prover-network#key-setup). You will need - to be using a [whitelisted](../prover-network#get-access) key to use the network. +- `SP1_PRIVATE_KEY` should be set to your [private key](./key-setup.md). You will need + to be using a [whitelisted](../prover-network) key to use the network. When you call any of the prove functions in ProverClient now, it will first simulate your program, then wait for it to be proven through the network and finally return the proof. diff --git a/book/docs/verification/onchain/getting-started.mdx b/book/docs/verification/onchain/getting-started.mdx index e102de657..8b42128bf 100644 --- a/book/docs/verification/onchain/getting-started.mdx +++ b/book/docs/verification/onchain/getting-started.mdx @@ -8,7 +8,7 @@ The best way to get started with verifying SP1 proofs on-chain is to refer to th - The template [script](https://github.com/succinctlabs/sp1-project-template/blob/main/script/src/bin/prove.rs) shows how to generate the proof using the SDK and save it to a file. - The template [contract](https://github.com/succinctlabs/sp1-project-template/blob/main/contracts/src/Fibonacci.sol) shows how to verify the proof onchain using Solidity. -Refer to the section on [Contract Addresses](./contract-addresses#contract-addresses) for the addresses of the deployed verifiers. +Refer to the section on [Contract Addresses](./contract-addresses) for the addresses of the deployed verifiers. ## Generating SP1 Proofs for Onchain Verification diff --git a/book/docs/writing-programs/compiling.mdx b/book/docs/writing-programs/compiling.mdx index 6586d2553..4fcc8d8bf 100644 --- a/book/docs/writing-programs/compiling.mdx +++ b/book/docs/writing-programs/compiling.mdx @@ -8,7 +8,7 @@ Once you have written an SP1 program, you must compile it to an ELF file that ca > WARNING: This may not generate a reproducible ELF which is necessary for verifying that your binary corresponds to given source code. > -> Use the [reproducible build system](#reproducible-builds-with-docker-production) for production builds. +> Use the [reproducible build system](#production-builds) for production builds. To build a program while developing, simply run the following command in the crate that contains your SP1 program: diff --git a/book/versioned_docs/version-3.4.0/generating-proofs/prover-network/usage.md b/book/versioned_docs/version-3.4.0/generating-proofs/prover-network/usage.md index 6a0db6fa1..12ef4ac4e 100644 --- a/book/versioned_docs/version-3.4.0/generating-proofs/prover-network/usage.md +++ b/book/versioned_docs/version-3.4.0/generating-proofs/prover-network/usage.md @@ -19,8 +19,8 @@ SP1_PROVER=network SP1_PRIVATE_KEY=... RUST_LOG=info cargo run --release - `SP1_PROVER` should be set to `network` when using the prover network. -- `SP1_PRIVATE_KEY` should be set to your [private key](../prover-network#key-setup). You will need - to be using a [whitelisted](../prover-network#get-access) key to use the network. +- `SP1_PRIVATE_KEY` should be set to your [private key](./key-setup.md). You will need + to be using a [whitelisted](../prover-network) key to use the network. When you call any of the prove functions in ProverClient now, it will first simulate your program, then wait for it to be proven through the network and finally return the proof. diff --git a/book/versioned_docs/version-3.4.0/verification/onchain/getting-started.mdx b/book/versioned_docs/version-3.4.0/verification/onchain/getting-started.mdx index ad4087c9d..7556372f0 100644 --- a/book/versioned_docs/version-3.4.0/verification/onchain/getting-started.mdx +++ b/book/versioned_docs/version-3.4.0/verification/onchain/getting-started.mdx @@ -8,7 +8,7 @@ The best way to get started with verifying SP1 proofs on-chain is to refer to th - The template [script](https://github.com/succinctlabs/sp1-project-template/blob/main/script/src/bin/prove.rs) shows how to generate the proof using the SDK and save it to a file. - The template [contract](https://github.com/succinctlabs/sp1-project-template/blob/main/contracts/src/Fibonacci.sol) shows how to verify the proof onchain using Solidity. -Refer to the section on [Contract Addresses](./contract-addresses#contract-addresses) for the addresses of the deployed verifiers. +Refer to the section on [Contract Addresses](./contract-addresses) for the addresses of the deployed verifiers. ## Generating SP1 Proofs for Onchain Verification diff --git a/book/versioned_docs/version-3.4.0/writing-programs/compiling.mdx b/book/versioned_docs/version-3.4.0/writing-programs/compiling.mdx index fef91eed8..b5b66cb7f 100644 --- a/book/versioned_docs/version-3.4.0/writing-programs/compiling.mdx +++ b/book/versioned_docs/version-3.4.0/writing-programs/compiling.mdx @@ -8,7 +8,7 @@ Once you have written an SP1 program, you must compile it to an ELF file that ca > WARNING: This may not generate a reproducible ELF which is necessary for verifying that your binary corresponds to given source code. > -> Use the [reproducible build system](#reproducible-builds-with-docker-production) for production builds. +> Use the [reproducible build system](#production-builds) for production builds. To build a program while developing, simply run the following command in the crate that contains your SP1 program: