Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/lemon-owls-end.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Improves Markdown options documentation with links to the Markdown guide and official processors.
2 changes: 1 addition & 1 deletion packages/astro/src/content/loaders/file.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { existsSync, promises as fs } from 'node:fs';
import { fileURLToPath } from 'node:url';
import yaml from 'js-yaml';
import * as yaml from 'js-yaml';
import * as toml from 'smol-toml';
import { FileGlobNotSupported, FileParserNotFound } from '../../core/errors/errors-data.js';
import { AstroError } from '../../core/errors/index.js';
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/src/core/config/settings.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'node:path';
import { fileURLToPath, pathToFileURL } from 'node:url';
import yaml from 'js-yaml';
import * as yaml from 'js-yaml';
import * as toml from 'smol-toml';
import { getContentPaths } from '../../content/index.js';
import createPreferences from '../../preferences/index.js';
Expand Down
29 changes: 22 additions & 7 deletions packages/astro/src/types/public/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2362,7 +2362,9 @@ export interface AstroUserConfig<
* @docs
* @name markdown.remarkPlugins
* @type {RemarkPlugins}
* @deprecated Pass `remarkPlugins` to `unified({ remarkPlugins })` from `@astrojs/markdown-remark` and set it as `markdown.processor` instead. Will be removed in a future major.
* @deprecated This property is deprecated and will be removed in a future major version. Pass plugins to the configured [`markdown.processor`](https://docs.astro.build/en/reference/configuration-reference/#markdownprocessor) instead.
*
* Learn more about [setting up a Markdown processor](https://docs.astro.build/en/guides/markdown-content/#setting-up-a-markdown-processor) and [using plugins](https://docs.astro.build/en/guides/markdown-content/#markdown-processor-plugins) in the Markdown guide.
* @description
* Pass [remark plugins](https://github.com/remarkjs/remark) to customize how your Markdown is built. You can import and apply the plugin function (recommended), or pass the plugin name as a string.
*
Expand All @@ -2380,7 +2382,9 @@ export interface AstroUserConfig<
* @docs
* @name markdown.rehypePlugins
* @type {RehypePlugins}
* @deprecated Pass `rehypePlugins` to `unified({ rehypePlugins })` from `@astrojs/markdown-remark` and set it as `markdown.processor` instead. Will be removed in a future major.
* @deprecated This property is deprecated and will be removed in a future major version. Pass plugins to the configured [`markdown.processor`](https://docs.astro.build/en/reference/configuration-reference/#markdownprocessor) instead.

* Learn more about [setting up a Markdown processor](https://docs.astro.build/en/guides/markdown-content/#setting-up-a-markdown-processor) and [using plugins](https://docs.astro.build/en/guides/markdown-content/#markdown-processor-plugins) in the Markdown guide.
* @description
* Pass [rehype plugins](https://github.com/remarkjs/remark-rehype) to customize how your Markdown's output HTML is processed. You can import and apply the plugin function (recommended), or pass the plugin name as a string.
*
Expand All @@ -2400,7 +2404,9 @@ export interface AstroUserConfig<
* @type {boolean}
* @default `true`
* @version 2.0.0
* @deprecated Pass `gfm` to your processor instead (e.g. `unified({ gfm: false })`). Will be removed in a future major.
* @deprecated This property is deprecated and will be removed in a future major version. Pass `gfm` to the configured [`markdown.processor`](https://docs.astro.build/en/reference/configuration-reference/#markdownprocessor) instead.

* Learn more about [setting up a Markdown processor](https://docs.astro.build/en/guides/markdown-content/#setting-up-a-markdown-processor) and [using GitHub-flavored Markdown](https://docs.astro.build/en/guides/markdown-content/#github-flavored-markdown) in the Markdown guide.
* @description
* Astro uses [GitHub-flavored Markdown](https://github.com/remarkjs/remark-gfm) by default. To disable this, set the `gfm` flag to `false`:
*
Expand All @@ -2420,7 +2426,9 @@ export interface AstroUserConfig<
* @type {boolean | Smartypants}
* @default `true`
* @version 2.0.0
* @deprecated Pass `smartypants` to your processor instead (e.g. `unified({ smartypants: false })`). Will be removed in a future major.
* @deprecated This property is deprecated and will be removed in a future major version. Pass it to the configured [`markdown.processor`](https://docs.astro.build/en/reference/configuration-reference/#markdownprocessor) instead. Use `smartypants` for `unified()` or `smartPunctuation` for `satteri()`.

* Learn more about [setting up a Markdown processor](https://docs.astro.build/en/guides/markdown-content/#setting-up-a-markdown-processor) and [using smart punctuation](https://docs.astro.build/en/guides/markdown-content/#smart-punctuation) in the Markdown guide.
* @description
* Whether to use the [SmartyPants formatter](https://daringfireball.net/projects/smartypants/) to transform straight quotes into smart quotes, dashes into en/em dashes, and triple dots into ellipses.
*
Expand All @@ -2434,7 +2442,11 @@ export interface AstroUserConfig<
* @docs
* @name markdown.remarkRehype
* @type {RemarkRehype}
* @deprecated Pass `remarkRehype` to `unified({ remarkRehype })` from `@astrojs/markdown-remark` and set it as `markdown.processor` instead. Will be removed in a future major.
* @deprecated This property is deprecated and will be removed in a future major version.

* To configure footnotes, pass `remarkRehype` to the `unified()` processor or `gfm.footnotes` to the `satteri()` processor instead. Other `remark-rehype` options are only supported when using `unified()`.

* Learn more about [setting up a Markdown processor](https://docs.astro.build/en/guides/markdown-content/#setting-up-a-markdown-processor) and [using built-in features](https://docs.astro.build/en/guides/markdown-content/#built-in-features) in the Markdown guide.
* @description
* Pass options to [remark-rehype](https://github.com/remarkjs/remark-rehype#api).
*
Expand All @@ -2455,8 +2467,9 @@ export interface AstroUserConfig<
* @type {MarkdownProcessor}
* @version 6.4.0
* @description
* Configures the Markdown processor used to render `.md` files. Defaults to `satteri()` from
* `@astrojs/markdown-satteri`, Astro's native Markdown pipeline.
* Configures the [Markdown processor](https://docs.astro.build/en/guides/markdown-content/#markdown-processors) used to render `.md` files.
*
* Sätteri, Astro’s native Markdown pipeline, is the default processor. To configure it, install `@astrojs/markdown-satteri` and pass options to `satteri()`:
*
* ```js
* // astro.config.mjs
Expand Down Expand Up @@ -2488,6 +2501,8 @@ export interface AstroUserConfig<
* },
* });
* ```
*
* Learn more about the [official Markdown processors and how to choose one](https://docs.astro.build/en/guides/markdown-content/#choosing-a-markdown-processor) in the Markdown guide.
*/
processor?: MarkdownProcessor;
};
Expand Down
2 changes: 1 addition & 1 deletion packages/internal-helpers/src/frontmatter.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import yaml from 'js-yaml';
import * as yaml from 'js-yaml';
import * as toml from 'smol-toml';

export function isFrontmatterValid(frontmatter: Record<string, any>) {
Expand Down
2 changes: 1 addition & 1 deletion packages/language-tools/vscode/scripts/build-grammar.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @ts-check
import fs from 'node:fs';
import { fileURLToPath } from 'node:url';
import yaml from 'js-yaml';
import * as yaml from 'js-yaml';
import { dim, green } from 'kleur/colors';

const dt = new Intl.DateTimeFormat('en-us', {
Expand Down
Loading