neil on the web!

more unix filters

2008 Oct 16

I’ve built some more unix filters for Text Wrangler, each quite simple but useful.

Lynx

The filter sends the whole document or selected text the Lynx browser. This shows me what a web page or snippet will look like without CSS styling. I can then use the style filter to check readability based on the Lynx output.

#!/bin/sh
# From TextWrangler sends document or selected text
# to lynx which then dumps to stdout
#
lynx -force_html -nostatus -nolist -dump "$1"

PHP

The filter sends the whole document or selected text to PHP. I find this useful for testing my PHP code. This filter does not work with code from include files.

#!/bin/sh
# From TextWrangler sends document or selected
# text to php which then dumps to stdout
#
php -f "$1"

Redcloth

Redcloth implements Texttile text processing using ruby. I’m starting to write portions of web documents with texttile formatting. Redcloth processes the texttile mark up and outputs HTML. Redcloth 3.0.4 seems to implement a subset of texttile formats: it does not understand bc. block code. Redcloth 4.04 does understand bc.: I installed 4.0.4 using gem. Works as advertised.

#! /bin/sh
# From TextWrangler sends document or selected
# text to redcloth which then dumps to stdout
#
redcloth "$1"