/g,'');
for(let taggedSnippet of Object.entries(tagDbData).filter(v => v[1] === tag))
uncategorizedOutput += '' + md.render(`\n${snippets[taggedSnippet[0]+'.md']}`).replace(//g,'
') + '
';
} else {
output +=md.render(`## ${capitalize(tag, true)}\n`).replace(//g,'');
for(let taggedSnippet of Object.entries(tagDbData).filter(v => v[1] === tag))
output += '' + md.render(`\n${snippets[taggedSnippet[0]+'.md']}`).replace(//g,'
') + '
';
}
}
output += uncategorizedOutput;
// Add the ending static part
output += `\n${endPart+'\n'}`;
// Minify output
output = minify(output, {
collapseBooleanAttributes: true,
collapseWhitespace: false,
decodeEntities: false,
minifyCSS: true,
minifyJS: true,
keepClosingSlash: true,
processConditionalComments: true,
removeAttributeQuotes: false,
removeComments: true,
removeEmptyAttributes: false,
removeOptionalTags: false,
removeScriptTypeAttributes: false,
removeStyleLinkTypeAttributes: false,
trimCustomFragments: true,
});
// Write to the index.html file
fs.writeFileSync(path.join(docsPath,'index.html'), output);
}
catch (err){ // Handle errors (hopefully not!)
console.log(`${chalk.red('ERROR!')} During index.html generation: ${err}`);
process.exit(1);
}
// Log a success message
console.log(`${chalk.green('SUCCESS!')} index.html file generated!`);
// Log the time taken
console.timeEnd('Builder');
/g,'
'; } else { output +=md.render(`## ${capitalize(tag, true)}\n`).replace(/
/g,'');
for(let taggedSnippet of Object.entries(tagDbData).filter(v => v[1] === tag))
output += '' + md.render(`\n${snippets[taggedSnippet[0]+'.md']}`).replace(//g,'
') + '
';
}
}
output += uncategorizedOutput;
// Add the ending static part
output += `\n${endPart+'\n'}`;
// Minify output
output = minify(output, {
collapseBooleanAttributes: true,
collapseWhitespace: false,
decodeEntities: false,
minifyCSS: true,
minifyJS: true,
keepClosingSlash: true,
processConditionalComments: true,
removeAttributeQuotes: false,
removeComments: true,
removeEmptyAttributes: false,
removeOptionalTags: false,
removeScriptTypeAttributes: false,
removeStyleLinkTypeAttributes: false,
trimCustomFragments: true,
});
// Write to the index.html file
fs.writeFileSync(path.join(docsPath,'index.html'), output);
}
catch (err){ // Handle errors (hopefully not!)
console.log(`${chalk.red('ERROR!')} During index.html generation: ${err}`);
process.exit(1);
}
// Log a success message
console.log(`${chalk.green('SUCCESS!')} index.html file generated!`);
// Log the time taken
console.timeEnd('Builder');
/g,'
'; } } output += uncategorizedOutput; // Add the ending static part output += `\n${endPart+'\n'}`; // Minify output output = minify(output, { collapseBooleanAttributes: true, collapseWhitespace: false, decodeEntities: false, minifyCSS: true, minifyJS: true, keepClosingSlash: true, processConditionalComments: true, removeAttributeQuotes: false, removeComments: true, removeEmptyAttributes: false, removeOptionalTags: false, removeScriptTypeAttributes: false, removeStyleLinkTypeAttributes: false, trimCustomFragments: true, }); // Write to the index.html file fs.writeFileSync(path.join(docsPath,'index.html'), output); } catch (err){ // Handle errors (hopefully not!) console.log(`${chalk.red('ERROR!')} During index.html generation: ${err}`); process.exit(1); } // Log a success message console.log(`${chalk.green('SUCCESS!')} index.html file generated!`); // Log the time taken console.timeEnd('Builder');