Skip to content

[Infra Refactor] Some way to retrieve and display code snippets on a GitHub repository #143

@CrackTheCode016

Description

@CrackTheCode016

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:

  1. Retrieves the relevant code snippets from polkadot-sdk
  2. Saves them in a .rs file (or individual JSON file representing that snippet)
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Major Infra RefactorFor major changes regarding sitewide infrastructure changes.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions