MCPcopy Index your code
hub / github.com/stdlib-js/stdlib / generateSourceFiles

Function generateSourceFiles

tools/docs/jsdoc/templates/html/publish.js:228–249  ·  view source on GitHub ↗
(sourceFiles, encoding)

Source from the content-addressed store, hash-verified

226}
227
228function generateSourceFiles(sourceFiles, encoding) {
229 encoding = encoding || 'utf8';
230 Object.keys(sourceFiles).forEach(function(file) {
231 var source;
232 // links are keyed to the shortened path in each doclet's `meta.shortpath` property
233 var sourceOutfile = helper.getUniqueFilename(sourceFiles[file].shortened);
234 helper.registerLink(sourceFiles[file].shortened, sourceOutfile);
235
236 try {
237 source = {
238 kind: 'source',
239 code: helper.htmlsafe( fs.readFileSync(sourceFiles[file].resolved, encoding) )
240 };
241 }
242 catch(e) {
243 logger.error('Error while generating source file %s: %s', file, e.message);
244 }
245
246 generate('Source: ' + sourceFiles[file].shortened, [source], sourceOutfile,
247 false);
248 });
249}
250
251/**
252 * Look for classes or functions with the same name as modules (which indicates that the module

Callers 1

publish.jsFile · 0.85

Calls 1

generateFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…