Skip to content

Commit

Permalink
further improvements in using docify
Browse files Browse the repository at this point in the history
  • Loading branch information
seemantaggarwal committed Jan 9, 2025
1 parent 2e4f52b commit 8cda7b3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
4 changes: 3 additions & 1 deletion templates/parachain/README.docify.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Please see the installation section at [`crates.io/staging-chain-spec-builder`](
#### Use `chain-spec-builder` to generate the `chain_spec.json` file

```sh
chain-spec-builder create --relay-chain "rococo-local" --para-id {{PARACHAIN_ID}} --runtime \
chain-spec-builder create --relay-chain "rococo-local" --para-id <!-- docify::embed!("runtime/src/genesis_config_cmd_list_presets.rs", get_parachain_id())--> --runtime \
target/release/wbuild/parachain-template-runtime/parachain_template_runtime.wasm named-preset development
```
Expand Down Expand Up @@ -246,3 +246,5 @@ relay chain network (see [Parachain Template node](#parachain-template-node) set
- 👥 Additionally, there are [GitHub issues](https://github.com/paritytech/polkadot-sdk/issues) and
[Substrate StackExchange](https://substrate.stackexchange.com/).
11 changes: 6 additions & 5 deletions templates/parachain/runtime/src/genesis_config_presets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ use polkadot_sdk::{staging_xcm as xcm, *};
#[doc::include_str!("../../README.md")]
#[cfg(feature = "generate-readme")]

docify::compile_markdown!(
"README.docify.md",
"README.md"
);
docify::compile_markdown!("README.docify.md","README.md");

use docify::export;

Expand All @@ -27,7 +24,7 @@ use sp_keyring::Sr25519Keyring;
/// The default XCM version to set in genesis config.
const SAFE_XCM_VERSION: u32 = xcm::prelude::XCM_VERSION;
/// Parachain id used for genesis config presets of parachain template.
#[docify::export_content]
#[export]
pub const PARACHAIN_ID: u32 = 2000;

/// Generate the session keys from individual elements.
Expand All @@ -36,6 +33,10 @@ pub const PARACHAIN_ID: u32 = 2000;
pub fn template_session_keys(keys: AuraId) -> SessionKeys {
SessionKeys { aura: keys }
}
#[docify::export_content]
fn get_parachain_id(){
PARACHAIN_ID.to_string();
}

fn testnet_genesis(
invulnerables: Vec<(AccountId, AuraId)>,
Expand Down

0 comments on commit 8cda7b3

Please sign in to comment.