Content last modified Monday 6 March 2017
hop to #bottom
Categories:
Author:
Current version:
0.2.3. (Public)
About It:
Get it:
Rate it:
  • Helpful?
  • 1 Yes
  • 0 No
Flag it:

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 diffe­rences (blank space's widths) bet­ween each words when they are justi­fied. Maybe it's the reason why the CSS "text-justify;" pro­perty isn't used often. The only (poor) solu­tion was to use the sign ­ (utf-8 encoding hyphen) which has a big pro­blem: the text be­come often un­readable for the copy writers. This plugin makes auto­ma­tic hyphe­nation in web text content using soft hy­phens. Your web pages will be as beauti­ful as book prin­tings.
Supp­orts the pecu­lia­rities 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 acc­ess 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 war­ning message. Default: body
  • lang (optional): sets the content language. Default: Textpattern's back-office language.
    Useful for multi­lingual websites with event­ually the help of a <txp:variable /> tag.
    In that only case, replace the double quotes surround­ing your variable into the lang 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 accor­dingly with the lingual rules.

Personal dictionary

Due to the language complexity, for some words the hyp­hens are not displayed. You have a Per­sonal dic­tiona­ry (located under the "Content" tab) in order to add your per­sonal 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 corres­ponding dictio­nary language is loaded. So, multi­lingual 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 Text­pack plugin trans­lation langua­ge 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. Nee­ded if you want to grab all the future plugin up­grades if available (unlimited time offer).
  • Typographic configurations:
    • Set the character remplacement used for hyphens. Default and best choice: &shy;
    • 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.

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.

Article Request Count:
Keywords/tags:
Initially released:
0.1. (Private)
Posted here:
11 Jun 2013
Article modified:
03 Sep 2013

If there is a comment form at the Information URL, you may want to leave your comments/questions there or at the Forum thread for quicker feedback. Otherwise, comment away:

Your comment will NOT be submitted until you click the 'Submit' button on the next pageload.

Subscribe to this article's comments RSS feed. [ ? ]   View Recent Comments across the site.

You know you want to visit the Archives.

Browse

Categories


Articles

There are also tag clouds, 'cause those are fun.
Published with Textpattern