[](https://npm.im/@studiocms/markdown-remark-processor) [

@studiocms/markdown-remark-processor is a powerful Markdown parser and transformer built on top of remark. It provides seamless integration with Astro, allowing you to easily parse and transform Markdown content within your Astro projects.
This project is heavily based on and compatible with Astro's built-in @astrojs/markdown-remark
- Markdown Parsing: Parse Markdown content into an abstract syntax tree (AST) using remark.
- Custom Plugins: Extend the functionality with custom remark plugins.
- Configurable: Highly configurable to suit your specific needs.
To install @studiocms/markdown-remark-processor, use your preferred package manager:
``bash`
npm install @studiocms/markdown-remark-processoror
yarn add @studiocms/markdown-remark-processoror
pnpm add @studiocms/markdown-remark-processor
First setup your render function
src/utils/render.ts
`ts
import { type MarkdownProcessorRenderOptions, createMarkdownProcessor } from '@studiocms/markdown-remark-processor';
const processor = await createMarkdownProcessor({
/*
* Your Options here
* same as https://docs.astro.build/en/reference/configuration-reference/#markdown-options
*/
});
export async function render(
content: string,
options?: MarkdownProcessorRenderOptions
) {
const result = await processor.render(content, options);
return {
html: result.astroHTML,
meta: result.metadata,
};
}
`
Then use it!
/src/pages/index.astro
`astro
---
import { render } from '../utils/render';
const content = # Hello world!
const { html } = await render(content)
---
See the Changelog for the change history of this package.
If you see any errors or room for improvement, feel free to open an issue or pull request . Thank you in advance for contributing! ❤️