# @mdxvac/remark-astro-rawmdx

> Remark plugin to add the raw MDX content to the frontmatter's 'mdx' property

Latest version **0.0.2** (published 2022-09-22) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @mdxvac/remark-astro-rawmdx
pnpm add @mdxvac/remark-astro-rawmdx
yarn add @mdxvac/remark-astro-rawmdx
bun add @mdxvac/remark-astro-rawmdx
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2022-09-22 |
| First published | 2022-09-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 4.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | christian@hackyourshack.org |
| Maintainers | shackhacker-christian |
| Keywords | remark-plugin, astro, mdx, raw, frontmatter |

## Links

- npm: https://www.npmjs.com/package/@mdxvac/remark-astro-rawmdx
- Repository: https://github.com/mdxvac/mdxvac.git#main
- Homepage: https://mdxvac.netlify.app/
- Issues: https://github.com/mdxvac/mdxvac/issues
- npm.io page: https://npm.io/package/@mdxvac/remark-astro-rawmdx

## Dependencies (1)

- [@mdxvac/mdx-utils](https://npm.io/package/@mdxvac/mdx-utils.md) 0.0.2

## Alternatives

- [@mdxeditor/editor](https://npm.io/package/@mdxeditor/editor.md) — 962.4K weekly downloads
- [mmdb-lib](https://npm.io/package/mmdb-lib.md) — 680.9K weekly downloads
- [playcanvas](https://npm.io/package/playcanvas.md) — 36.2K weekly downloads
- [@glw907/cairn-cms](https://npm.io/package/@glw907/cairn-cms.md) — 967 weekly downloads
- [markdown-to-confluence](https://npm.io/package/markdown-to-confluence.md) — 103 weekly downloads

## Recent versions

- 0.0.2 (latest) — 2022-09-22
- 0.0.1 — 2022-09-20

## README

# @mdxvac/remark-astro-rawmdx

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

[MDX Vacuum](https://mdxvac.netlify.app) is a set of plugins allowing you to define an [Astro](https://astro.build) 🚀 publishing pipeline for Markdown/MDX documents with full [MDX](https://mdxjs.com) 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](https://www.npmjs.com/org/mdxvac).

## Content

- [What is this?](#what-is-this)
- [When should I use this?](#when-should-i-use-this)
- [Install](#install)
- [Use](#use)
  - [Options](#options)

## What is this?

This package is a [`remark`](https://github.com/remarkjs/remark/blob/main/doc/plugins.md) plugin to add the raw markdown content to the frontmatter of your MDX files in the context of [Astro](https://docs.astro.build/en/guides/integrations-guide/mdx/#remarkplugins) 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](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c).
In Node.js (version 12.20+, 14.14+, or 16.0+), install with `npm`:

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

## Use

In your `astro.config.mjs`

```js
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:

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

---
_Source: https://npm.io/package/@mdxvac/remark-astro-rawmdx · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
