1.0.10 • Published 9 years ago
zandoc-react-loader v1.0.10
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,demoandmarkdown. Styles are compiled to css withprecssdemos 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.