Update documentation generator

This commit is contained in:
Amish Shah
2016-08-15 22:07:01 +01:00
parent 1ea53c18ac
commit eba3bd0291
2 changed files with 25 additions and 2 deletions

View File

@@ -4,7 +4,7 @@ let parse;
const customDocs = require('../custom/index');
const GEN_VERSION = 1;
const GEN_VERSION = 2;
try {
fs = require('fs-extra');
@@ -33,10 +33,33 @@ function cleanPaths() {
}
}
function clean() {
const cleaned = {
classes: {},
};
for (const item of json) {
if (item.kind === 'class') {
cleaned.classes[item.longname] = {
meta: item,
functions: [],
properties: [],
events: [],
};
} else if (item.kind === 'member') {
cleaned.classes[item.memberof].properties.push(item);
} else if (item.kind === 'function' && item.memberof) {
cleaned.classes[item.memberof].functions.push(item);
}
}
json = cleaned;
}
function next() {
json = JSON.parse(json);
cleanPaths();
console.log('parsed inline code');
console.log(json);
clean();
json = {
meta: {
version: GEN_VERSION,