From f3a326ce69fe63731e0937e243c18ad90ce81391 Mon Sep 17 00:00:00 2001 From: Nuke Date: Tue, 9 Jan 2024 17:27:19 -0700 Subject: [PATCH 1/5] rebase --- Cargo.lock | 4 ++-- docs/sdk/src/guides/your_first_pallet/mod.rs | 2 +- docs/sdk/src/meta_contributing.rs | 9 ++++----- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f5d57bb50be3..c3e5e2ff41bc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17418,9 +17418,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.0" +version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" [[package]] name = "smol" diff --git a/docs/sdk/src/guides/your_first_pallet/mod.rs b/docs/sdk/src/guides/your_first_pallet/mod.rs index c886bc9af842..24eada44a83a 100644 --- a/docs/sdk/src/guides/your_first_pallet/mod.rs +++ b/docs/sdk/src/guides/your_first_pallet/mod.rs @@ -365,7 +365,7 @@ pub mod pallet { // ensure sender has enough balance, and if so, calculate what is left after `amount`. let sender_balance = Balances::::get(&sender).ok_or("NonExistentAccount")?; if sender_balance < amount { - return Err("InsufficientBalance".into()) + return Err("InsufficientBalance".into()); } let reminder = sender_balance - amount; diff --git a/docs/sdk/src/meta_contributing.rs b/docs/sdk/src/meta_contributing.rs index b4f9d504c6cf..e6c2c5a765d4 100644 --- a/docs/sdk/src/meta_contributing.rs +++ b/docs/sdk/src/meta_contributing.rs @@ -69,8 +69,7 @@ //! > what topics are already covered in this crate, and how you can build on top of the information //! > that they already pose, rather than repeating yourself**. //! -//! For more details about documenting guidelines, see: -//! +//! For more details see the [latest documenting guidelines](https://github.com/paritytech/polkadot-sdk/blob/master/docs/contributor/DOCUMENTATION_GUIDELINES.md). //! //! #### Example: Explaining `#[pallet::call]` //! @@ -135,12 +134,12 @@ //! //! ## How to Build //! -//! To build this crate properly, with with right HTML headers injected, run: +//! To build and view this crate locally, with with right HTML headers injected, run: //! //! ```no_compile -//! RUSTDOCFLAGS="--html-in-header $(pwd)/docs/sdk/headers/toc.html" cargo doc -p polkadot-sdk-docs +//! RUSTDOCFLAGS="--html-in-header $(pwd)/docs/sdk/headers/toc.html" cargo doc -p polkadot-sdk-docs --open //! ``` //! -//! adding `--no-deps` would speed up the process while development. If even faster build time for +//! Adding `--no-deps` would speed up the process while development. If even faster build time for //! docs is needed, you can temporarily remove most of the substrate/cumulus dependencies that are //! only used for linking purposes. From c0a02da8edbfa8382c36eba4ae128b91d9a54054 Mon Sep 17 00:00:00 2001 From: Nuke Date: Tue, 9 Jan 2024 16:31:28 -0700 Subject: [PATCH 2/5] not rust block, ignored by docs tests --- docs/sdk/src/meta_contributing.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sdk/src/meta_contributing.rs b/docs/sdk/src/meta_contributing.rs index e6c2c5a765d4..a6ebbb66d9e9 100644 --- a/docs/sdk/src/meta_contributing.rs +++ b/docs/sdk/src/meta_contributing.rs @@ -136,7 +136,7 @@ //! //! To build and view this crate locally, with with right HTML headers injected, run: //! -//! ```no_compile +//! ```sh //! RUSTDOCFLAGS="--html-in-header $(pwd)/docs/sdk/headers/toc.html" cargo doc -p polkadot-sdk-docs --open //! ``` //! From 7e09f73ccb1930e7db263948f4f8dab1f8d238b5 Mon Sep 17 00:00:00 2001 From: Nuke Date: Tue, 9 Jan 2024 16:40:34 -0700 Subject: [PATCH 3/5] fix internal link --- docs/sdk/src/meta_contributing.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/sdk/src/meta_contributing.rs b/docs/sdk/src/meta_contributing.rs index a6ebbb66d9e9..7af3435cd27b 100644 --- a/docs/sdk/src/meta_contributing.rs +++ b/docs/sdk/src/meta_contributing.rs @@ -54,8 +54,8 @@ //! > high level tutorial. They should be explained in the rust-doc of the corresponding type or //! > macro. //! -//! 2. 🧘 Less is More: For reasons mentioned [above](#crate::why-rust-docs), the more concise this -//! crate is, the better. +//! 2. 🧘 Less is More: For reasons mentioned [above](#why-rust-docs), the more concise this crate +//! is, the better. //! 3. √ Don’t Repeat Yourself – DRY: A summary of the above two points. Authors should always //! strive to avoid any duplicate information. Every concept should ideally be documented in //! *ONE* place and one place only. This makes the task of maintaining topics significantly From 162cae18e569c0e211d7c442255701d4f46152e5 Mon Sep 17 00:00:00 2001 From: Nuke Date: Tue, 9 Jan 2024 17:10:21 -0700 Subject: [PATCH 4/5] fix mermaid typo --- docs/mermaid/polkadot_sdk_parachain.mmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/mermaid/polkadot_sdk_parachain.mmd b/docs/mermaid/polkadot_sdk_parachain.mmd index 3f38fce046c2..4cee54ba3f45 100644 --- a/docs/mermaid/polkadot_sdk_parachain.mmd +++ b/docs/mermaid/polkadot_sdk_parachain.mmd @@ -5,7 +5,7 @@ flowchart LR end FRAME -.-> ParachainRuntime - Substrate[Substrate Node Libraries] -.-> ParachainNoe + Substrate[Substrate Node Libraries] -.-> ParachainNode CumulusC[Cumulus Node Libraries] -.-> ParachainNode CumulusR[Cumulus Runtime Libraries] -.-> ParachainRuntime From dbd8cf13cd0325994a42c7e5945c9e4eba2cc6fd Mon Sep 17 00:00:00 2001 From: Nuke Date: Tue, 9 Jan 2024 17:23:49 -0700 Subject: [PATCH 5/5] reduce build rtime suggestion --- docs/sdk/src/meta_contributing.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/docs/sdk/src/meta_contributing.rs b/docs/sdk/src/meta_contributing.rs index 7af3435cd27b..bff475f8e6bf 100644 --- a/docs/sdk/src/meta_contributing.rs +++ b/docs/sdk/src/meta_contributing.rs @@ -132,14 +132,16 @@ //! compromise, but in the long term, we should work towards finding a way to maintain different //! revisions of this crate. //! -//! ## How to Build +//! ## How to Develop Locally //! -//! To build and view this crate locally, with with right HTML headers injected, run: +//! To view the docs specific [`crate`] locally for development, including the correct HTML headers +//! injected, run: //! //! ```sh -//! RUSTDOCFLAGS="--html-in-header $(pwd)/docs/sdk/headers/toc.html" cargo doc -p polkadot-sdk-docs --open +//! SKIP_WASM_BUILD=1 RUSTDOCFLAGS="--html-in-header $(pwd)/docs/sdk/headers/toc.html" cargo doc -p polkadot-sdk-docs --no-deps --open //! ``` //! -//! Adding `--no-deps` would speed up the process while development. If even faster build time for -//! docs is needed, you can temporarily remove most of the substrate/cumulus dependencies that are -//! only used for linking purposes. +//! If even faster build time for docs is needed, you can temporarily remove most of the +//! substrate/cumulus dependencies that are only used for linking purposes. +//! +//! For more on local development, see [`crate::reference_docs::development_environment_advice`].