Tufte epigraphs with TextWrangler

He used the word savages with affection, as if he liked them a little for it. In his nature was a respect for wildness. He saw it as a personal challenge, something that could be put right with an idea or a machine. He felt he had the answer to most problems, if anyone cared to listen.

Paul Theroux, The Mosquito Coast

I use TextWranglerhttp://www.barebones.com/products/textwrangle… as my main editor, and I use the Text Filter menu a lot. This is part of a series of articles on how to use text filters

If you’ve thinking of converting a site to Tufte CSS (or partially, as I’ve done here), I’ve a quick and simple way to make Tufte block quotes into an epigraph that you can use to start a piece off and set the tone.

It’s easy to take some text and wrap it as I’ve been through before with more complex examples. Combine this with the block quoting filter and you have an epigraph:

#! /usr/bin/env ruby
# encoding: UTF-8

original = ARGF.readlines.join

print "<div class='epigraph'>#{original}</div>"

Save this into ~/Library/Application Support/TextWrangler/Text Filters and it should be available via the Text > Apply Text Filter menu with the name you gave the file.

I’ll continue to add all my text filters to a repo on Github, so you can always check for changes therehttps://github.com/yb66/TextWrangler-text-fil….

Added on:
Last updated: