From 2cf6d42fd400056a753766c49fce19321792cb64 Mon Sep 17 00:00:00 2001 From: Chris Wanstrath Date: Mon, 26 Apr 2010 13:03:42 -0700 Subject: [PATCH] `rake lexers` --- README.md | 15 +++++++++++++++ Rakefile | 11 +++++++++++ 2 files changed, 26 insertions(+) create mode 100644 Rakefile 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