diff options
Diffstat (limited to 'lib/parsers.js')
-rw-r--r-- | lib/parsers.js | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/lib/parsers.js b/lib/parsers.js deleted file mode 100644 index 523cb87..0000000 --- a/lib/parsers.js +++ /dev/null @@ -1,34 +0,0 @@ -var _ = require("lodash"); -var path = require("path"); - -// This list is ordered by priority of parsers to use -var PARSER = [ - { - name: "markdown", - extensions: [".md", ".markdown"], - parser: require("gitbook-markdown") - }, - { - name: "asciidoc", - extensions: [".adoc", ".asciidoc"], - parser: require("gitbook-asciidoc") - } -]; - -// Return a specific parser according to an extension -function getParser(ext) { - return _.find(PARSER, function(input) { - return _.contains(input.extensions, ext); - }); -} - -// Return parser for a file -function getParserForFile(filename) { - return getParser(path.extname(filename)); -}; - -module.exports = { - extensions: _.flatten(_.pluck(PARSER, "extensions")), - get: getParser, - getForFile: getParserForFile -}; |