Skip to content

schornio/markdown-util

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published