0.2.11-alpha • Published 2 years ago

@f-ui/markdown v0.2.11-alpha

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Fabric-UI Markdown

A Markdown processor built from scratch to work with React.

Installation

// with npm
npm i @f-ui/markdown

// with yarn
yarn add @f-ui/markdown

Usage

You can send any Markdown string text to the useMarkdown hook. In this example the useGithubFile is being used to fetch a github-hosted MD file.

import React from 'react';
import ReactDOM from 'react-dom';
import {Markdown, useGithubFile, useMarkdown} from "@f-ui/markdown"

function App() {
    const markdownText = useGithubFile({
      user: 'myself',
      repo: 'myRepo',
      branch: 'myBranch',
      filePath: '/path/to/file.md'
    })

    const mdHook = useMarkdown(markdownText)

    return (
      <Markdown hook={mdHook}/>
  );
}

ReactDOM.render(<App/>, document.querySelector('#app'));

Dependencies

PackageVersionNPMGithub
prop-types^15.7.2npm i prop-typeshttps://github.com/facebook/prop-types
@f-ui/corelatestnpm i @f-ui/corehttps://github.com/fabric-ui/fabric-ui

Documentation and examples

Coming soon.

Roadmap

  1. Bug fixes.
  2. Support for more languages on the code-block.
  3. Support for all the basic and extended MD syntax.