fxtext-react
written by Chris McCully
Import node package:
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>
)
...
}
Support is currently limited to Markdown Text, Images, Code, Tables, and Lists.
Support missing, but on the roadmap, includes: Tezos content pointers, Video embeds, Youtube and Spotify embeds, LaTeX math
The Article contains the article's ,
, and ``.
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 lighter, I've left out any highlighting for code blocks. If you'd like, highlight.js is my recommended solution for highlighting syntax.
Examples
Image(file):
Image(url):
Table:
Header | HeaderB |
---|---|
Content | ContentB |
Video(file):
Video(youtube)
Spotify Embed:
Tezos Content(Currently Unsupported):
project name project name project name
List:
- item
- item
- item
const myFunction = () => {
return(
<div className="article-container">
<h1>{article.title}</h1>
<h3>{article.description}</h3>
<br></br>
<Markdown className='article'>{article.body}</Markdown>
</div>
)
}
Math(LaTeX):
E=mc2project name project name project name
This article is hosted on my website using this very component: chrismccully.com/blog
50% of this article's proceeds are donated to Girls Who Code