Skip to content
This repository was archived by the owner on May 18, 2025. It is now read-only.
This repository was archived by the owner on May 18, 2025. It is now read-only.

Add hook and API to transform tokens individually before rendering #94

@NathanLovato

Description

@NathanLovato

When parsing MDX documents, add a way to walk or retrieve tokens and call procedures to process them:

  • Markdown image tags need to be converted into a PublicImage component with class names so there needs to be a way to create a new components, and replace a component with the new object
  • Inline code sometimes need to be replaced with <IconGodot ...> components
  • Video files need file paths to be make absolute
  • Include components need to be replaced with the included and preprocessed content

For these tasks, the API should allow:

  1. Looping over tokens
  2. Editing tokens
  3. Creating new tokens
  4. Inserting tokens
  5. Replacing tokens

For includes and special case, we can think of a simple token that contains text that gets inserted as-is? Preserving the original token indentation optionally

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions