Widon’t Plugin for Textpattern
The aam_widont plugin is a re-implementation of Shaun Inman’s Widon’t 2.1 for WordPress as a Textpattern plugin. It prevents typographical widows—words that appear all by themselves on the last line of a paragraph or title.
Widows make text look unbalanced and awkward, which is why they’re usually avoided in professionally-typeset print works. This plugin, like its WordPress sibling, brings the typographical convention of widow-suppression to the Web.
Download aam_widont-0.1.txt (7.6KB, 45 downloads)
UPDATE (6/10/2007): The aam_widont plugin has been replaced by the aam_typogrify plugin, which includes the same widow-prevention feature and a whole lot more. Check it out!
This is my first Textpattern plugin, so feedback is definitely welcome. If you have problems with aam_widont, please report them in the plugin’s support thread on the Textpattern forum.
Usage
Wrap any text or Textpattern template tags in <txp:aam_widont></txp:aam_widont> to prevent widowed words:
Used With a Textpattern Template Tag
To suppress widows in an article excerpt:
<txp:aam_widont>
<txp:excerpt />
</txp:aam_widont>
Used With Static (X)HTML
You can also use Widon’t in page templates or Textpattern forms, to prevent widows in blocks of static text:
<txp:aam_widont>
<p>Here's some text that doesn't come from a template tag.</p>
</txp:aam_widont>
License
This plugin is provided under the terms of the BSD license.
Credits and Thanks
These people helped aam_widont happen:
- Shaun Inman, who made the original widow-prevention plugin.
- Matt Mullenweg, who updated Widon’t 2.1 with better international character support.
- Alex Shiels—a Textpattern core developer—who wrote a great series of tutorials for Txp plugin development and provides a template and compiler to make it easy to get started.
Comments (6 so far)
-
Superb, thanks so much. Now, how about a port of Typogrify? Perhaps this is something that needs to be built into Textile?
by Charles Roper on Jun 4, 11:22 am
-
Hey Adam, TXP has had this built in pre-4.0.4 (r1783 – UTF-8 update). It’d probably be best to send a patch instead of a plugin.
by JM on Jun 4, 04:27 pm
-
I was about to write the same thing as JM – This is already in Textpattern, via: Admin > Preferences > Advanced. There is a radio button toggle labeled: Prevent widowed words in article titles. So, no plugin or patch needed. :)
That being said, I think it’s dedicated people who write plugins that make TXP so great. I certainly don’t want to discourage you from writing more plugins in the future.
by Nathan Smith on Jun 5, 09:53 am
-
Oops, I read to hastily. I didn’t realize your plugin handles widows for paragraphs too. Very nice!
by Nathan Smith on Jun 5, 09:54 am
-
Even in custom fields! Very cool! I’ll definitely keep this in mind for one of my next projects.
Thanks a lot!by uli on Jun 8, 02:06 pm
Comments are closed for this article.






