Skip to content

Commit 2509823

Browse files
Move public folder to docs_md
1 parent 468c46c commit 2509823

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

.gitignore

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
docs/_build
21
node_modules
32
cache
43
.vitepress/dist
5-
docs_md
4+
docs_md/**/*.md

docs_md/.gitkeep

Whitespace-only changes.
File renamed without changes.

scripts/generate_md.mjs

+7-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,14 @@ import { fileURLToPath } from 'node:url';
77
const __dirname = dirname(fileURLToPath(import.meta.url));
88

99
const generateMd = async () => {
10+
const existingFiles = await fs.promises.readdir(path.resolve(__dirname, '../docs_md'))
11+
for (const file of existingFiles) {
12+
if (file.endsWith('.md')) {
13+
await fs.promises.rm(path.resolve(__dirname, '../docs_md', file), { force: true });
14+
}
15+
}
16+
1017
const files = await fs.promises.readdir(path.resolve(__dirname, '../docs'))
11-
await fs.promises.rm(path.resolve(__dirname, '../docs_md'), { recursive: true, force: true })
12-
fs.promises.mkdir(path.resolve(__dirname, '../docs_md'))
1318
for await (const file of files) {
1419
execSync(`pandoc --lua-filter=${__dirname}/pandoc_fix_links.lua -s ${__dirname}/../docs/${file} -o ${__dirname}/../docs_md/${path.parse(file).name}.md -t gfm`)
1520
}

0 commit comments

Comments
 (0)