When building Keynote or PowerPoint presentations, I've often wanted an easy way to copy and paste from Sublime Text 3 into the slides, maintaining just the font and sytax highlighting. Thanks to the ExportHTML ST3 plugin and a bookmarklet, I now have it.
If you just want the bookmarklet, here it is...
| Keynote | PowerPoint | |
|---|---|---|
| Safari | ✓ | ✓ |
| Chrome | ✘ | ✓ |
| Firefox | ✘ | ✓ |
- Install Isaac Muses ExportHTML plugin for Sublime Text.
- [Visit this page] and drag the bookmarklet to your bookmarks bar.
- Setting up your theme
- Set up your ExportHTML settings.
TODO
Open your ExportHTML User Settings file (Sublime Text > Preferences > Package Settings). There are a variety of configuration options available, but dince we're using ExportHTML just to copy/paste into keynote, we want the simplest settings possible.
Turn off numbers, browser print, gutters and header.
{
"html_panel": [
{
"Sparta Theme without Backgrounds": {
"numbers": false,
"browser_print": false,
"color_scheme": "Packages/User/spartaglobal.tmTheme",
"style_gutter": false,
"no_header": true
}
}
]
}You could also set up a key binding:
{
"keys": ["ctrl+alt+super+n"],
"command": "export_html",
"args": {
"numbers": false,
"browser_print": false,
"color_scheme": "Packages/User/spartaglobal.tmTheme",
"style_gutter": false,
"no_header": true
}
}- Open the Sublime Text Command Palette and use the fuzzy search to find "Export to HTML: Show Export Menu".
![http://f.cl.ly/items/1N3C303c3A2D2N0Z2B1g/st_palette_exporthtml.png]
- Hit enter. You should see the export theme's you set up in the ExportHTML settings. Choose the right one and hit enter again.
- This should open Safari showing your code.
- Click the bookmarklet.
- Select and copy the code from your browser (⌘ + A then ⌘ + C).
- Paste into Keynote (⌘ + V) or "Paste Special" into PowerPoint for mac (^ + ⌘ + V then ⏎).
Obviously, thanks to Isaac Muse (@facelessuser) for making the ExportHTML plugin.