Skip to content

Commit a00b02d

Browse files
committed
Removing some try catch blocks that where making exception traking harder and docs will be generated from now on in docs folder rather then in out/jsdocs/
1 parent 81e93f9 commit a00b02d

File tree

4 files changed

+9
-25
lines changed

4 files changed

+9
-25
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
*.kpf
2-
out/*
2+
docs/*

lib/jsdocs.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ parser.usage("jsdocs [OPTIONS] <SRC_DIR> <SRC_FILE> ...");
1717
parser.help("[OPTIONS]");
1818
parser.option("-d", "--directory", "destination")
1919
.help("Output to this directory (defaults to \"out\").")
20-
.def("out")
20+
.def("docs")
2121
.set();
2222
parser.option("-t", "--template", "template")
2323
.help("Relative path to the template used for formating the output.")

lib/jsdocs/plugins/publish-src-highlight.js

+4-9
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,11 @@ var cache = {};
99
exports.onPublishSrc = function(src) {
1010
if (src.path in cache) return; // already generated src code
1111
cache[src.path] = true;
12-
try {
13-
var highlighter = new JsHighlight(src.path.read().toString(), src.charset);
14-
src.highlighted = highlighter.highlight();
15-
} catch(e) {
16-
console.error(e.message);
17-
OS.exit();
18-
}
12+
var highlighter = new JsHighlight(src.path.read().toString(), src.charset);
13+
src.highlighted = highlighter.highlight();
1914
};
2015

21-
function html() { return Array.prototype.call.join(arguments, "\n"); }
16+
function html() { return Array.prototype.join.call(arguments, "\n"); }
2217

2318
function JsHighlight(src, charset) {
2419
var tr = new TokenReader();
@@ -66,5 +61,5 @@ JsHighlight.prototype.highlight = function() {
6661
+ "</span> ";
6762
});
6863
}
69-
return this.header + highlightd + this.footer;
64+
return this.header + highlighted + this.footer;
7065
};

templates/default/publish.js

+3-14
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ var conf = global.conf = { extension: ".html" };
1212
Link.ext = conf.extension;
1313
var destination, template, symbols, encoding, VERSION, copyright;
1414
exports.publish = function publish(symbolSet, options) {
15-
destination = options.destination.join("jsdoc");
15+
destination = options.destination;
1616
// TODO: fix link module properly
1717
template = Link.template = options.template;
1818
encoding = options.encoding;
@@ -102,24 +102,13 @@ exports.publish = function publish(symbolSet, options) {
102102
global.conf.classesIndex = classesTemplate.process(classes);
103103

104104
// create the class index page
105-
try {
106-
var classesindexTemplate = new JsPlate(template.join("index.tmpl").read().toString(), "index.tmpl");
107-
} catch(e) {
108-
console.error(e.message);
109-
OS.exit()
110-
}
111-
105+
var classesindexTemplate = new JsPlate(template.join("index.tmpl").read().toString(), "index.tmpl");
112106
var classesIndex = classesindexTemplate.process(classes);
113107
destination.join("index" + conf.extension).write(classesIndex);
114108
classesindexTemplate = classesIndex = classes = null;
115109

116110
// create the file index page
117-
try {
118-
var fileindexTemplate = new JsPlate(template.join("allfiles.tmpl").read().toString(), "allfiles.tmpl");
119-
} catch(e) {
120-
console.error(e.message);
121-
OS.exit()
122-
}
111+
var fileindexTemplate = new JsPlate(template.join("allfiles.tmpl").read().toString(), "allfiles.tmpl");
123112

124113
var documentedFiles = symbols.filter(isaFile); // files that have file-level docs
125114
var allFiles = []; // not all files have file-level docs, but we need to list every one

0 commit comments

Comments
 (0)