This repository has been archived by the owner on Dec 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
markdown-magic.cts
63 lines (61 loc) · 1.77 KB
/
markdown-magic.cts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// import fs from 'node:fs';
import path from 'path';
import markdownMagic from 'markdown-magic';
// import tree from 'markdown-magic-directory-tree';
// import vBadge from 'markdown-magic-version-badge';
// import install from 'markdown-magic-install-command';
// // import template from 'markdown-magic-template';
// import pkgJson from 'markdown-magic-package-json';
const config = {
transforms: {
// DIRTREE: (content, options, config) =>
// tree(
// content,
// {
// ...options,
// ignore: [
// ...(options.ignore || []),
// 'CHANGELOG.md',
// 'README.md',
// 'node_modules',
// 'package.json',
// 'pnpm-lock.yaml',
// '.dev',
// '.DS_Store',
// ],
// depth: 1,
// },
// config,
// ),
// VERSIONBADGE: (content, options, config) =>
// vBadge(content, options, config),
// INSTALLCMD: (content, options, config) =>
// install(
// content,
// {
// client: 'pnpm',
// },
// config,
// )
// .replace('--save ', '')
// .replace('install', 'i'),
// // TEMPLATE: install,
// PKGJSON: (content, options, config) =>
// pkgJson(
// content,
// {
// ...options,
// pkg: path.join(path.dirname(config.originalPath), 'package.json'),
// },
// config,
// ),
},
};
const markdownPaths = [
// path.join(__dirname, 'README.md'),
path.join(__dirname, 'packages/integration/README.md'),
// path.join(__dirname, 'components/*/README.md'),
// path.join(__dirname, 'configs/README.md'),
// path.join(__dirname, 'demo/README.md'),
];
markdownMagic(markdownPaths, config);