degrotesque — A type setter written in Python.
Introduction
degrotesque beautifies text.
degrotesque is a command line application and a Python library that loads a HTML/XML/text/markdown/rst/Python/Java/... file — or several in batch — and for each, it replaces some commonly used non-typographic characters like hyphens, single and double quotes, etc. into their typographic representation for improving the text's appearance. Of course, non-text parts of the respective document, like e.g. HTML-tags, code, or what, are omitted.
E.g.:
"Well - that's not what I had expected."
will become:
“Well — that's not what I had expected.”
I think it looks much better.
The starting and ending quotes have been replaced by “ and ”, respectively. The ' has been replaced by ' and the - by an —. Of course, this script omits HTML elements. It keeps the complete format as-is, and replaces characters by their proper HTML entity name, the unicode entity, or the respective unicode character.
degrotesque is meant to be a relatively reliable post-processing step for type setting web pages or any plain texts before releasing them. Being written in Python, it can be easily embedded in own workflows and can be used on almost all operating systems.
degrotesque supports English, German, and French alternatives currently.
And, degrotesque is free (you may donate).
Examples
degrotesque --input my_page.html --actions quotes.german
Replaces single and double quotes within the file “my_page.html” by their typographic German counterparts.
degrotesque --input my_folder --recursive --no-backup
Applies the default actions to all files in the folder “my_folder” and all subfolders. No backup files are generated. The format of each file is determined using the respective file's extension.
Background
I often write my texts, documentation and web pages using a plain editor. As such, the character " is always used for quotes, a dash is always a minus, etc.
I wanted to have a tool that automatically recognizes which characters should be replaced by their more typographic counterpart and applies the according rules.
I think it's a pity that major Desktop Publishing applications do this on the fly but many and even major web sites still show us plain ASCII characters.
degrotesque does the job pretty fine. After writing / building my pages, the tool converts them to a prettier and typographically more correct form. The structure and format of the pages is remained completely. And as said, degrotesque works reliable.
If you need any consultations, please let me know. If you know better, too.
Future plans
degrotesque is working for me as intended. With the current release, all features I had in mind were implemented. As such, I suppose that new versions of degrotesque will only be released if someone puts new features on the table. Adding some further language-specific things beyond German, French, and English may be of interest. If you need something, you may drop me a mail at daniel@krajzewicz.de.
License
degrotesque is licensed under the BSD license.
