-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-test.js
63 lines (50 loc) · 1.56 KB
/
build-test.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
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
const { log, cls, getFilesSync, readFileToString, writeFile } = require("aftc-node-tools");
const { JSODoc, jsoGetDocs } = require("./jsodoc");
cls();
const version = require("./package.json").version;
let subs = {
"[[version]]":version,
"[[author]]":"[email protected]"
}
// Test string input
let str = `// JSODOC = {
// "method": "enableDebug",
// "info": "Enables debugging.",
// "example": [
// "enableDebug();"
// ]
// } JSODOC`;
let jsoDoc = new JSODoc({
// comments: str,
// files: ['./tests/basic.js'],
dir: './tests',
recursive: false,
ext: ['js','ts'],
template: './tests/template.md',
substitutions: subs,
output: './tests/test.md'
})
jsoDoc.start();
// v0.9.2
// // Get files to be merged
// // let files = getFilesSync("./tests", ".js", true);
// let files = ["./tests/test1.js"];
// // log(files);
// let docs = jsoGetDocs(files);
// // log(docs.gitSummary);
// // log(typeof(docs.gitDocs));
// // log(docs.gitDocs);
// // log(docs.comments);
// // Template
// // let readme = readFileToString("./docs/readme-template.md");
// let readme = "# <b>TEST-README.md v[[version]]</b>\n\n";
// readme += "## <b>Summary</b>\n\n[[summary]]\n\n<hr><br><br>\n\n";
// readme += "# <b>Documentation</b>\n\n[[docs]]";
// // log(readme)
// // Substitute values into readme
// readme = readme.replace("[[version]]",version);
// readme = readme.replace("[[summary]]",docs.gitSummary);
// readme = readme.replace("[[docs]]",docs.gitDocs);
// // log(readme)
// // Write readme.md
// writeFile("./tests/test.md",readme);