diff --git a/README.md b/README.md index b7321c2..bdb65d0 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,21 @@ Becomes this: Note the `Hi Bobs!` +## Available Lexers + +This is currently only a demo, so we've hardcoded a small number of lexers: + +* ruby +* js +* python +* scheme + +Use `{{# highlight_scheme}} code {{/ highlight_scheme}}`, for example, +to activate one of the lexers. + +To get a complete list run `rake lexers` in the root of this project. + + ## Dependencies * Pygments diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..aaf3ab7 --- /dev/null +++ b/Rakefile @@ -0,0 +1,11 @@ + +desc "List the available lexers" +task :lexers do + $LOAD_PATH.unshift 'lib' + require 'mustache/plugins/syntax_highlighter' + + lexers = + Mustache::Plugins::SyntaxHighlighter.instance_methods.grep(/highlight/) + puts 'Lexers:' + puts lexers.map { |lexer| ' ' + lexer.sub('highlight_', '') } +end