ant-design/.dumi/remarkAntd.ts

16 lines
413 B
TypeScript
Raw Permalink Normal View History

2023-09-17 23:32:14 +08:00
import { unistUtilVisit } from 'dumi';
import type { UnifiedTransformer } from 'dumi';
function remarkMeta(): UnifiedTransformer<any> {
return (tree, vFile) => {
// read frontmatter
unistUtilVisit.visit(tree, 'yaml', (node) => {
if (!/(^|[\n\r])description:/.test(node.value)) {
(vFile.data.frontmatter as any).__autoDescription = true;
}
});
};
}
export default remarkMeta;