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

Open
iulianbarbu opened this issue Nov 1, 2024 · 3 comments
Assignees
Labels
C1-mentor A task where a mentor is available. Please indicate in the issue who the mentor could be. T17-Templates This PR/Issue is related to templates

Comments

@iulianbarbu
Copy link
Contributor

More details posted here: https://github.com/paritytech/polkadot-sdk/pull/5954/files/8b4884dc8a9d60d09d61b08ada0e645121c0d6b8#r1825695159. The idea is to keep parachain-template README.md in sync with the hardcoded configuration set in the Rust code.

@iulianbarbu iulianbarbu added the T17-Templates This PR/Issue is related to templates label Nov 1, 2024
@iulianbarbu iulianbarbu self-assigned this Nov 1, 2024
@iulianbarbu iulianbarbu moved this to Milestone 1 in Polkadot Omni Node Nov 27, 2024
@seemantaggarwal
Copy link
Contributor

Had a word with @iulianbarbu about this. We will divide this into three parts:

  1. Creating a docify template to generate a Readme in parachain template
  2. mirror the current state of Readme.md through the docify tempalte
  3. Replace the hardcoded value during compile time
  4. Test by changing the value, not a commit

We will track each step through this PR only

@seemantaggarwal
Copy link
Contributor

Important example to look at
substrate/bin/utils/chain-spec-builder

This already uses a docify, I will study and understand how the template works here, and then use the knowledge gained to mirror it for the parachain template

@iulianbarbu
Copy link
Contributor Author

iulianbarbu commented Jan 8, 2025

Following up on a topic I discussed previously with @seemantaggarwal , and putting my finding for reference here: I recall why we added the dollar sign ($) for $runtime_path example I showed you from chain-spec-builder.

We also run tests for the export_content sections that can be found in chain-spec-builder crate (so that we get testable documentation which is kept up to date given these tests run in CI). The $ is needed at runtime not by docify but by cmd_lib crate (used to execute bash like commands in the rust tests). It interpolates variables that are in scope into the bash-like commands: e.g. https://docs.rs/cmd_lib/latest/cmd_lib/#macros-to-run-external-commands. We shouldn't need a similar test for the scope of this issue, only testing the exported const value changes in the readme manually after it is modified in the code.

@iulianbarbu iulianbarbu added the C1-mentor A task where a mentor is available. Please indicate in the issue who the mentor could be. label Jan 8, 2025
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. T17-Templates This PR/Issue is related to templates
Projects
Status: Milestone 1
Development

No branches or pull requests

2 participants