SpellerPagesPlugin
Spell checker based on Perl/JavaScript frontent to GNU Aspell and spellerpages
This plugin provides a JavaScript and perl based frontend to GNU Aspell allowing users to check the spelling of the
edit textbox before saving.
The plugin is based on the perl version of
spellerpages but hacked to turn it into a TWiki plugin. Version 0.5.1 of spellerpages is packaged with the plugin.
Plugin Settings
Plugin settings are stored as preferences variables. To reference a plugin setting write
%<plugin>_<setting>%, i.e.
%INTERWIKIPLUGIN_SHORTDESCRIPTION%
- Set SHORTDESCRIPTION = Spell checker based on Perl/JavaScript frontent to GNU Aspell and spellerpages
- Set DEBUG = 0
- Debug plugin: (See output in
data/debug.txt).
- Set ASPELL_CMD = aspell
- Spelling program to run. Use
/path/to/aspell if the executable is not in the path.
- Set ASPELL_OPTS = -a --lang=en_GB --encoding=utf-8 -C -H
- Options to pass to the spelling program. See
aspell documentation for more. -a | ispell -a compatibility mode (?) Required |
--lang=en_GB | language code. Try also en_US |
--encoding=utf-8 | encoding to expect data to be in. |
-C | consider run-together words legal (useful for WikiWords). |
-H | enter Html/Sgml mode (useful if there is 'real' html in the source). |
- Set FORM_TEXTAREA = main.text
- Javascript identifier of the textarea in edit template to spell.
- #Set FORM_TEXTAREA = EditFormular.text
- Set AUTOSPELL = off
- Automatically check spelling (options are
off, preview, save, both)
- not implemented
If these preferences are set in
TWikiPreferences or
WebPreferences and removed from here, then they can be overridden by preferences defined in a user's home topic.
Plugin Installation Instructions
Note: You do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the plugin on the server where TWiki is running.
- Install GNU Aspell.
- Download the ZIP file from the Plugin web (see below)
- Unzip
SpellerPagesPlugin.zip in your twiki installation directory. Content: | File: | Description: |
bin/spellerpages | Plugin script |
data/TWiki/SpellerPagesPlugin.txt | Plugin topic |
lib/TWiki/Plugins/SpellerPagesPlugin.pm | Plugin Perl module |
pub/TWiki/SpellerPagesPlugin/blank.html | spellerpages-0.5.1 |
pub/TWiki/SpellerPagesPlugin/controls.html | spellerpages-0.5.1 |
pub/TWiki/SpellerPagesPlugin/controlWindow.js | spellerpages-0.5.1 |
pub/TWiki/SpellerPagesPlugin/spellchecker.html | spellerpages-0.5.1 |
pub/TWiki/SpellerPagesPlugin/spellerStyle.css | spellerpages-0.5.1 |
pub/TWiki/SpellerPagesPlugin/wordWindow.js | spellerpages-0.5.1 |
- Edit your
edit template (in the templates directory). The actual file name to edit will depend on the skin you are using, but will usually be edit.pattern.tmpl or edit.tmpl or similar.
- Include necessary JavaScript in template. Add the following line to the
script block so that it reads:
%TMPL:DEF{"script"}%
<!-- INCLUDEJSSPELLERPAGES -->
- Create a 'Check spelling' button. Add something like the following to the
topicaction block:
<input type="button" value="Spell" onClick="openSpellChecker();" />
For example, my
edit.pattern.tmpl now contains the following:
<td class="twikiAddCol">
<input type="button" class="twikiSubmit twikiTertiary" value="Spell" onClick="openSpellChecker();" />
<input type="submit" class="twikiSubmit twikiTertiary" name="action" id="preview" value="Preview" />
<label accesskey="p" for="preview"></label>
</td>
Plugin Info
Related Topics: TWikiPreferences,
TWikiPlugins
--
TWiki:Main.MagnusLewisSmith - 13 Oct 2005