This will allow us to load Markdown into React components. Then you can do something like
var Content = require('./content.md');
...
<Content>
Actually we can probably generalize on this through templating and do even
...
<Content date={17.07.15}>
Those props could be passed put through something like Handlebars before passing to Markdown. I'm not sure if we want templating yet but it seems this approach would allow that if we need it.
In any case this makes user code much nicer and hides those ugly dangerouslySetInnerHTML declarations effectively.
I pushed this to a Markdown component. Usage: <Markdown file={require('./index.md')} />. I tried the proposed interface but that breaks require resolution. There might be some way to fix that perhaps but this is good enough for now.
I got this idea from @gwil. We can simply do something like this:
This will allow us to load Markdown into React components. Then you can do something like
Actually we can probably generalize on this through templating and do even
Those props could be passed put through something like Handlebars before passing to Markdown. I'm not sure if we want templating yet but it seems this approach would allow that if we need it.
In any case this makes user code much nicer and hides those ugly
dangerouslySetInnerHTML
declarations effectively.