Highlight the main issue(s) below:
Often it is useful to display code snippets directly from FRAME or Polkadot-sdk. Often, these may change, leading to this repository becoming outdated.
What is the proposed solution?
Because this is Javascript, it is not going to be the prettiest solution ever.
A CI job that:
- Retrieves the relevant code snippets from polkadot-sdk
- Saves them in a .rs file (or individual JSON file representing that snippet)
- Use the
CodeBlock component to display these code snippets
The end result, in an MDX file would look like:
...
<CodeBlock language="rust">{RustCode}</CodeBlock>
...
Where RustCode is the example file, which the CI job generates