If you'd like to provide updated information and do not have access to directly edit, please contact the site admin; thanks!
pat_hyphenate
pat_hyphenate
A Textpattern CMS plugin for typography lovers & exigent designers that automatic makes hyphenation in web page contents using soft hyphens.
Purpose
The texts on the web suffer from aestetic differences (blank space's widths) between each words when they are justified. Maybe it's the reason why the CSS "text-justify;" property isn't used often. The only (poor) solution was to use the sign ­
(utf-8 encoding hyphen) which has a big problem: the text become often unreadable for the copy writers. This plugin makes automatic hyphenation in web text content using soft hyphens. Your web pages will be as beautiful as book printings.
Supports the peculiarities of different languages (actually 19).
Light version
A light version of this plugin is available for tests. Notice: this plugin version is very limited and doesn't reflect all features (only one language is supported: Spanish. Settings are set to default and can't be changed. No unlimited time upgrades offer from remote service). Download the pat_hyphenate light version from the txp-fr.net website (french Textpattern CMS Network).
Installation
Uncompress the file. Put the _hyphenator
directory, and all its content, into your /textpattern
directory. Be sure to give write access to the /textpattern/_hyphenator
directory (CHMOD 775 or CHMOD 777).
Usage
<txp:pat_hyphenate content="" lang="" />
Attributes
content
(required): choose which text content to hyphenate.
Only 2 available options: body or excerpt.
If unsets, displays a warning message. Default: bodylang
(optional): sets the content language. Default: Textpattern's back-office language.
Useful for multilingual websites with eventually the help of a<txp:variable />
tag.
In that only case, replace the double quotes surrounding yourvariable
into thelang
attribute with simple quotes.
Notice: if your text content has some <code>
or <pre>
tags in it, the hyphenation doesn't occur and the text is shown by the native <txp:body />
or <txp:excerpt />
tags.
Example
Using in remplacement of the native <txp:body />
tag:
<txp:pat_hyphenate content="body" lang="en" />
which automaticaly add hyphens on all words for your body articles wrote in English accordingly with the lingual rules.
Personal dictionary
Due to the language complexity, for some words the hyphens are not displayed. You have a Personal dictionary (located under the "Content" tab) in order to add your personal rules. The words (one word by lines) you write here must have an hyphen (-
) where you want to add an... hyphen ;). The "Personal Dictionary" is reactive: if you change your back-office language, a corresponding dictionary language is loaded. So, multilingual websites get benefits with this feature. All dictionary files are created if they don't exist.
Languages support:
- bn
- de
- en
- es
- fi
- fr
- gu
- hi
- it
- ka
- ml
- nl
- or
- pa
- pl
- ru
- sv
- ta
- tev
Plugin's options (admins access only)
Visit the pat_hyphenate Options (under the "Extensions" tab) to install your Textpack plugin translation language file or to install upgrades.
Plugin's Preferences
Access to Plugin's Prefs in order to:
- Set your PayPal Transaction ID your receive when you bought this plugin. Needed if you want to grab all the future plugin upgrades if available (unlimited time offer).
- Typographic configurations:
- Set the character remplacement used for hyphens. Default and best choice:
­
- Minimum characters on the left: characters to keep before an hyphen.
- Minimum characters on the right: characters to keep after an hyphen.
- Minimum characters: when to apply hyphens.
- Maximum characters: when to stop hyphens.
- Set the character remplacement used for hyphens. Default and best choice:
Changelog
- 3rd September 2013: light version (free).
- 14th May 2013: v0.2.3. Add plugin's prefs.
- 12th May 2013: v0.2.2.a Add creation on the fly feature for the dictionary-$lang.txt file.
- 9th May 2013: v0.2.2. Add a Textpack support. Add an upgrade feature for the plugin.
- 8th may 2013: v0.2.1. Add tests on
<code>
&<pre>
tags. Thanks for notice CEBE. - 7th may 2013: v0.2. Personal dictionary box added in the TXP back-office.
- 5th may 2013: v0.1 first commit with only front usage.
Credits
Thanks to Core Dev Team who makes Textpattern CMS so awesome.
Thanks to the creators of the Hyphenator library.
Many thanks to (one of my prefered TXP plugin programer) CEBE for her good advices.