Skip to content

Clarify Markdown processors features and plugins - #14297

Merged
ArmandPhilippot merged 25 commits into
mainfrom
armand/markdown-guide
Aug 10, 2026
Merged

ArmandPhilippot merged 25 commits into
mainfrom
armand/markdown-guide

Conversation

@ArmandPhilippot

@ArmandPhilippot ArmandPhilippot commented Jul 23, 2026 •

Copy link
Copy Markdown
Member

Description (required)

Updates the Markdown guide to clarify what features are available by default through Markdown processors, when to choose which, and how plugins work.

Motivations:

  • Both Sätteri and Unified are official processors. Even though Sätteri is the default, we should have docs for the Unified processor.
  • Some Markdown options have been deprecated saying to move them to the unified() processor. But we never document what is available in the unified() object, except remarkPlugins and rehypePlugins.
  • Because markdown.gfm and markdown.smartypants have been deprecated, it's not clear this is also the default with Sätteri: no smartypants property in the configuration object, and the default for smartPunctuation is different in Sätteri.
  • markdown.remarkRehype is deprecated and we do not say how to do the same thing with Sätteri (well, with Sätteri only footnotes are relevant, but this was the only example for unified anyway).
  • "Modifying frontmatter programmatically" is outdated, we can do that with Sätteri too.
  • We never say that users might need to install @astrojs/markdown-satteri (I guess it works with npm, but we need to install it with pnpm if we want to pass plugins or disable features)
  • Nesting Markdown processors under "Markdown plugins" feels a bit wrong to me... Plugins and features are available thanks to processors, not the other way around. So, I want to try another approach, even though this means a bigger restructuring and broken links.
  • We have been using "Markdown plugins" for a long time, but, as Ema pointed out in Add a Sätteri tab in the remark/rehype recipes #14277 (review), this can be confusing for some: remark/mdast plugins run on Markdown AST (ie. Markdown plugins); rehype/hast run on Hypertext AST (ie. more like HTML plugins). We might need a better generic term (especially for recipes where some are focused on HAST), and clarify here what plugins does.

