react-code-markdown-loader
这是一个`webpack-loader`,它能够将`markdown`文件解析为React组件。
Last updated 3 months ago by nicokam .
ISC · Original npm · Tarball · package.json
$ cnpm install react-code-markdown-loader 
SYNC missed versions from official npm registry.

react-code-markdown-loader

这是一个webpack-loader,它能够将markdown文件解析为 React 组件。

组件的功能和目前许多的markdown-loader类似,但该loader不同的是,它更倾向于包含源码的文档渲染。

如果你的 markdown 文件的目录中,包含 demo 子目录,该loader可以自动扫描目录下的所有md文件,并将它们引入到该文档中。

Usage

webpack.config.js:

export default = {
  module: {
    rules: [
      {
        test: /\.md?$/,
        use: [
          'babel-loader',
          {
            'react-code-markdown-loader',
            options: {
              // auto scan demo/*.md
              autoScanDemo: true,
              // Wrapper will contain the md-doc jsx
              markdownWrapper: 'path/to/your/wrapper',
              // add custom props to your Wrapper: <MarkdownWrapper nav={idList} wrapperProp="value" >{markdownJSX}</MarkdownWrapper>
              markdownWrapperProps: ['nav={idList}', 'wrapperProp="value"'],
            },
          },
        ],
      },
      // ...other rules
    ]
  }
  // ...other config
}

Options

markdownWrapper

自定义 Markdown 包裹组件,可用自定义样式覆盖

markdownWrapperProps

添加自定义属性到你的MarkdownWrapper上

autoScanDemo

是否自动扫描 demo 目录的文档并自动加入解析

Current Tags

  • 0.0.25                                ...           latest (a month ago)

25 Versions

  • 0.0.25                                ...           a month ago
  • 0.0.24                                ...           a month ago
  • 0.0.23                                ...           a month ago
  • 0.0.22                                ...           a month ago
  • 0.0.21                                ...           a month ago
  • 0.0.20                                ...           2 months ago
  • 0.0.19                                ...           2 months ago
  • 0.0.18                                ...           2 months ago
  • 0.0.17                                ...           2 months ago
  • 0.0.16                                ...           2 months ago
  • 0.0.15                                ...           2 months ago
  • 0.0.14                                ...           2 months ago
  • 0.0.13                                ...           3 months ago
  • 0.0.12                                ...           3 months ago
  • 0.0.11                                ...           3 months ago
  • 0.0.10                                ...           3 months ago
  • 0.0.9                                ...           3 months ago
  • 0.0.8                                ...           3 months ago
  • 0.0.7                                ...           3 months ago
  • 0.0.6                                ...           3 months ago
  • 0.0.5                                ...           3 months ago
  • 0.0.4                                ...           3 months ago
  • 0.0.3                                ...           3 months ago
  • 0.0.2                                ...           3 months ago
  • 0.0.1                                ...           3 months ago

Copyright 2014 - 2016 © taobao.org |