@agibsonsw started a plugin to print code to an HTML styled with Sublime Text's syntax highlighting. We started collaborating together, and I polished it up and added a number of features. With @agibsonsw permission I am posting the plugin here.
- Print to HTML using any tmTheme for syntax highlighting
- Can handle any language supported by ST2
- Supports bold and italic theme font styles as well
- Configurable output
- Format suitable for copying and pasting in emails
- 2 included tmTheme files for color and grayscale printing (but any can be used)
- Print only selections (multi-select supported)
- Print and show highlights (multi-select supported)
- Toggle gutter on/off in browser view
- Automatically open browser print dialog (optional)
- Enable/disable configurable word wrapping
Please read the readme
for more information.
I know there is already a print to HTML plugin now on Package Control. I also know that people are a little picky about plugins that provide similar features on Package Control. If you would like to see this plugin on Package Control, please let me know. I think this offers a unique set of features, but I will leave it up the user base to decide.Edit: