Commit 7a5d9795 authored by Albert Gräf's avatar Albert Gräf
Browse files

Help browser: Construct the help index from all of lib/pd-l2ork, to make the...

Help browser: Construct the help index from all of lib/pd-l2ork, to make the keyword search more useful.
parent ddf714ba
...@@ -192,15 +192,12 @@ function add_doc_to_index(filename, data) { ...@@ -192,15 +192,12 @@ function add_doc_to_index(filename, data) {
function read_file(err, filename, stat) { function read_file(err, filename, stat) {
if (!err) { if (!err) {
if (filename.slice(-3) === ".pd") { if (filename.slice(-3) === ".pd") {
fs.readFile(filename, { encoding: "utf8", flag: "r" }, try {
function(read_err, data) { var data = fs.readFileSync(filename, { encoding: "utf8", flag: "r" });
if (!read_err) { add_doc_to_index(filename, data);
add_doc_to_index(filename, data); } catch (read_err) {
} else { pdgui.post("err: " + read_err);
pdgui.post("err: " + read_err); }
}
}
);
} }
} else { } else {
pdgui.post("err: " + err); pdgui.post("err: " + err);
...@@ -258,7 +255,7 @@ function finish_build() { ...@@ -258,7 +255,7 @@ function finish_build() {
} }
function build_index() { function build_index() {
var doc_path = path.join(pdgui.get_lib_dir(), "doc"); var doc_path = pdgui.get_lib_dir();
pdgui.post("doc path is " + doc_path); pdgui.post("doc path is " + doc_path);
dive(doc_path, read_file, finish_build); dive(doc_path, read_file, finish_build);
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment