@schornio/markdown-util
v0.8.0
Published
Opinionated markdown utilities. Also for next.js.
Downloads
13
Readme
@schornio/markdown-util
Opinionated markdown utilities. Also for next.js.
Installation
npm install @schornio/markdown-util
Usage
import { Markdown } from "@schornio/markdown-util";
export function MyComponent({ text }: { text: string }) {
return <Markdown>{text}</Markdown>;
}
Usage with next.js
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>
);
}
Publish new version
npm run build
npm version major, minor, patch
npm pack
npm publish --access public