serenity.de – On Theming the TextMate WebPreview

Turning it off and on again since 1998

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 images subdirectory.

The 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: header.png and 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.

Theme Menu

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.

 

Serenity.de is the homepage of Stanley Rost, iOS/Mac software developer and TextMate enthusiast from Berlin, Germany. I’m 31 years old and I’ve been around the web since 1998.

I’m a graduate of Leipzig University of Applied Sciences (HTWK Leipzig) and I’m currently self-employed after working for six years at eWerk IT GmbH. Contact me at soryu2@gmail.com.

 

© 1998–2013 Stanley Rost

Ornament Small