Print to HTML
Sublime Text 3 plugin to print colorized files as HTML via your browser.
Details
Installs
- Total 69K
- Win 38K
- Mac 23K
- Linux 8K
| Sep 4 | Sep 3 | Sep 2 | Sep 1 | Aug 31 | Aug 30 | Aug 29 | Aug 28 | Aug 27 | Aug 26 | Aug 25 | Aug 24 | Aug 23 | Aug 22 | Aug 21 | Aug 20 | Aug 19 | Aug 18 | Aug 17 | Aug 16 | Aug 15 | Aug 14 | Aug 13 | Aug 12 | Aug 11 | Aug 10 | Aug 9 | Aug 8 | Aug 7 | Aug 6 | Aug 5 | Aug 4 | Aug 3 | Aug 2 | Aug 1 | Jul 31 | Jul 30 | Jul 29 | Jul 28 | Jul 27 | Jul 26 | Jul 25 | Jul 24 | Jul 23 | Jul 22 | Jul 21 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Windows | 2 | 2 | 1 | 1 | 1 | 0 | 0 | 1 | 2 | 1 | 2 | 3 | 0 | 1 | 1 | 0 | 2 | 0 | 0 | 1 | 2 | 1 | 3 | 0 | 1 | 0 | 0 | 3 | 1 | 2 | 0 | 2 | 0 | 0 | 0 | 2 | 4 | 0 | 2 | 0 | 0 | 0 | 0 | 4 | 1 | 0 |
| Mac | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 3 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 2 | 1 |
| Linux | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 2 | 0 | 0 |
Readme
- Source
- raw.githubusercontent.com
Sublime Text 3 Print to HTML
A Sublime Text 2/3 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.
Currently Plugin specified word wrap for ST3 is still under development. Web Browsers will still handle word wrap as necessary.
Installation
- Install Package Manager.
- Use
Cmd+Shift+PorCtrl+Shift+PthenPackage Control: Install Package. - Look for
Print to HTMLand install it.
If you prefer to install manually, install git, then:
git clone https://github.com/jchampy/sublimetext-print-to-html "<Sublime Text 3 Packages folder>/Print to HTML"
Usage
- For best results, save your file with an appropriate extension beforehand.
- To print the current file, use one of the following methods:
- use
Shift+Alt+Pto print current file as HTML via your browser, or - from File menu, use
Print as HTML to BrowserorPrint as HTML to New Buffer. - press
Ctrl+Shift+PorCmd+Shift+Pthen typeprint.
- use
- Edit settings in
Preferences->Package Settings->Print in HTMLto customize output formatting and behavior. Options such as monochrome, line numbering, and browser behavior can be modified.
Future goals
Re-Implement Word Wrap JavaScript once bugs are hashed out from SublimeText2 Version
Use ST2's internal scope and color data from a buffer to produce an exact replica of a file from ST2 in HTML form. The current approach using Pygments has limitations regarding formats unknown by Pygments (e.g. Markdown) and documents with mixed syntaxes (e.g. PHP embedded in HTML).
Credits
The original code is available on Github. Pull requests are welcome.
Created by Joel Thornton.
Forked and updated to Python3 by Matt Hulse
Forked and Pushed for SublimeText3 by Jake Champlin
Uses the Pygments library (included) for code-to-HTML conversion.