diff options
Diffstat (limited to 'lib/page/index.js')
-rw-r--r-- | lib/page/index.js | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/lib/page/index.js b/lib/page/index.js index c9cd066..629bcee 100644 --- a/lib/page/index.js +++ b/lib/page/index.js @@ -147,7 +147,11 @@ Page.prototype.toHTML = function(output) { // Normalize HTML output .then(function() { var pipelineOpts = { - onRelativeLink: _.partial(output.onRelativeLink, that), + onRelativeLink: function (href) { + href = that.relative(href); + return output.onRelativeLink(that, href); + }, + //_.partial(output.onRelativeLink, that), onImage: _.partial(output.onOutputImage, that), onOutputSVG: _.partial(output.onOutputSVG, that), @@ -159,7 +163,17 @@ Page.prototype.toHTML = function(output) { language: lang } }); - } + }, + + // Convert glossary entries to annotations + annotations: _.map(that.book.glossary.entries, function(entry) { + return { + id: entry.id, + name: entry.name, + description: entry.description, + href: '/GLOSSARY.html' + }; + }) }; var pipeline = new HTMLPipeline(that.content, pipelineOpts); |