zandoc-react-loader
v1.0.10
Published
React loader for zandoc-loader
Downloads
12
Maintainers
Readme
zandoc-react-loader
A webpack loader to convert zandoc-loader
's output to React component.
Usage
Use as a webpack loader
{
module: {
rules: [
{
test: /\.md$/,
use: [
'babel-loader',
'zandoc-react-loader',
'zandoc-loader'
]
}
]
}
}
Options
jsTemplate
: path to js template file, usesbabel-template
.
Note: babel-generator
has trouble with jsx generation, it will escape
all unicode sequences resulting in incorrect jsx code.
Available properties in the template:
SECTIONS
: All sections in the file,style
,demo
andmarkdown
. Styles are compiled to css withprecss
demos are code fragments that return a React node markdowns are compiled to htmlIMPORTS
: All imports from demosDEMO_DECLARATIONS
: Declarations for demos
Take a look at sample/template.js
.