fxtext-react

0.1.5 • Public • Published

fxtext-react

A React component that retrieves an article from the fx(hash) API and converts Markdown to JSX

From your CLI:

npm install fxtext-react

Usage:

//App.jsx
...
import FxArticle from 'fxtext-react'

export default function() {
  //this will retrieve the article available at fxhash.xyz/article/example 
  const [slug, setSlug] = useState('example')

  return (
    <div>
      <FxArticle slug='{slug}' />
    </div>
  )
  ...
}

The Article contains the article's title, description, and body.

To style in CSS, the respective class names live under the fx-article container as fx-article-title, fx-article-desc, and fx-article-body

To keep things clean, I've left out any highlighting for code blocks. If you'd like, highlight.js is my recommended solution for highlighting syntax.

Dependencies (2)

Dev Dependencies (4)

Package Sidebar

Install

npm i fxtext-react

Weekly Downloads

1

Version

0.1.5

License

MIT

Unpacked Size

4.54 kB

Total Files

3

Last publish

Collaborators

  • tophercully