-
Notifications
You must be signed in to change notification settings - Fork 5
/
markdown-docs.ts
60 lines (48 loc) · 1.51 KB
/
markdown-docs.ts
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
/*
* Copyright (c) 2017 MolQL contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Alexander Rose <[email protected]>
*/
import properties from './properties'
import operators from './operators'
import keywords from './keywords'
const docs: string[] = [
'PyMol',
'============',
'--------------------------------',
''
];
docs.push(`## Properties\n\n`);
docs.push('--------------------------------\n');
for (const name in properties) {
if (properties[name].isUnsupported) continue
const names = [name]
if (properties[name].abbr) names.push(...properties[name].abbr!)
docs.push(`\`\`\`\n${names.join(', ')}\n\`\`\`\n`);
if (properties[name]['@desc']) {
docs.push(`*${properties[name]['@desc']}*\n`);
}
}
docs.push(`## Operators\n\n`);
docs.push('--------------------------------\n');
operators.forEach(o => {
if (o.isUnsupported) return
const names = [o.name]
if (o.abbr) names.push(...o.abbr!)
docs.push(`\`\`\`\n${names.join(', ')}\n\`\`\`\n`);
if (o['@desc']) {
docs.push(`*${o['@desc']}*\n`);
}
})
docs.push(`## Keywords\n\n`);
docs.push('--------------------------------\n');
for (const name in keywords) {
if (!keywords[name].map) continue
const names = [name]
if (keywords[name].abbr) names.push(...keywords[name].abbr!)
docs.push(`\`\`\`\n${names.join(', ')}\n\`\`\`\n`);
if (keywords[name]['@desc']) {
docs.push(`*${keywords[name]['@desc']}*\n`);
}
}
export default docs.join('\n')