12. Nov 03:13
On Theming the TextMate WebPreview
I have committed some changes to the TextMate Bundle Repository today, which let you define your own themes for the WebPreview (HTML Output). Those themes are stored locally in
~/Library/Application Support/TextMate/Themes/WebPreview and consist of a directory which defines the theme’s name and which contains a
style.css file and an
style.css Stylesheet lets you define the various styles of the WebPreview, from text/background colour to exchanging the Header altogether. The
images subdirectory contains the two images for the header:
teaser.png. The first is just a 1px broad gradient that will be stretched to window width for the included themes while the latter is the gears icon on the right side of the header.
By naming a theme like an included theme, it is possible to override certain styles only. Someone has been pestering me about blockquotes (e.g. in Markdown previews) not being italic for months now – so here is how you can change it locally.
I have sent an example theme to the developer mailing list, which will override the bright theme locally and modify some colours as well as the header. As stated in the Mail to the List, this is just to show how things work. Have fun theming!
On another note: I’m a technical reviewer of the TextMate Book. Let me quote just this sentence from the introduction to the beta PDF:
We can’t be held liable if you use this book to try to create a spiffy application and you somehow end up with a strangely shaped farm implement instead.