Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tophercully/fxtext-react
A React component which retrieves an article from the fx(hash) API and converts Markdown to JSX
https://github.com/tophercully/fxtext-react
Last synced: 25 days ago
JSON representation
A React component which retrieves an article from the fx(hash) API and converts Markdown to JSX
- Host: GitHub
- URL: https://github.com/tophercully/fxtext-react
- Owner: tophercully
- Created: 2023-12-12T03:19:44.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-12T21:50:11.000Z (about 1 year ago)
- Last Synced: 2024-11-16T09:09:29.036Z (about 2 months ago)
- Language: JavaScript
- Size: 22.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# fxtext-react
A React component that retrieves an article from the fx(hash) API and converts Markdown to JSXFrom your CLI:
```
npm install fxtext-react
```Usage:
```js
//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 (
)
...
}```
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.