Skip to content

Commit

Permalink
docs: add migration
Browse files Browse the repository at this point in the history
  • Loading branch information
bholmesdev committed Jan 2, 2023
1 parent 6c8a5e4 commit 2d5a774
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .changeset/shaggy-keys-turn.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,48 @@ Refine Markdown and MDX configuration options for ease-of-use.

- Support _all_ Markdown configuration options (except `drafts`) from your MDX integration config. This includes `syntaxHighlighting` and `shikiConfig` options to further customize the MDX renderer.
- Simplify `extendDefaults` to an `extendMarkdownConfig` option. MDX options will default to their equivalent in your Markdown config. By setting `extendMarkdownConfig` to false, you can "eject" to set your own syntax highlighting, plugins, and more.

## Migration

To preserve your existing Markdown and MDX setup, you may need some configuration changes:

### Smartypants manual installation

[Smartypants](https://github.com/silvenon/remark-smartypants) has been removed from Astro's default setup. If you rely on this plugin, [install `remark-smartypants`](https://github.com/silvenon/remark-smartypants#installing) and apply to your `astro.config.*`:

```diff
// astro.config.mjs
import { defineConfig } from 'astro/config';
+ import smartypants from 'remark-smartypants';

export default defineConfig({
markdown: {
+ remarkPlugins: [smartypants],
}
});
```

### Migrate `extendDefaultPlugins` to `githubFlavoredMarkdown`

You may have disabled Astro's built-in plugins (GitHub-Flavored Markdown and Smartypants) with the `extendDefaultPlugins` option. Since Smartypants has been removed, this has been renamed to `githubFlavoredMarkdown`.

```diff
// astro.config.mjs
import { defineConfig } from 'astro/config';

export default defineConfig({
markdown: {
- extendDefaultPlugins: false,
+ githubFlavoredMarkdown: false,
}
});
```


Additionally, applying remark and rehype plugins **no longer disables** `githubFlavoredMarkdown`. You will need to opt-out manually by setting `githubFlavoredMarkdown` to `false`.

### Migrate MDX's `extendPlugins` to `extendMarkdownConfig`

You may have used the `extendPlugins` option to manage plugin defaults in MDX. This has been replaced by 2 flags:
- `extendMarkdownConfig` (`true` by default) to toggle Markdown config inheritance. This replaces the `extendPlugins: 'markdown'` option.
- `githubFlavoredMarkdown` (`true` by default) to toggle GitHub-Flavored Markdown in MDX. This replaces the `extendPlugins: 'defaults'` option.

0 comments on commit 2d5a774

Please sign in to comment.