diff options
Diffstat (limited to 'lib/book.js')
-rw-r--r-- | lib/book.js | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/lib/book.js b/lib/book.js index dac73f8..82f4440 100644 --- a/lib/book.js +++ b/lib/book.js @@ -320,7 +320,7 @@ Book.prototype.findParsableFile = function(filename) { if (!realFilepath) return null; return { - parser: parsers.get(ext), + parser: parsers.getByExt(ext), path: realFilepath }; }); @@ -359,6 +359,23 @@ Book.prototype.isInLanguageBook = function(filename) { }); }; +// ----- Parser Methods + +// Render a markup string in inline mode +Book.prototype.renderInline = function(type, src) { + var parser = parsers.get(type); + return parser.inline(src) + .get('content'); +}; + +// Render a markup string in block mode +Book.prototype.renderBlock = function(type, src) { + var parser = parsers.get(type); + return parser.page(src) + .get('content'); +}; + + // ----- DEPRECATED METHODS Book.prototype.contentLink = error.deprecateMethod(function(s) { |