Skip to content

Commit

Permalink
update markdown configuration docs
Browse files Browse the repository at this point in the history
  • Loading branch information
thescientist13 committed Dec 31, 2024
1 parent 0547162 commit 34bfef5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
8 changes: 3 additions & 5 deletions src/pages/docs/reference/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export default {
layoutsDirectory: "layouts", // e.g. ./src/layouts
markdown: {
plugins: [],
settings: {},
},
optimization: "default",
pagesDirectory: "pages", // e.g. ./src/pages
Expand Down Expand Up @@ -146,15 +145,14 @@ export default {
## Markdown
You can install and provide custom **unifiedjs** [presets](https://github.com/unifiedjs/unified#preset) and [plugins](https://github.com/unifiedjs/unified#plugin) to further customize and process [your markdown](/docs/resources/markdown/) past what Greenwood does by default.
You can install [**remark**](https://remark.js.org/) or [**rehype**](https://github.com/rehypejs/rehype) compatible plugins to extend Greenwood's markdown rendering and transformation capabilities by passing them as an array to the `markdown` setting.
For plugins, after installing their packages, you can provide their names to Greenwood:
After installing the package, pass the plugin name as a string:
```js
export default {
markdown: {
settings: { commonmark: true },
plugins: ["rehype-slug", "rehype-autolink-headings"],
plugins: ["rehype-slug", "remark-gfm"],
},
};
```
Expand Down
5 changes: 1 addition & 4 deletions src/pages/docs/resources/markdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,14 @@ In this section we'll cover some of the Markdown related feature of **Greenwood*

## Plugins

Using your _greenwood.config.js_ you can have additional [markdown customizations and configurations](/docs/reference/configuration/#markdown) using unified presets and plugins.
Using your _greenwood.config.js_ you can have additional [markdown customizations and configurations](/docs/reference/configuration/#markdown).

For example, to use the [**remark-github**](https://github.com/remarkjs/remark-github) plugin:

```js
// npm i -D remark-github
export default {
markdown: {
settings: {
/* whatever you need */
},
plugins: ["remark-github"],
},
};
Expand Down

0 comments on commit 34bfef5

Please sign in to comment.