Skip to content

feat: docs for pluggable Markdown processors#13919

Open
Princesseuh wants to merge 9 commits into
mainfrom
feat/markdown-agnostic
Open

feat: docs for pluggable Markdown processors#13919
Princesseuh wants to merge 9 commits into
mainfrom
feat/markdown-agnostic

Conversation

@Princesseuh
Copy link
Copy Markdown
Member

@Princesseuh Princesseuh commented May 21, 2026

Description (required)

Docs for withastro/astro#16149 withastro/astro#16848

@netlify
Copy link
Copy Markdown

netlify Bot commented May 21, 2026

Deploy Preview for astro-docs-2 ready!

Name Link
🔨 Latest commit 03fd7e7
🔍 Latest deploy log https://app.netlify.com/projects/astro-docs-2/deploys/6a111a723c7b9a00088566ad
😎 Deploy Preview https://deploy-preview-13919--astro-docs-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@astrobot-houston
Copy link
Copy Markdown
Contributor

astrobot-houston commented May 21, 2026

Lunaria Status Overview

🌕 This pull request will trigger status changes.

Learn more

By default, every PR changing files present in the Lunaria configuration's files property will be considered and trigger status changes accordingly.

You can change this by adding one of the keywords present in the ignoreKeywords property in your Lunaria configuration file in the PR's title (ignoring all files) or by including a tracker directive in the merged commit's description.

Tracked Files

File Note
en/guides/integrations-guide/mdx.mdx Source changed, localizations will be marked as outdated.
en/guides/markdown-content.mdx Source changed, localizations will be marked as outdated.
en/guides/migrate-to-astro/index.mdx Source changed, localizations will be marked as outdated.
en/reference/content-loader-reference.mdx Source changed, localizations will be marked as outdated.
en/reference/modules/astro-content.mdx Source changed, localizations will be marked as outdated.
en/reference/programmatic-reference.mdx Source changed, localizations will be marked as outdated.
Warnings reference
Icon Description
🔄️ The source for this localization has been updated since the creation of this pull request, make sure all changes in the source have been applied.

@ArmandPhilippot ArmandPhilippot added merge-on-release Don't merge this before the feature is released! (MQ=approved but WAIT for feature release!) 7.0 labels May 21, 2026
@ArmandPhilippot ArmandPhilippot added this to the v7 milestone May 21, 2026
Copy link
Copy Markdown
Member

@ArmandPhilippot ArmandPhilippot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, Erika! I left a few comments, mostly nits and two questions where we now show how to do something with @astrojs/markdown-remark but without any equivalent for Sätteri.

And, as far as I can tell, the broken links should be fixed once your core PR is merged!

MDX will extend [your project's existing Markdown configuration](/en/reference/configuration-reference/#markdown-options) by default. To override individual options, you can specify their equivalent in your MDX configuration.

For example, say you need to disable GitHub-Flavored Markdown and apply a different set of remark plugins for MDX files. You can apply these options like so, with `extendMarkdownConfig` enabled by default:
For example, say you need to use a different syntax highlighter and disable GitHub-Flavored Markdown for MDX files. You can apply these options like so, with `extendMarkdownConfig` enabled by default:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either we should remove this:

Suggested change
For example, say you need to use a different syntax highlighter and disable GitHub-Flavored Markdown for MDX files. You can apply these options like so, with `extendMarkdownConfig` enabled by default:
For example, say you need to disable GitHub-Flavored Markdown for MDX files. You can apply these options like so, with `extendMarkdownConfig` enabled by default:

or the example should configure a different syntax highlighter (e.g. Prism for Markdown, Shiki for MDX).

Because, if we set Shiki for Markdown, MDX will also use Shiki and so, we use the same syntax highlighter, right?

You can customize these heading IDs with a [Markdown processor](#choosing-a-markdown-processor) plugin that injects `id` attributes (e.g. `rehype-slug`). Your custom IDs, instead of Astro's defaults, will be reflected in the HTML output and the items returned by `getHeadings()`.

By default, Astro injects `id` attributes after your rehype plugins have run. If one of your custom rehype plugins needs to access the IDs injected by Astro, you can import and use Astro’s `rehypeHeadingIds` plugin directly. Be sure to add `rehypeHeadingIds` before any plugins that rely on it:
When using the [remark/rehype processor](#using-remark-and-rehype-plugins), Astro injects `id` attributes after your rehype plugins have run. If one of your custom rehype plugins needs to access the IDs injected by Astro, you can import and use Astro’s `rehypeHeadingIds` plugin directly. Be sure to add `rehypeHeadingIds` before any plugins that rely on it:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, this is no longer supported with Sätteri? I mean if a user wants to access/manipulate the ids in a custom HAST plugin, is it possible and should we explain how it works with Sâtteri?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's still possible, yes! The same Astro plugin does exists in the Sätteri pipeline. I'll have to check if it runs in the same order though, I believe right now user's plugins might be running after always.

Comment thread src/content/docs/en/guides/markdown-content.mdx Outdated
### Modifying frontmatter programmatically

You can add frontmatter properties to all of your Markdown and MDX files by using a [remark or rehype plugin](#markdown-plugins).
Using the [remark/rehype processor](#using-remark-and-rehype-plugins), you can add frontmatter properties to all of your Markdown and MDX files with a remark or rehype plugin.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question as before, does this mean this is no longer supported with Sätteri? Otherwise, it could be helpful to use <Tabs /> to show how to do that with both processors.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, this is good shout. This one is in fact not supported right now in Sätteri. Sätteri doesn't have a "global data store" thing per file like unified does, but Astro's plugin does rely on that.

Comment thread src/content/docs/en/guides/markdown-content.mdx Outdated
Comment thread src/content/docs/en/guides/markdown-content.mdx Outdated
Comment thread src/content/docs/en/guides/markdown-content.mdx
Comment thread src/content/docs/en/recipes/reading-time.mdx Outdated
Comment thread src/content/docs/en/guides/upgrade-to/v7.mdx Outdated
@Princesseuh Princesseuh removed the 7.0 label May 23, 2026
@Princesseuh Princesseuh modified the milestones: v7, 6.4 May 23, 2026
@Princesseuh Princesseuh changed the base branch from v7 to main May 23, 2026 02:03
@github-actions github-actions Bot added i18n Anything to do with internationalization & translation efforts - ask @YanThomas for help! 🚨 action labels May 23, 2026
Princesseuh and others added 5 commits May 23, 2026 04:07
Co-authored-by: Armand Philippot <git@armand.philippot.eu>
Co-authored-by: Armand Philippot <git@armand.philippot.eu>
Co-authored-by: Armand Philippot <git@armand.philippot.eu>
Co-authored-by: Armand Philippot <git@armand.philippot.eu>
@Princesseuh Princesseuh force-pushed the feat/markdown-agnostic branch from b13ef9c to 543fb80 Compare May 23, 2026 02:09
Comment thread src/content/docs/en/guides/integrations-guide/mdx.mdx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🚨 action i18n Anything to do with internationalization & translation efforts - ask @YanThomas for help! merge-on-release Don't merge this before the feature is released! (MQ=approved but WAIT for feature release!)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants