A Sublime Text 2 plugin to print files as HTML with color syntax highlighting and line numbers, and open them in your browser for printing.
Colorization and HTML conversion is currently performed by Pygments, which supports a range of languages and syntaxes.
Cmd+Shift+P
or Ctrl+Shift+P
then Package Control: Install Package
.Print to HTML
and install it.If you prefer to install manually, install git, then:
git clone https://github.com/joelpt/sublimetext-print-to-html "<Sublime Text 2 Packages folder>/Print to HTML"
Shift+Alt+P
to print current file as HTML via your browser, orPrint as HTML to Browser
or Print as HTML to New Buffer
.Ctrl+Shift+P
or Cmd+Shift+P
then type print
.Preferences->Package Settings->Print in HTML
to customize output formatting and behavior. Options such as monochrome, line numbering, and browser behavior can be modified.This code is available on Github. Pull requests are welcome.
Created by Joel Thornton.
Uses the Pygments library (included) for code-to-HTML conversion.