Skip to content

Latest commit

 

History

History
101 lines (61 loc) · 2.4 KB

README.md

File metadata and controls

101 lines (61 loc) · 2.4 KB

CodeRippa

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.

Installation

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

Command line options

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

List all available themes

$ code_rippa -l

active4d
all_hallows_eve
amy
moc
twilight
zenburnesque
... more themes omitted

List all supported syntax

$ code_rippa -n

actionscript
erlang
java
javascript
prolog
ruby
yaml
... more syntaxes omitted

Producing PDF from a single file

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

Producing PDF from a directory

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.

Credits

None of this would be possible without the awesome ultraviolet and spox-ultraviolet gems. Props to lwheng for providing most of the LaTeX help.

Contributing

Currently this gem is in its infancy. Any bug reports and feature requests are very welcomed.

Changelog

0.0.4

  • Removed dependency on Linguist.
  • Tidier code.

0.0.1 - 0.0.3

  • Initial gem push
  • Fixed many stupid bugs along the way