Update xol script and content

This commit is contained in:
Andreas Hocevar
2018-03-06 16:25:21 +01:00
committed by Tim Schaub
parent c4cf75e470
commit becce622e5
2 changed files with 814 additions and 3100 deletions

View File

@@ -154,22 +154,18 @@ function processBlocks(blocks) {
function format(data) {
let source = '';
for (const name in data) {
const comment = data[name].comment;
// add the @typedef
source += `\n/**\n${comment} */\n`;
source += `export let ${name};\n\n`;
source += `\n/**\n * @typedef {Object} ${name}\n`;
const params = data[name].params;
if (!params.length) {
throw new Error(`No params for ${name}`);
}
source += '/**\n';
source += ` * @param {${name}} options TODO: repace this\n *\n`;
params.forEach(param => {
const description = param.description.split('\n').join('\n * ');
source += ` * @param ${param.type} options.${param.name} ${description}\n`;
const description = param.description.replace(/\n$/, '').split('\n').join('\n * ');
source += ` * @property ${param.type} ${param.name} ${description}\n`;
});
source += ' */\n\n';
}