/g,'');
for(let taggedSnippet of Object.entries(tagDbData).filter(v => v[1] === tag))
output += '' + md.render(`\n${snippets[taggedSnippet[0]+'.md']}`).replace(//g,'
') + '
';
}
// Add the ending static part
output += `\n${endPart+'\n'}`;
// Minify output
output = minify(output, {
collapseBooleanAttributes: true,
collapseWhitespace: true,
decodeEntities: true,
minifyCSS: true,
minifyJS: true,
html5: false,
processConditionalComments: true,
removeAttributeQuotes: true,
removeComments: true,
removeEmptyAttributes: true,
removeOptionalTags: true,
removeScriptTypeAttributes: true,
removeStyleLinkTypeAttributes: true,
trimCustomFragments: true,
useShortDoctype: 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,'
'; } // Add the ending static part output += `\n${endPart+'\n'}`; // Minify output output = minify(output, { collapseBooleanAttributes: true, collapseWhitespace: true, decodeEntities: true, minifyCSS: true, minifyJS: true, html5: false, processConditionalComments: true, removeAttributeQuotes: true, removeComments: true, removeEmptyAttributes: true, removeOptionalTags: true, removeScriptTypeAttributes: true, removeStyleLinkTypeAttributes: true, trimCustomFragments: true, useShortDoctype: 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');