Opinionated markdown utilities. Also for next.js.
npm install @schornio/markdown-util
import { Markdown } from "@schornio/markdown-util";
export function MyComponent({ text }: { text: string }) {
return <Markdown>{text}</Markdown>;
}
It uses next/image
to render images and next/link
to render links.
Optionally, you can pass headingTopLevel
and imageHeight
and imageWidth
to the Markdown
component.
import { Markdown } from "@schornio/markdown-util/next";
export function MyComponent({ text }: { text: string }) {
return (
<Markdown headingTopLevel={1} imageHeight={400} imageWidth={600}>
{text}
</Markdown>
);
}
npm run build
npm version major, minor, patch
npm pack
npm publish --access public