1.2.1 • Published 6 years ago

remark-jsx v1.2.1

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

React Rocks!

remark-jsx

Embed working React components within markdown. yayayayayayayayayaya!

So this is a small library of utility methods that I use within my storybook addon. This is where the majority of the work to convert the Markdown strings into Hyperscript.

DSLs

It's much easier to understand code if the namespace just tells you what you're doing. Taking some ideas from the Chai DSL I've created one similar. The chaning here is superficial (ie: the .to is not a method).

This is just a large object so you could destructure and you can access methods directly if you prefer not to have to follow the full path. More on that later.

  • convert.markdown.to.react
  • convert.props.to.table
  • convert.mdast.to.hast
  • convert.html.to.ast
  • convert.markdown.to.react
  • convert.props.to.table
  • convert.mdast.to.hast

Notes

Currently needs to be built so that it can be used as a proper package as it is using React and JSX within and needs to be converted to ES5 for proper use. That is incoming.

TODO

  • Style the <Wrapper /> better
  • Fix code so that not ALL code is wrapped
  • Build so it can be used as a proper package.
  • Tests
  • Export npm package
  • Add a <Wrapper />