Fork me on GitHub

enscript2dropbox by kickingvegas

Send colorized HTML or PDF output from enscript to your Dropbox folder to view on your tablet in lieu of using a printer.

Oh Hai.

Not so long ago, programmers would print out their source code, often times with very little formatting and consuming much paper. The benefit was to view the source code in a place other than the main screen(s) used to develop it.

Tablet devices such as the iPad can emulate that "paper view" with the added benefits of richer formatting, no paper consumption and colorization.

enscript2dropbox is a command line utility that offers this capability by reading in your source code and generating either HTML or pdf output which can be viewed on your tablet using a Dropbox client app.

The implementation of enscript2dropbox is a Python script which serves as a wrapper largely around the enscript utility.

Example Usage

Given the files foo.m and foo.h, run the following command to "print" them to Dropbox:

$ enscript2dropbox foo.m foo.h

The files foo.m.html and foo.h.html will be placed in the directory $HOME/Dropbox/Documents/printouts where $HOME is your home directory.

To generate pdf files instead use the -w pdf option:

$ enscript2dropbox -w pdf foo.m foo.h

Dependencies

enscript2dropbox supports OS X versions ≥10.5 and most Linux systems.

enscript and pstopdf are installed by default on OS X.

Syntax Highlighting Support

Depending on your installation of enscript, a number of languages are supported for highlighting. The following list shows those supported on OS X 10.6. Please refer to the command enscript --help-highlight to determine which languages are supported on your system.

ada, asm, awk, bash, c, changelog, cpp, csh, delphi, diff, diffs, diffu, elisp, fortran, fortran_pp, haskell, html, idl, inf, java, javascript, ksh, m4, mail, makefile, matlab, nroff, objc, outline, pascal, perl, postscript, pyrex, python, rfc, scheme, sh, skill, sql, states, synopsys, tcl, tcsh, tex, vba, verilog, vhdl, vrml, wmlscript, zsh

Install

  1. Install Dropbox.
  2. If you are running Linux, ensure that enscript and ps2pdf are installed.
  3. Unzip or untar project.
  4. Change into the directory enscript2dropbox.
  5. Run the command make to install.

License

Apache License, Version 2.0

Authors

Charles Choi (charles.choi@yummymelon.com)

Issues

Please submit any bugs or feature requests to the enscript2dropbox issue tracker.

Download

You can download this project in either zip or tar formats.

You can also clone the project with Git by running:

$ git clone git://github.com/kickingvegas/enscript2dropbox