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

Use docify export for parachain template hardcoded configuration and embed it in its README #6333 #7093

Merged
merged 42 commits into from
Jan 20, 2025

Conversation

seemantaggarwal
Copy link
Contributor

@seemantaggarwal seemantaggarwal commented Jan 8, 2025

Use docify export for parachain template hardcoded configuration and embed it in its README #6333

Docify currently has a limitation of not being able to embed a variable/const in its code, without embedding it's definition, even if do something in a string like

"this is a sample string ${sample_variable}"

It will embed the entire string
"this is a sample string ${sample_variable}"
without replacing the value of sample_variable from the code

Hence, the goal was just to make it obvious in the README where the PARACHAIN_ID value is coming from, so a note has been added at the start for the same, so whenever somebody is running these commands, they will be aware about the value and replace accordingly.

To make it simpler, we added a
rust ignore block so the user can just look it up in the readme itself and does not have to scan through the runtime directory for the value.

Copy link
Contributor

@iulianbarbu iulianbarbu left a comment

Choose a reason for hiding this comment

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

I haven't run this yet, but I think it needs a few tweaks before it runs successfully. LMK if anything is not clear.

templates/parachain/runtime/src/genesis_config_presets.rs Outdated Show resolved Hide resolved
templates/parachain/runtime/src/genesis_config_presets.rs Outdated Show resolved Hide resolved
templates/parachain/runtime/src/genesis_config_presets.rs Outdated Show resolved Hide resolved
templates/parachain/runtime/src/genesis_config_presets.rs Outdated Show resolved Hide resolved
templates/parachain/README.docify.md Show resolved Hide resolved
templates/parachain/runtime/src/genesis_config_presets.rs Outdated Show resolved Hide resolved
templates/parachain/runtime/src/genesis_config_presets.rs Outdated Show resolved Hide resolved
iulianbarbu

This comment was marked as resolved.

@seemantaggarwal seemantaggarwal added C1-mentor A task where a mentor is available. Please indicate in the issue who the mentor could be. T11-documentation This PR/Issue is related to documentation. T17-Templates This PR/Issue is related to templates labels Jan 14, 2025
@seemantaggarwal seemantaggarwal requested review from a team as code owners January 14, 2025 12:35
@paritytech-workflow-stopper
Copy link

All GitHub workflows were cancelled due to failure one of the required jobs.
Failed workflow url: https://github.com/paritytech/polkadot-sdk/actions/runs/12784716675
Failed job name: build-rustdoc

.github/scripts/check-workspace.py Outdated Show resolved Hide resolved
prdoc/pr_7093.prdoc Outdated Show resolved Hide resolved
templates/parachain/README.docify.md Outdated Show resolved Hide resolved
templates/parachain/README.docify.md Outdated Show resolved Hide resolved
templates/parachain/runtime/Cargo.toml Outdated Show resolved Hide resolved
templates/parachain/runtime/build.rs Outdated Show resolved Hide resolved
templates/parachain/runtime/build.rs Outdated Show resolved Hide resolved
templates/parachain/runtime/src/lib.rs Outdated Show resolved Hide resolved
templates/parachain/runtime/src/lib.rs Outdated Show resolved Hide resolved
templates/parachain/src/lib.rs Outdated Show resolved Hide resolved
@seemantaggarwal seemantaggarwal requested review from kianenigma, a team and iulianbarbu January 15, 2025 21:42
@seemantaggarwal seemantaggarwal changed the title initial docify readme with some content #6333 Use docify export for parachain template hardcoded configuration and embed it in its README #6333 Jan 16, 2025
Copy link
Contributor

@iulianbarbu iulianbarbu left a comment

Choose a reason for hiding this comment

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

Hah, almost there! Very nice!

prdoc/pr_7093.prdoc Outdated Show resolved Hide resolved
templates/parachain/Dockerfile Outdated Show resolved Hide resolved
Copy link
Contributor

@iulianbarbu iulianbarbu left a comment

Choose a reason for hiding this comment

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

Hmm, not sure why the prdoc check fails this time, maybe the suggestion can fix it.

prdoc/pr_7093.prdoc Outdated Show resolved Hide resolved
Comment on lines +17 to +19
// The parachain-template crate helps with keeping the README.md in sync
// with code sections across the components under the template: node,
// pallets & runtime, by using `docify`.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit, maybe:

Suggested change
// The parachain-template crate helps with keeping the README.md in sync
// with code sections across the components under the template: node,
// pallets & runtime, by using `docify`.
+ //! The parachain-template crate exists solely to keep the README.md file up-to-date using docify.
//! It ensures synchronization between the README and code sections across the template components,
//! such as the node, pallets, and runtime. Note that this crate itself is not copied into the
//! template repository.

Copy link
Contributor

@michalkucharczyk michalkucharczyk Jan 20, 2025

Choose a reason for hiding this comment

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

@seemantaggarwal I believe it is a valuable improvement: clear doc why this crate was created is always appreciated. Please re-consider including this.

@seemantaggarwal seemantaggarwal added this pull request to the merge queue Jan 20, 2025
Merged via the queue into master with commit 4937f77 Jan 20, 2025
193 of 207 checks passed
@seemantaggarwal seemantaggarwal deleted the docify-parachain-readme branch January 20, 2025 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C1-mentor A task where a mentor is available. Please indicate in the issue who the mentor could be. T11-documentation This PR/Issue is related to documentation. T17-Templates This PR/Issue is related to templates
Projects
Status: Milestone 1
Development

Successfully merging this pull request may close these issues.

3 participants