mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-29 13:47:02 +08:00
4cdf37bedb
* init form * first demo * add normal login * add style * webit * support nest errors * beauti form errors * use onReset * modal demo * add list demo * match key of errors logic * date demo * customize component * moving style * add status style * without form create * add demos * add inline style * clean up legacy * fix drawer demo * mention * fix edit-row * editable table cell * update mentions demo * fix some test case * fix upload test * fix lint * part of doc * fix ts * doc update * rm react 15 * rm config * enhance test coverage * clean up * fix FormItem context pass logic * add more demo * en to build * update demo * update demo & snapshot * more doc * update list doc * update doc * update demo to display condition render * update snapshot * add provider doc * support configProvider * more doc about validateMessages * more description * more and more doc * fix typo * en doc * Form.List doc * m v3 -> v4 * add skip
117 lines
2.7 KiB
JavaScript
117 lines
2.7 KiB
JavaScript
const path = require('path');
|
|
|
|
const homeTmpl = './template/Home/index';
|
|
const contentTmpl = './template/Content/index';
|
|
const redirectTmpl = './template/Redirect';
|
|
const appShellTmpl = './template/AppShell';
|
|
|
|
function pickerGenerator(module) {
|
|
const tester = new RegExp(`^docs/${module}`);
|
|
return markdownData => {
|
|
const { filename } = markdownData.meta;
|
|
if (tester.test(filename) && !/\/demo$/.test(path.dirname(filename))) {
|
|
return {
|
|
meta: markdownData.meta,
|
|
};
|
|
}
|
|
return null;
|
|
};
|
|
}
|
|
|
|
module.exports = {
|
|
lazyLoad(nodePath, nodeValue) {
|
|
if (typeof nodeValue === 'string') {
|
|
return true;
|
|
}
|
|
return nodePath.endsWith('/demo');
|
|
},
|
|
pick: {
|
|
components(markdownData) {
|
|
const { filename } = markdownData.meta;
|
|
if (!/^components/.test(filename) || /[/\\]demo$/.test(path.dirname(filename))) {
|
|
return null;
|
|
}
|
|
return {
|
|
meta: markdownData.meta,
|
|
};
|
|
},
|
|
changelog(markdownData) {
|
|
if (/CHANGELOG/.test(markdownData.meta.filename)) {
|
|
return {
|
|
meta: markdownData.meta,
|
|
};
|
|
}
|
|
return null;
|
|
},
|
|
'docs/pattern': pickerGenerator('pattern'),
|
|
'docs/react': pickerGenerator('react'),
|
|
'docs/resource': pickerGenerator('resource'),
|
|
'docs/spec': pickerGenerator('spec'),
|
|
},
|
|
plugins: [
|
|
'bisheng-plugin-description',
|
|
'bisheng-plugin-toc?maxDepth=2&keepElem',
|
|
'bisheng-plugin-antd?injectProvider',
|
|
'bisheng-plugin-react?lang=__react',
|
|
],
|
|
routes: {
|
|
path: '/',
|
|
component: './template/Layout/index',
|
|
indexRoute: { component: homeTmpl },
|
|
childRoutes: [
|
|
{
|
|
path: 'app-shell',
|
|
component: appShellTmpl,
|
|
},
|
|
{
|
|
path: 'index-cn',
|
|
component: homeTmpl,
|
|
},
|
|
{
|
|
path: 'docs/pattern/:children',
|
|
component: redirectTmpl,
|
|
},
|
|
{
|
|
path: 'docs/react/:children',
|
|
component: contentTmpl,
|
|
},
|
|
{
|
|
path: 'changelog',
|
|
component: contentTmpl,
|
|
},
|
|
{
|
|
path: 'changelog-cn',
|
|
component: contentTmpl,
|
|
},
|
|
{
|
|
path: 'components/form/v3',
|
|
component: contentTmpl,
|
|
},
|
|
{
|
|
path: 'components/form/v3-cn',
|
|
component: contentTmpl,
|
|
},
|
|
{
|
|
path: 'components/:children/',
|
|
component: contentTmpl,
|
|
},
|
|
{
|
|
path: 'docs/spec/feature',
|
|
component: redirectTmpl,
|
|
},
|
|
{
|
|
path: 'docs/spec/feature-cn',
|
|
component: redirectTmpl,
|
|
},
|
|
{
|
|
path: 'docs/spec/:children',
|
|
component: contentTmpl,
|
|
},
|
|
{
|
|
path: 'docs/resource/:children',
|
|
component: redirectTmpl,
|
|
},
|
|
],
|
|
},
|
|
};
|