rTypeset

A typographic pre-processor for HTML inspired by Typeset.js that gives you:

 

Raw

Yjarni Sigurðardóttir spoke to NATO from Iceland yesterday: "Light of my life, fire of my florins -- my sin, my soul. The tip of the tongue taking a trip to 118° 19' 43.5"."

"She's faster than a 120' 4" whale." Piña co­ladas were widely consumed in Götterdämmerung from 1880--1912. For the low price of $20 / year from Ex­hi­bits A-E... Then the duplex came forward. "Thrice the tower, he mounted the round gunrest, 'awaking' HTML. He can print a fixed num­ber of dots in a square inch (for in­stance, 600 × 600)."

Typeset

Yjarni Sig­urðardót­tir spoke to NATO from Ice­land yes­ter­day: Light of my life, ­fire of my florin­s – my s­in, my ­soul. The tip of the ­tongue ­tak­ing a trip ­to 118° 19′ 43.5″.”

She’s ­faster than a 120′ 4″ whale.” Piña co­ladas were widely consumed in Göt­ter­däm­merung from 1880–1912. ­For the low price of $20 / year from Ex­hi­bits A–E… Then the duplex came ­for­ward. Thrice the ­tow­er, he ­mount­ed the round ­gun­rest, awak­ing’ HTML. He can print­ a ­fixed num­ber of dot­s in a square inch (­for in­s­tance, 600 × 600).”

Installation

gem install rtypeset

Usage

require 'typeset'

raw_html = <<HTM
<p>Yjarni Sigurðardóttir spoke to NATO from Iceland yesterday:
"Light of my life, fire of my florins -- my sin, my soul.
The tip of the tongue taking a trip to 118° 19' 43.5".":</p>
HTM

# Output beautifully-formatted HTML
puts Typeset.typeset(raw_html)
    

About

Written by Trevor Fountain on a slow Tuesday, in response to a someone on Hacker News asking for a Ruby port of Typeset.js