Terms highlighting plugin

This DokuWiki plugin allows definition of term which is then highlighted using <acronym> tag throughout the page.

Syntax

Dokuwiki Syntax:

<term Title>Text description</term>

Example:

  <term Plugin>Computer program that can, or must, interact with another program to provide a certain function</term>

will highlight all occurences of word Plugin as acronym with popup description, as you can see on this page.

This is useful whenever you write a big article and you wish to have some term highlighted across the document and you either don‘t have access to dokuwiki configuration files or simply don‘t want to clutter the config with terms used only locally.

Pavel 2005/08/17 23:58

Notes

  • Title parameter is not case sensitive. ‘tItlE’ is the same as ‘title‘. This can be changed inside code, removing strtoupper() commands will make title case sensitive.
  • Acronym tags defined inside acronyms.conf or acronyms.local.conf file cannot be overriden with term definition.
  • This plugin needs support for subfolders inside plugin folder. It was introduced in DokuWiki on 08-02-2005. So it will not work in older releases. It is possible to make it working in older version by splitting plugin into two plugins.

Plugin

Step 1: Check requirements

This plugin needs DokuWiki 2005-08-02 or later. You can check this by viewing the source of one of your DokuWiki pages: it contains a header with the DokuWiki version. Example:

<meta name="generator" content="DokuWiki Release 2005-08-02" />

If you have an older version, you can either upgrade DokuWiki or split this plugin into two parts. To split this plugin in two parts, please replace these file locations in the following steps:
/lib/plugins/term/syntax/add.php → /lib/plugins/term_add/syntax.php /lib/plugins/term/syntax/show.php → /lib/plugins/term_show/syntax.php /lib/plugins/term/style.css → /lib/plugins/term_show/style.css

Step 2: The dokuwiki plugin Termadd

This is the term registering plugin, which parses definition and pushes term into internal list.
To install, put the following PHP file into
/lib/plugins/term/syntax/add.php (for DokuWiki version 2005-08-02 and later) or into
/lib/plugins/term_add/syntax.php (for DokuWiki version prior to 2005-08-02):

PHP file

Step 3: The dokuwiki plugin Termshow

This is the term rendering plugin that will recognize words and highlight them if found in list of terms.

To install, put the following PHP file into
/lib/plugins/term/syntax/show.php (for DokuWiki version 2005-08-02 and later) or into
/lib/plugins/term_show/syntax.php (for DokuWiki version prior to 2005-08-02):

PHP file

Step 4: Stylesheet

To install, put the following PHP file into
/lib/plugins/term/style.css (for DokuWiki version 2005-08-02 and later) or into
/lib/plugins/term_show/style.css (for DokuWiki version prior to 2005-08-02):

CSS file


You can customize this to totally differentiate terms from acronyms, for example using yellow background etc.

Bugs

I have installed your terms dokuwiki plugin, but it causes a problem with underlined text. With term installed, underlined text is rendered in HTML as “some text another text__” instead of “some text__ another text“. I am using dokuwiki-2005-09-22, and I have installed the files in term_add and term_show, as stated. The terms display okay, but underlined text is corrupted, as stated. — Aux
This is now fixed. Please grab updated code for show.php. — Pavel 2006/02/16 17:50 CET
Thanks a lot for that. I confirm that it‘s fixed the bug. -:-) Aux 2006/03/07
Nope__, with the latest 2007-06-26b dokuwiki release, the underline is still broken.
Please replace in the connectTo() function of show.php the regexp ‘(?⇐\b)[a-zA-Z_\-]+(?=\b)’ by ‘(?⇐\b)[a-zA-Z\-_]+(?=
\b)|(?⇐\b)[a-zA-Z\-_]+(?=\b)’, and the underline will work again. — dc 2007/08/22

Todo

  • Solve conflict with internal acronym parsing, so one can override configured acronym with her own term.
  • Make some optimization so not every word in page gets passed to termshow.

Discussion

Hi, on DokuWiki Release 2006-03-09 i have problem with installation, i have created all three files, plugin comes up in plugin manager, but unfortunatelly there is no html output produced after i put even your examples in the wiki code :(, anyone experienced such a behaviour before

 
dokuwiki/plugin/term.txt · Last modified: 2007/08/22 15:38 UTC by 207.45.248.19
 
Recent changes RSS feed Creative Commons License Donate to DokuWiki author Valid XHTML 1.0 Valid CSS Driven by DokuWiki Debian served Run on Apache Powered by PHP eAccelerated