astro-markdoc-renderer
TypeScript icon, indicating that this package has built-in type declarations

0.0.1-alpha.1 • Public • Published

Astro Markdoc Renderer

Markdoc renderer for Astro.

Install

yarn add astro-markdoc-renderer

Usage

---
import { MarkdocRenderer } from "astro-markdoc-renderer";
import type { Content } from "astro-markdoc-renderer";
import HeadingOne from "./HeadingOne.astro";
import YouTubeEmbed from "./YouTubeEmbed.astro";

type Props = {
  content: Content;
};

const { content } = Astro.props;

const components = {
  // custom tag
  YouTubeEmbed: {
    Component: YouTubeEmbed,
    props: {},
  },
  // <h1> tag
  h1: {
    Component: HeadingOne,
    props: {},
  },
};
---

<MarkdocRenderer content={content} components={components} />

License

MIT © Dinesh Pandiyan

Package Sidebar

Install

npm i astro-markdoc-renderer

Weekly Downloads

163

Version

0.0.1-alpha.1

License

MIT

Unpacked Size

10.1 kB

Total Files

15

Last publish

Collaborators

  • flexdinesh