Details of the changes:

  • Merges @astrojs/starlight/components imports
  • Uses a consistent headings casing
  • Splits "Markdown plugins" into "Markdown processors" and "Markdown processor plugins" as top-level sections
  • Merges "Using remark and rehype plugins" and "Customizing a remark or rehype plugin" in a single "Markdown processor plugins" section as they are nearly identical and we need the equivalent for Sätteri.
  • Moves "Modifying frontmatter programmatically" as a nested section of "Markdown processor plugins"
  • Explains how to choose a Markdown processor (in a similar idea to "When to create a collection")
  • Details built-in features and how to disable/customize them
  • Uses "generic" sections/Adds more Sätteri/Unified tabs to easily compare how both work
  • Mentions the difference between remark/mdast and rehype/hast plugins
  • Replaces confusing wording (e.g. "See the Sätteri documentation for the available plugins and features.": AFAIK, there is no list of "available plugins", only features.)
  • Replaces the remark and rehype plugins examples with others that have an equivalent for Sätteri.
  • Adds a Sätteri tab to "Modifying frontmatter programmatically".
  • Adds a <MarkdownProcessorTabs /> component to avoid repeating the sync key and to make it easier to keep it in sync in the recipes.
  • Fixes links (#markdown-plugins, #switching-to-the-unified-processor, and #using-remark-and-rehype-plugins are gone)
  • Rewords "Options inherited from Markdown config" in the MDX integration where "is more" sounds wrong now that other options are deprecated, and the parentheses sounds useless.
  • Rewords a sentence in MDX's "processor" to avoid repeats.
Before After
TOC of the live version Updated TOC

Note

Finding generic terms for plugins might require some brainstorming (related to my discussion with Ema in #14277 (review)). At the moment, I chose:

  • "Markdown processor plugins" as umbrella for both remark/mdast and rehype/hast plugins
  • "mdast plugins" for remark/mdast plugins
  • "hast plugins" for rehype/hast plugins

This reuses Sätteri names but... I also think they are the most accurate (remark operates on MDAST/rehype operates on HAST). I don't think "Markdown-tree plugins" and "HTML-tree plugins" are better, and this sounds a bit redundant with the "definition". And, because Sätteri is now the default, it might not be a problem to reuse Sätteri vocabulary.

To merge with a Lunaria directive:

@lunaria-track:src/content/docs/en/**.mdx

References

@astrobot-houston

astrobot-houston commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

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/guides/upgrade-to/v5.mdx Source changed, localizations will be marked as outdated.
en/guides/upgrade-to/v7.mdx Source changed, localizations will be marked as outdated.
en/recipes/external-links.mdx Source changed, localizations will be marked as outdated.
en/recipes/modified-time.mdx Source changed, localizations will be marked as outdated.
en/recipes/reading-time.mdx Source changed, localizations will be marked as outdated.
en/reference/configuration-reference.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.
es/guides/migrate-to-astro/index.mdx Localization changed, will be marked as complete.
pl/guides/migrate-to-astro/index.mdx Localization changed, will be marked as complete.
pt-br/recipes/external-links.mdx Localization changed, will be marked as complete.
pt-br/recipes/modified-time.mdx Localization changed, will be marked as complete.
pt-br/recipes/reading-time.mdx Localization changed, will be marked as complete.
ru/guides/migrate-to-astro/index.mdx Localization changed, will be marked as complete.
ru/guides/upgrade-to/v5.mdx Localization changed, will be marked as complete.
zh-tw/guides/migrate-to-astro/index.mdx Localization changed, will be marked as complete.
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.

@github-actions

github-actions Bot commented Jul 23, 2026 •

Copy link
Copy Markdown

Preview deployment

✅ Deployment complete!

@github-actions github-actions Bot added the i18n Anything to do with internationalization & translation efforts - ask @YanThomas for help! label Jul 27, 2026
@ArmandPhilippot
ArmandPhilippot marked this pull request as ready for review July 29, 2026 23:00

@delucis delucis left a comment

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.

Incredible work here @ArmandPhilippot! The Sätteri/Unified tabs are super helpful and clear.

I’ve read through and left some comments. I think some of the stuff I picked up on was already present, so your changes are already very much #NWTWWHB but felt like a natural moment to improve these too. Feel free to move changes into a follow-up PR if that would be easier.

Comment on lines +212 to +220
## Markdown processors

Astro applies [GitHub-Flavored Markdown](https://github.github.com/gfm/) and [SmartyPants](https://daringfireball.net/projects/smartypants/) automatically. This brings some niceties like generating clickable links from text, and formatting for quotations and em-dashes.
<p><Since v="6.4.0" /></p>

You can extend Markdown processing with plugins, enable additional parser features, or [switch to a different processor entirely](#switching-to-the-unified-processor). See the full list of [Markdown configuration options](/en/reference/configuration-reference/#markdown-options).
A Markdown processor parses Markdown syntax and renders it into HTML. It can offer [built-in features](#built-in-features) or accept [plugins](#markdown-processor-plugins) to extend Markdown's capabilities.

### Choosing a Markdown processor
Astro provides two official processors, [Sätteri](https://satteri.bruits.org/) and [Unified](https://unifiedjs.com/). You can configure a processor for your entire project or choose a different processor for Markdown and MDX files.

The [`markdown.processor` option](/en/reference/configuration-reference/#markdownprocessor) controls which engine renders your `.md` and `.mdx` files. Astro provides two official options:
Since Astro v7, Sätteri is the default Markdown processor. You can use it to render Markdown and MDX files without any installation or configuration according to your project's needs.

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.

Great work improving this 👏

@ArmandPhilippot

Copy link
Copy Markdown
Member Author

Thanks for the suggestions! This sounds like great calls to me. 🙌🏽 I'm going to apply the simplest changes now, and I'll update the rest tomorrow or Monday.

@trueberryless trueberryless left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Really amazing improvements here. Thank you Armand!

I looked over some files, have to jump on the plane now. But overall looks really solid. Just left some first nitpicks 👍

};
```

### markdown.processor

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It would be really cool if we could somehow use the Sätteri/Unified tabs here as well. I am not sure if this is possible with our current setup / autogeneration of this file. 🤔

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.

Yeah, there are a couple of things we could improve on that page (e.g. inline code in headings, add links to the "See also:") but I don't think that is easy to do.


Astro provides [Markdown configuration options](/en/reference/configuration-reference/#markdown-options) that allow you to control [syntax highlighting](/en/guides/syntax-highlighting/) and the Markdown processor. Additionally, each Markdown processor offers [configurable features](#built-in-features) and allows you to [add plugins](#markdown-processor-plugins) to customize the Markdown rendering.

<MarkdownProcessorTabs>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I really like the new structure and wording in the whole file here. Well done 👏

One little general nitpick: With these tabs, I find it difficult to guide people exactly to the right point for how to configure e.g. Unified specifically, because they have to find the tab switcher themselves. This might not be clear to everyone. I am not sure if it is possible to "pre-select" the right tab with HTML fragments. And in general, I think this might not be that big of a deal -- I might just not be used to it yet 😅

}
}
```
The following example applies [`satteri-imgattr`](https://www.npmjs.com/package/satteri-imgattr) and [`satteri-callouts`](https://www.npmjs.com/package/satteri-callouts) to Markdown files:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We could also link to npmx here 👀
(but we can discuss it in a follow-up PR; I would be happy to replace some links if desired).

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.

We don't use npmx in docs, so this sounds unrelated to this PR (ie. no need to bring inconsistency here). And although I consider npmx a great initiative, I think it would cause confusion among many users, as most of them are used to browsing npmjs and see it as the official npm registry.

Co-authored-by: Felix Schneider <[email protected]>

@delucis delucis left a comment

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.

Once again, stellar work @ArmandPhilippot 👏

Thanks for taking such care to consider how to improve these docs across the board.

@ArmandPhilippot

Copy link
Copy Markdown
Member Author

Thanks for the reviews! 💜

I just opened withastro/astro#17661 in the core repo to apply the Config reference changes.

(No rush! I have to go, so I'll merge this PR later and this doesn't need to wait for the core PR)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

i18n Anything to do with internationalization & translation efforts - ask @YanThomas for help!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants