Acronym To Link Plugin

Last modified by Sergiu Dumitriu on 2021/03/17 21:21

cogConverts Acronyms to Links
TypePlugin
Category
Developed by

xwiki:XWiki.zeljko

Rating
0 Votes
LicenseGNU Lesser General Public License 2.1

Description

On order to recognize word as acronym, it should:

  • have at least two letters
  • start with upper case letter
  • end with uppercase letter or number.

Some examples: TCP, VoIP, IPv6.

Installation

Installation is not standard, but it is also not complicated:

  • go to your web application directory and find xwiki/WEB-INF/lib/xwiki.jar
  • unzip xwiki.jar using any ZIP-compatible archiver
  • inside unpacked folder:
    • open radeox_markup_xwiki.properties
    • add anywhere 
filter.acronym.match=\\\\b\[A-Z\]\[A-Za-z0-9\]\*\[A-Z0-9\]\\\\b(?!\[^<\\\\[\]*\[>\\\\]\])
filter.acronym.print=[$0]

Double all backslashes, I cannot enter them that way

    • open /META-INF/services/com.xpn.xwiki.render.filter.XWikiFilter
    • add 
com.xpn.xwiki.render.filter.XWikiAcronymToLinkFilter

before 

com.xpn.xwiki.render.filter.XWikiLinkFilter
 

    • put XWikiAcronymToLinkFilter.class to /com/xpn/xwiki/render/filter
  • ZIP everything and replace original xwiki.jar Check that directory structure inside JAR file same as in original! Some archivers will add parent directory that will cause malfunction. Safest way to go is to enter directory and do the zipping rather than zipping top level directory.

Example

Another use of a NAS would be in VoIP.

Result

Another use of a [NAS] would be in [VoIP].

Prerequisites & Installation Instructions

Follow these steps:

  • Add the JAR in your container classpath (WEB-INF/lib)
  • Edit xwiki.cfg and add the following line to the list of plugins :
    xwiki.plugins=\
          [...]
           ... ,\
         <plugin package>
  • Restart your container
  • Verify the plugin is properly installed by typing the following in a wiki page :
    {{velocity}}
    $xwiki.<plugin name>.name
    {{/velocity}}

    If the installation has been successful, you will see <plugin name>.

Tags:
    

Get Connected