-
Notifications
You must be signed in to change notification settings - Fork 40
/
doc.js
38 lines (35 loc) · 1012 Bytes
/
doc.js
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
const fs = require("fs");
const path = require("path");
/**
* Remove modules folder , modules.html, index.html
* Move documentation.html to api reference folder
*
*/
const formatDoc = async () => {
fs.unlinkSync("./docs/modules.html");
fs.mkdirSync("./docs/api reference");
fs.renameSync("./docs/index.html", "./docs/tutorial.html");
fs.copyFileSync(
"./docs/modules/utils.html",
"./docs/api reference/utils.html"
);
fs.rmdirSync("./docs/modules", { recursive: true });
fs.rmdirSync("./docs/assets", { recursive: true });
const source = "./docs/classes";
let files = fs.readdirSync(source);
files.forEach(function (file) {
let curSource = path.join(source, file);
const name = file
.split(".")
.filter((v, i) => i !== 1)
.join(".");
fs.renameSync(
curSource,
`./docs/api reference/${
name === "milvusindex.html" ? "index.html" : name
}`
);
});
fs.rmdirSync("./docs/classes", { recursive: true });
};
formatDoc();