And so I present to you rTypeset, a typographic pre-processor for HTML written in pure Ruby. Check out the code for rTypeset on Github, or install it yourself and have a play around with the output by installing the gem:
gem install rtypeset
That’s literally all it takes to get started.
require the typeset gem and you’re good to go to produce beautiful, typeset HTML from your Rails apps or Jekyll blogs:
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>
# Output beautifully-formatted HTML