ehome-react-markdown-loader
React backend for ehome-markdown-loader
Last updated 2 years ago by ehome .
MIT · Original npm · Tarball · package.json
$ cnpm install ehome-react-markdown-loader 
SYNC missed versions from official npm registry.

ehome-react-markdown-loader

ehome-markdown-loader 的输出转化成React组件

使用方法

作为 webpack loader 使用

{
	module: {
		rules: [
			{
			test: /\.md$/,
			use: [
				'babel-loader',
				{
					loader: require.resolve('react-markdown-doc-loader'),
					options: {
						jsTemplate: path.join(__dirname, './react-template.js'),
						renderers: {
							markdown: 'Markdown',
							style: 'Style',
							demo: 'Demo'
						}
					}
				}
				'markdown-doc-loader'
			]
			}
		]
	}
}

选项

  • jsTemplate: js 模板的路径
  • renderers: 不同类型片段组件名

jsTemplate可使用以下属性:

  • SECTIONS: 文件的所有片段,包括 styledemomarkdown Styles 是编译后的css demos 是返回React节点的代码片段 markdowns 是编译后的html

  • IMPORTS: 所有引入的demo

  • DEMO_DECLARATIONS: demo的声明

示例请参见 demo/template.js.

Current Tags

  • 1.0.4                                ...           latest (2 years ago)

5 Versions

  • 1.0.4                                ...           2 years ago
  • 1.0.3                                ...           2 years ago
  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 1
This Week 1
This Month 5
Last Day 0
Last Week 1
Last Month 24
Dependencies (22)
Dev Dependencies (0)
None
Dependents (1)

Copyright 2014 - 2016 © taobao.org |