This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@mdxvac/remark-astro-rawmdx
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

@mdxvac/remark-astro-rawmdx

remark plugin to add the raw markdown content to the frontmatter of your Astro MDX files (property rawmdx).

MDX Vacuum is a set of plugins allowing you to define an Astro 🚀 publishing pipeline for Markdown/MDX documents with full MDX features, but without the technical fuss, i.e. you and your non-tech editors can write clean markdown.

Have a look at the other mdxvac plugins.

Content

What is this?

This package is a remark plugin to add the raw markdown content to the frontmatter of your MDX files in the context of Astro site generation.

When should I use this?

Astro MDX files do not carry the raw MDX content anymore, once you import them. With this plugin you can access the raw content in the frontmatter mdx property.

Use this plugin, if you want to have access to the raw MDX content while generating your Astro pages.

Install

This package is ESM only. In Node.js (version 12.20+, 14.14+, or 16.0+), install with npm:

npm install -D @mdxvac/remark-astro-rawmdx

Use

In your astro.config.mjs

import { defineConfig } from 'astro/config';

import mdx from '@astrojs/mdx';
import rawMdx from '@mdxvac/remark-astro-rawmdx';
//                  ^^^

// https://astro.build/config
export default defineConfig({
  integrations: [mdx()],
  markdown: {
    remarkPlugins: [rawMdx],
    //              ^^^
    extendDefaultPlugins: true,
  },
});

This uses the default options, where the name of the property on the frontmatter is rawmdx.

Options

If you want to use a different name for the property, you can specify it in the plugin's property option like so:

remarkPlugins: [[rawMdx, {property: "raw"}]],

Package Sidebar

Install

npm i @mdxvac/remark-astro-rawmdx

Weekly Downloads

0

Version

0.0.2

License

MIT

Unpacked Size

4.57 kB

Total Files

4

Last publish

Collaborators

  • shackhacker-christian