CodeRippa takes your source code and turns it into a beautiful PDF file. Currently, it supports 150 languages and 15 themes, all of which are available in TextMate. More syntaxes and themes will be available soon.
Add this line to your application's Gemfile:
$ gem 'code_rippa'
And then execute:
$ bundle
Or install it yourself as:
$ gem install code_rippa
Usage: code_rippa [options] file_or_directory
-l, --list-themes List all available themes
-t, --theme THEME Selected theme
-n, --list-syntax List all available syntax
-s, --syntax SYNTAX Selected syntax
-x, --excluded-exts E1,E2,EN Exclude these extensions when processing
-h, --help Display this screen
$ code_rippa -l
active4d
all_hallows_eve
amy
moc
twilight
zenburnesque
... more themes omitted
$ code_rippa -n
actionscript
erlang
java
javascript
prolog
ruby
yaml
... more syntaxes omitted
Example:
$ code_rippa -s ruby -t zenburnesque path_to_single_file.rb
Note that the output file is saved as out.tex in the current directory where code_rippa was called from.
$ pdflatex out.tex # Saved as out.pdf
Example:
$ code_rippa -s java -t moc path_to_directory
Note that the output file is saved as out.tex in the current directory where code_rippa was called from.
Then, you'll need to run pdflatex twice. This is because LaTeX needs to generate the bookmarks.
$ pdflatex out.tex # Saved as out.pdf
$ pdflatex out.tex # Remember to run this twice!
Note: In case your system doesn't have pdflatex
, you can get a LaTeX distribution.
None of this would be possible without the awesome ultraviolet and spox-ultraviolet gems. Props to lwheng for providing most of the LaTeX help.
Currently this gem is in its infancy. Any bug reports and feature requests are very welcomed.
- Removed dependency on Linguist.
- Tidier code.
- Initial gem push
- Fixed many stupid bugs along the way