mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
Merge branch 'master' of https://github.com/jsdoc3/jsdoc
This commit is contained in:
commit
1a8fac17f0
@ -132,7 +132,8 @@ function generate(title, docs, filename, resolveLinks) {
|
||||
fs.writeFileSync(outpath, html, 'utf8');
|
||||
}
|
||||
|
||||
function generateSourceFiles(sourceFiles) {
|
||||
function generateSourceFiles(sourceFiles, encoding) {
|
||||
encoding = encoding || 'utf8';
|
||||
Object.keys(sourceFiles).forEach(function(file) {
|
||||
var source;
|
||||
// links are keyed to the shortened path in each doclet's `meta.filename` property
|
||||
@ -142,7 +143,7 @@ function generateSourceFiles(sourceFiles) {
|
||||
try {
|
||||
source = {
|
||||
kind: 'source',
|
||||
code: helper.htmlsafe( fs.readFileSync(sourceFiles[file].resolved, 'utf8') )
|
||||
code: helper.htmlsafe( fs.readFileSync(sourceFiles[file].resolved, encoding) )
|
||||
};
|
||||
}
|
||||
catch(e) {
|
||||
@ -486,7 +487,7 @@ exports.publish = function(taffyData, opts, tutorials) {
|
||||
// output pretty-printed source files by default; do this before generating any other pages, so
|
||||
// that the other pages can link to the source files
|
||||
if (!conf['default'] || conf['default'].outputSourceFiles !== false) {
|
||||
generateSourceFiles(sourceFiles);
|
||||
generateSourceFiles(sourceFiles, opts.encoding);
|
||||
}
|
||||
|
||||
if (members.globals.length) { generate('Global', [{kind: 'globalobj'}], globalUrl); }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user