Skip to content

Commit 66b0e54

Browse files
author
fabianmoronzirfas
committed
regenerate all files
1 parent 8e0ca7b commit 66b0e54

File tree

308 files changed

+5816
-68036
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

308 files changed

+5816
-68036
lines changed

.bin/index.js

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
const fs = require('fs');
2-
const api = require('../_data/api.json');
2+
const api = require('../node_modules/basiljs/doc/api.json');
33
const Entry = require('./lib/entry');
44
const Parameter = require('./lib/parameter');
55
const Return = require('./lib/returns');
66
const Tag = require('./lib/tag');
77
const Category = require('./lib/category');
8+
const Example = require('./lib/example');
89
const _ = require('lodash');
910
const generateData = require('./lib/data-generator');
1011
const Filters = require('./lib/filters');
@@ -40,11 +41,14 @@ function buildEntry(e) {
4041
}
4142
if(Array.isArray(e.tags)) {
4243
e.tags.forEach((ele, ndx, array)=>{
43-
if(ele.title === 'cat') {
44+
45+
if(ele.title === 'cat') { // get the categories
4446
entry.category = ele.description;
45-
} else if(ele.title === 'subcat') {
47+
48+
} else if(ele.title === 'subcat') { // get the sub categories
4649
entry.subcategory = ele.description;
47-
} else if (ele.title === 'param') {
50+
51+
} else if (ele.title === 'param') { // get the parameters
4852
var param = new Parameter();
4953
param.name = ele.name;
5054
param.description = ele.description;
@@ -64,27 +68,38 @@ function buildEntry(e) {
6468
});
6569
}else{
6670
param.type.push(ele.type.expression.name);
67-
6871
}
6972
}else if (ele.type.type === 'UnionType') {
7073
ele.type.elements.forEach((element, index)=>{
7174
param.type.push(element.name);
72-
7375
});
7476
}
7577
}
7678
}
7779
}
7880
entry.parameters.push(param);
79-
} else if (ele.title === 'method') {
81+
} else if (ele.title === 'method') { // get the method
8082
entry.kind = 'function';
81-
}else if (ele.title === 'constant') {
83+
}else if (ele.title === 'constant') { // get the constant
8284
entry.kind = 'constant';
83-
} else if (ele.title === 'property') {
85+
} else if (ele.title === 'property') { // get the property
8486
entry.kind = 'property';
85-
} else if (ele.title === 'constructor') {
87+
} else if (ele.title === 'constructor') { // get the constructor
8688
entry.kind = 'constructor';
87-
} else if (ele.title === 'return' || ele.title === 'returns') {
89+
} else if(ele.title === 'type') {
90+
entry.kind = ele.type.name;
91+
} else if(ele.title === 'example') {
92+
let example = new Example();
93+
if (ele.hasOwnProperty('caption')) {
94+
example.description = ele.caption;
95+
}
96+
if(ele.hasOwnProperty('description')) {
97+
example.code = ele.description;
98+
}
99+
entry.examples.push(example);
100+
}else if(ele.title === 'todo') {
101+
entry.todo = ele.description;
102+
} else if (ele.title === 'return' || ele.title === 'returns') { // get the return
88103
let returnValue = new Return();
89104
returnValue.description = ele.description;
90105
if(ele.hasOwnProperty('type')) {
@@ -135,8 +150,6 @@ api.forEach((el)=> {
135150
// Some filtering
136151
let filter = new Filters();
137152
data.forEach((element)=>{
138-
139-
// console.log(element);
140153
element.name = filter.dotNull(element.name);
141154
element.category = filter.nullToGlobal(element.category);
142155
});

.bin/lib/data-generator.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55
var exports = module.exports = {};
66
function generator(data) {
77
data.forEach((element)=>{
8+
console.log(element);
89
element.codetitle = null;
10+
if(element.kind === null) {
11+
element.kind = 'function';
12+
}
913
if(element.kind.toString() === 'function' || element.kind.toString() === 'constructor') {
1014
let params = '';
1115
element.parameters.forEach((ele, ndx, arr)=>{

.bin/lib/entry.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ function Entry() {
99
this.parameters = [];
1010
this.kind = null;
1111
this.tags = [];
12+
this.examples = [];
13+
this.todo = null;
1214
}
1315

1416
module.exports = Entry;

.bin/lib/example.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
var exports = module.exports = {};
2+
3+
function Example() {
4+
this.description = null;
5+
this.code = null;
6+
7+
}
8+
9+
module.exports = Example;

.bin/lib/files-and-folders.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ function process(ele, folder, ow) {
3434
subcategory: e.subcategory,
3535
returns: e.returns,
3636
parameters: e.parameters,
37-
kind: e.kind
37+
kind: e.kind,
38+
todo: e.todo,
39+
examples: e.examples
3840
}, 2);
3941
let frontmatter = `---\n${yamlstr}\n---\n`;
4042
if(ow === true) {

0 commit comments

Comments
 (0)