0.1.1 • Published 4 years ago

@osequi/use-markdown v0.1.1

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

use-markdown

A React hook to load Markdown files.

Features

  • Loads a markdown file then parses with marked.
  • Returns the parsed markdown.

Demo

Install

# Using yarn
yarn add @osequi/use-markdown

# or, using npm
npm i @osequi/use-markdown

Usage

// demo/src/App.js
import useMarkdown from "use-markdown";
import readme from "./README.md";

const App = () => {
  const { markdown } = useMarkdown(readme);
  const html = <div dangerouslySetInnerHTML={{ __html: markdown }} />;

  return <>{html}</>;
};

Test

In /demo there is a Create React App.

Changelog

Please check CHANGELOG.md.

Generated with Unleash using Conventional changelog and Semantic versioning.