MCPcopy
hub / github.com/jsdoc/jsdoc / generateSourceFiles

Function generateSourceFiles

templates/default/publish.js:240–261  ·  view source on GitHub ↗
(sourceFiles, encoding = 'utf8')

Source from the content-addressed store, hash-verified

238}
239
240function generateSourceFiles(sourceFiles, encoding = 'utf8') {
241 Object.keys(sourceFiles).forEach(file => {
242 let source;
243 // links are keyed to the shortened path in each doclet's `meta.shortpath` property
244 const sourceOutfile = helper.getUniqueFilename(sourceFiles[file].shortened);
245
246 helper.registerLink(sourceFiles[file].shortened, sourceOutfile);
247
248 try {
249 source = {
250 kind: 'source',
251 code: helper.htmlsafe( fs.readFileSync(sourceFiles[file].resolved, encoding) )
252 };
253 }
254 catch (e) {
255 logger.error('Error while generating source file %s: %s', file, e.message);
256 }
257
258 generate(`Source: ${sourceFiles[file].shortened}`, [source], sourceOutfile,
259 false);
260 });
261}
262
263/**
264 * 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…