Home

Awesome

<h1 align='center'>Yoshino-Docs</h1> <p align='center'>Based on Yoshino!Auto genearte component docs!</p>

Intro

一个使用yoshino组件组件库构建的文档生成工具

在线示例

Usage

git clone https://github.com/Yoshino-UI/yoshion-docs.git your-rep

cd your-rep

npm i

// 启动开发环境
npm run dev

// 打包
npm run build

Config

docs/pages/routers.tsx

配置路由进行分块打包

export default [
  {
    component: getComponentAsyncLoading(
      () => import(/* webpackChunkName: "yoshino-alert" */ './Alert')
    ),
    path: '/docs/components/alert',
  },
];

在数组里添加组件文档文件,import分块引入对应文件,path对应路由路径。

docs/pages/pageMenu.tsx

export default [
  {
    name: '反馈',
    keyId: 'feedback',
    children: [
      {
        name: 'Alert(提示)',
        keyId: 'alert',
      },
    ]
  }
];

配置左侧菜单列

Example

添加一个新的组件的文档步骤

export default [
  {
    component: getComponentAsyncLoading(
      () => import(/* webpackChunkName: "yoshino-alert" */ './Alert')
    ),
    path: '/docs/components/alert',
  },
  {
    component: getComponentAsyncLoading(
      () => import(/* webpackChunkName: "yoshino-buttom" */ './Button')
    ),
    path: '/docs/components/button',
  },
];
export default [
  {
    name: '反馈',
    keyId: 'feedback',
    children: [
      {
        name: 'Alert(提示)',
        keyId: 'alert',
      },
      {
        name: 'Button(按钮)',
        keyId: 'button',
      },
    ]
  }
];

如果不想添加到反馈模块下,可以自己新建一个模块,修改如下

export default [
  {
    name: '反馈',
    keyId: 'feedback',
    children: [
      {
        name: 'Alert(提示)',
        keyId: 'alert',
      },
    ]
  },
  {
    name: '新模块',
    keyId: 'newModule',
    children: [
      {
        name: 'Button(按钮)',
        keyId: 'button',
      },
    ]
  }
];
import Demo from './demo/demo';
import * as DemoMd from './demo/demo.md';
const DemoCode = require('!raw-loader!./demo/demo');

<CodeBox text={DemoMd} demo={<Demo/>} code={DemoCode}/>