Update xol script and content
This commit is contained in:
committed by
Tim Schaub
parent
c4cf75e470
commit
becce622e5
+811
-3093
File diff suppressed because it is too large
Load Diff
+3
-7
@@ -154,22 +154,18 @@ function processBlocks(blocks) {
|
|||||||
function format(data) {
|
function format(data) {
|
||||||
let source = '';
|
let source = '';
|
||||||
for (const name in data) {
|
for (const name in data) {
|
||||||
const comment = data[name].comment;
|
|
||||||
|
|
||||||
// add the @typedef
|
// add the @typedef
|
||||||
source += `\n/**\n${comment} */\n`;
|
source += `\n/**\n * @typedef {Object} ${name}\n`;
|
||||||
source += `export let ${name};\n\n`;
|
|
||||||
|
|
||||||
const params = data[name].params;
|
const params = data[name].params;
|
||||||
if (!params.length) {
|
if (!params.length) {
|
||||||
throw new Error(`No params for ${name}`);
|
throw new Error(`No params for ${name}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
source += '/**\n';
|
|
||||||
source += ` * @param {${name}} options TODO: repace this\n *\n`;
|
|
||||||
params.forEach(param => {
|
params.forEach(param => {
|
||||||
const description = param.description.split('\n').join('\n * ');
|
const description = param.description.replace(/\n$/, '').split('\n').join('\n * ');
|
||||||
source += ` * @param ${param.type} options.${param.name} ${description}\n`;
|
source += ` * @property ${param.type} ${param.name} ${description}\n`;
|
||||||
});
|
});
|
||||||
source += ' */\n\n';
|
source += ' */\n\n';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user