如何将简单文档与React Styleguidist混合在一起

时间:2018-02-05 21:52:22

标签: reactjs documentation react-styleguidist

我想用markdown记录我的代码库的其他功能和部分,并将它们解析并显示在我的文档的不同部分。我怎么能这样做?

/**
 * Merge route into the global application state
 */ 
export const reducer = (state = initialState, action) => {

将它们直接导入styleguide.config.js会导致整个文件被解析为文本。

1 个答案:

答案 0 :(得分:0)

使用documentation.js等工具的

Generate Markdown文档,然后将这些文件as sections包含到Styleguidist中:

module.exports = {
  sections: [
    {
      name: 'Some other API',
      content: 'docs/generated-file.md'
    },
    {
      name: 'Components',
      components: 'lib/components/**/*.js'
    }
  ]
}