| | 5 | |
| | 6 | This library tries to markup text files according to their syntax using vim. |
| | 7 | It can be used to produce web pages with pretty-printed colourful source code samples. |
| | 8 | |
| | 9 | You need Vim installed. |
| | 10 | |
| | 11 | |
| | 12 | Synopsis |
| | 13 | ======== |
| | 14 | |
| | 15 | require 'vimcolor' |
| | 16 | |
| | 17 | vc = VimColor.new |
| | 18 | xml = vc.run_file("foo.rb", |
| | 19 | {:filetype => 'ruby', #default: auto detect |
| | 20 | :encoding => 'utf-8'}, #default: utf-8 |
| | 21 | 'xml') #can be 'xml', 'html', 'ansi', |
| | 22 | # default is 'ansi' |
| | 23 | |
| | 24 | Command-line Tool |
| | 25 | ================= |
| | 26 | A simple source code highlighter is included as a sample script. |
| | 27 | |
| | 28 | eg. |
| | 29 | $ ruby -Ilib vimcolor-embed lib/vimcolor.rb |
| | 30 | $ ruby -Ilib vimcolor-embed lib/vimcolor.rb -f html > vimcolor.html |
| | 31 | |
| | 32 | use '-h' option for more information. |
| | 33 | |
| | 34 | |
| | 35 | Links |
| | 36 | ===== |
| | 37 | Information about original Perl's Text::VimColor |
| | 38 | |
| | 39 | * http://search.cpan.org/~geoffr/Text-VimColor-0.11/lib/Text/VimColor.pm |
| | 40 | |
| | 41 | Svn repository (hosted by coderepos.org) |
| | 42 | |
| | 43 | * http://coderepos.org/share/browser/lang/ruby/vimcolor |