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

Markdown Components - Migrate to MDX #1470

Open
bradystroud opened this issue Sep 18, 2024 · 2 comments
Open

Markdown Components - Migrate to MDX #1470

bradystroud opened this issue Sep 18, 2024 · 2 comments
Labels
TinaCMS Relates to TinaCMS migration

Comments

@bradystroud
Copy link
Member

bradystroud commented Sep 18, 2024

Blocked by #1523

All these components will need to

  1. become JSX components
  2. Added to Tina
  3. Fixed in the content via a script
@tkapa tkapa added the TinaCMS Relates to TinaCMS migration label Sep 24, 2024
@isaaclombardssw
Copy link
Member

Caleb and I accidentally looked into this in a lot of detail within the scope of #1465.

  1. For the body field, that's defined in the schema for the rule collection, it should be extracted into an external JSON file.

  2. Prior to to the markdown being passed into the function (parseMDX) which we're using the generate the AST tree, use regex to transform the markdown syntax into something Tina will eat.

ex.

      ::: greybox
       
      ### our text
       
      our text
       
      :::

to either....

      <greybox
        content={<>
          ### our text
          
          our text
        </>}
      >

OR

      <greybox>
        ### our text
       
        our text
      </greybox>
  1. When calling parseMDX, you need to pass in the JSON field as the second param (this tries to match the data in the md file with the structure of the rule).

@bradystroud bradystroud changed the title Markdown Components - Migrate to JSX Markdown Components - Migrate to MDX Oct 8, 2024
@isaaclombardssw
Copy link
Member

/::: greybox([\s\S]*?):::/;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TinaCMS Relates to TinaCMS migration
Projects
None yet
Development

No branches or pull requests

3 participants