0.0.1-alpha.1 • Published 1 year ago

astro-markdoc-renderer v0.0.1-alpha.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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