Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update links in the documentation #5175

Merged
merged 12 commits into from
Aug 15, 2024
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docs/sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ frame = { features = [
"runtime",
], workspace = true, default-features = true }
pallet-examples = { workspace = true }
pallet-contracts = { workspace = true }
pallet-default-config-example = { workspace = true, default-features = true }
pallet-example-offchain-worker = { workspace = true, default-features = true }

Expand Down
18 changes: 9 additions & 9 deletions docs/sdk/src/guides/your_first_pallet/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
//! this guide, namely the crate/package names, based on which template you use.
//!
//! > Be aware that you can read the entire source code backing this tutorial by clicking on the
//! > [`source`](./mod.rs.html) button at the top right of the page.
//! > `source` button at the top right of the page.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This link didn't work.
It is however possible to make it work - it would look like this:

[`source`](../../../src/polkadot_sdk_docs/guides/your_first_pallet/mod.rs.html)

(Unless I'm missing some other obvious way of linking to source)
I thought it's better to not have a link, since the user is pointed to the built-in button anyway.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am surprised, why didn't the original one, or sth like ../mod.rs work? I don't see why we have to back up 3 steps and re-navigate ourselves into the same directory?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

back up 3 steps and re-navigate ourselves into the same directory

Not the same directory.

It navigates from:
target/doc/polkadot_sdk_docs/guides/your_first_pallet/index.html
to:
target/doc/src/polkadot_sdk_docs/guides/your_first_pallet/mod.rs.html

(note added src)

So it will link from here to here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, we can remove the link for now.

As a wishlist item, I wish we could amend each page to have a few fixed buttons/links in a more pronounced way:

  • how to contribute to this page
  • how to see the source of this page

The latter is already visible via the default rust HTML indeed.

//!
//! You should have studied the following modules as a prelude to this guide:
//!
Expand All @@ -45,7 +45,7 @@
//! Consider the following as a "shell pallet". We continue building the rest of this pallet based
//! on this template.
//!
//! [`pallet::config`] and [`pallet::pallet`](frame_support::pallet) are both mandatory parts of any
//! [`pallet::config`] and [`pallet::pallet`] are both mandatory parts of any
//! pallet. Refer to the documentation of each to get an overview of what they do.
#![doc = docify::embed!("./src/guides/your_first_pallet/mod.rs", shell_pallet)]
//!
Expand Down Expand Up @@ -319,13 +319,13 @@
//! - Learn more about the individual pallet items/macros, such as event and errors and call, in
//! [`frame::pallet_macros`].
//!
//! [`pallet::storage`]: ../../../frame_support/pallet_macros/attr.config.html
//! [`pallet::call`]: ../../../frame_support/pallet_macros/attr.call.html
//! [`pallet::event`]: ../../../frame_support/pallet_macros/attr.event.html
//! [`pallet::error`]: ../../../frame_support/pallet_macros/attr.error.html
//! [`pallet::pallet`]: ../../../frame_support/pallet_macros/attr.pallet.html
//! [`pallet::config`]: ../../../frame_support/pallet_macros/attr.config.html
//! [`pallet::generate_deposit`]: ../../../frame_support/pallet_macros/attr.generate_deposit.html
//! [`pallet::storage`]: frame_support::pallet_macros::storage
//! [`pallet::call`]: frame_support::pallet_macros::call
//! [`pallet::event`]: frame_support::pallet_macros::event
//! [`pallet::error`]: frame_support::pallet_macros::error
//! [`pallet::pallet`]: frame_support::pallet
//! [`pallet::config`]: frame_support::pallet_macros::config
//! [`pallet::generate_deposit`]: frame_support::pallet_macros::generate_deposit

#[docify::export]
#[frame::pallet(dev_mode)]
Expand Down
2 changes: 1 addition & 1 deletion docs/sdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#![doc = simple_mermaid::mermaid!("../../mermaid/IA.mmd")]
#![warn(rustdoc::broken_intra_doc_links)]
#![warn(rustdoc::private_intra_doc_links)]
#![doc(html_favicon_url = "https://polkadot.network/favicon-32x32.png")]
#![doc(html_favicon_url = "https://polkadot.com/favicon.ico")]
#![doc(
html_logo_url = "https://europe1.discourse-cdn.com/standard21/uploads/polkadot2/original/1X/eb57081e2bb7c39e5fcb1a98b443e423fa4448ae.svg"
)]
Expand Down
1 change: 0 additions & 1 deletion docs/sdk/src/reference_docs/chain_spec_genesis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@
//! [`pallet::genesis_build`]: frame_support::pallet_macros::genesis_build
//! [`pallet::genesis_config`]: frame_support::pallet_macros::genesis_config
//! [`BuildGenesisConfig`]: frame_support::traits::BuildGenesisConfig
//! [`chain_spec_builder`]: ../../../staging_chain_spec_builder/index.html
ggwpez marked this conversation as resolved.
Show resolved Hide resolved
//! [`serde`]: https://serde.rs/field-attrs.html
//! [`get_storage_for_patch`]: sc_chain_spec::GenesisConfigBuilderRuntimeCaller::get_storage_for_patch
//! [`GenesisBuilder::get_preset`]: sp_genesis_builder::GenesisBuilder::get_preset
Expand Down
6 changes: 3 additions & 3 deletions docs/sdk/src/reference_docs/runtime_vs_smart_contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
//! #### Smart Contracts in Substrate
//! Smart Contracts are autonomous, programmable constructs deployed on the blockchain.
//! In [FRAME](frame), Smart Contracts infrastructure is implemented by the
//! [`pallet_contracts`](../../../pallet_contracts/index.html) for WASM-based contracts or the
//! [`pallet_evm`](../../../pallet_evm/index.html) for EVM-compatible contracts. These pallets
//! [`pallet_contracts`] for WASM-based contracts or the
//! [`pallet_evm`](https://github.com/polkadot-evm/frontier/tree/master/frame/evm) for EVM-compatible contracts. These pallets
//! enable Smart Contract developers to build applications and systems on top of a Substrate-based
//! blockchain.
//!
Expand Down Expand Up @@ -108,7 +108,7 @@
//! - **Deployment and Iteration**: Smart Contracts, by nature, are designed for more
//! straightforward deployment and iteration. Developers can quickly deploy contracts.
//! - **Contract Code Updates**: Once deployed, although typically immutable, Smart Contracts can be
//! upgraded, but lack of migration logic. The [pallet_contracts](../../../pallet_contracts/index.html)
//! upgraded, but lack of migration logic. The [`pallet_contracts`]
//! allows for contracts to be upgraded by exposing the `set_code` dispatchable. More details on this
//! can be found in [Ink! documentation on upgradeable contracts](https://use.ink/basics/upgradeable-contracts).
//! - **Isolated Impact**: Upgrades or changes to a smart contract generally impact only that
Expand Down
Loading