summaryrefslogtreecommitdiffstats
path: root/lib/generate/site/glossary_indexer.js
diff options
context:
space:
mode:
authorAaron O'Mullan <aaron.omullan@gmail.com>2014-08-19 16:09:47 -0700
committerAaron O'Mullan <aaron.omullan@gmail.com>2014-08-19 16:09:47 -0700
commit71aff100921f7fcf94c9d75e0bd17c4fcb4669b6 (patch)
treecfefdd61394268bd6f4255eff7414c8a03460c3a /lib/generate/site/glossary_indexer.js
parentf77404afe180e97692897237dca7598eae33a761 (diff)
parent4b390667e574ab46842821f029f3941d797a8b1a (diff)
downloadgitbook-71aff100921f7fcf94c9d75e0bd17c4fcb4669b6.zip
gitbook-71aff100921f7fcf94c9d75e0bd17c4fcb4669b6.tar.gz
gitbook-71aff100921f7fcf94c9d75e0bd17c4fcb4669b6.tar.bz2
Merge pull request #413 from GitbookIO/feature/glossary
Glossary terms highlight in page
Diffstat (limited to 'lib/generate/site/glossary_indexer.js')
-rw-r--r--lib/generate/site/glossary_indexer.js9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/generate/site/glossary_indexer.js b/lib/generate/site/glossary_indexer.js
index d46e393..dc9c2d8 100644
--- a/lib/generate/site/glossary_indexer.js
+++ b/lib/generate/site/glossary_indexer.js
@@ -28,9 +28,6 @@ function Indexer(glossary) {
"gi"
);
- // debug
- console.log('term regex =', this.termsRegex);
-
// page url => terms
this.idx = {
/*
@@ -66,8 +63,6 @@ Indexer.prototype.text = function(nodes) {
// Add page to glossary index
Indexer.prototype.add = function(sections, url) {
if(!(this.glossary && this.glossary.length > 0)) {
- console.log('Glossary =', this.glossary);
- console.log('No glossary to match');
return;
}
@@ -93,6 +88,10 @@ Indexer.prototype.add = function(sections, url) {
}.bind(this));
};
+// Dump index as a string
+Indexer.prototype.dump = function() {
+ return JSON.stringify(this.idx);
+};
function regexEscape(s) {