This plugin allows users to edit TWiki content with their favorite wiki syntax. Users can set their preferred syntax as a user preferences setting in their user profile page. Edit syntax converters convert the TWiki Markup Language (TML) into another syntax when a user edits a topic, and converts it back after edit. The content is always saved in TML, that is, different users can edit the same content using different edit syntax.
The edit syntax rules depend on the edit syntax converter activated by a user.
Currently available converters:
Syntax | To Activate | Syntax Summary and Help | Converter topic |
---|---|---|---|
TWiki |
* Set EDITSYNTAX = |
Summary, Help | N/A |
Creole |
* Set EDITSYNTAX = Creole |
Summary, Help | Creole converter |
Mediawiki |
* Set EDITSYNTAX = Mediawiki |
Summary, Help | Mediawiki converter |
Syntax converters are activated with an EDITSYNTAX preferences setting in the user profile page. Copy these bullets to the Personal Preferences section:
* Activate preferred edit syntax (see available edit syntax converters at TWiki.EditSyntaxPlugin) : * Set EDITSYNTAX = Mediawiki
To disable the converter (e.g. to use TWiki syntax), set the EDITSYNTAX to an empty value.
Steps to create a new edit syntax converter, using the FooWiki syntax as an example:
Foowiki
. Base name must not be a WikiWord, e.g. not FooWiki
.
FoowikiEditSyntaxRegex
topic in the TWiki web, taking MediawikiEditSyntaxRegex as a template. *EditSyntaxRegex
are listed automatically in the converter topic.
FoowikiWikiSyntaxSummary
syntax summary topic in the TWiki web, taking MediawikiWikiSyntaxSummary as a template. /MediawikiTextFormattingRules
in the "more formatting help" link with /FoowikiTextFormattingRules
.
FoowikiTextFormattingRules
syntax help topic in the TWiki web, taking MediawikiTextFormattingRules and/or Foowiki's edit syntax help text as a template.
The converter topic contains bullets with RegularExpression rules: * TYPE: /from/to/
or * TYPE: /from/to/ # comment
TYPE
is T2X
for "TWiki to External" syntax conversion, or X2T
for "External to TWiki" syntax conversion.
/from/to/
are regular expressions to convert from one format to the other.
# comments
to annotate the expressions are optional. The hash sign needs to be prefixed with a leading space to be recognized as a comment.
Example lines:
T2X: /(^|[\n\r])---\+([^\n\r]*)/$1=$2 =/
X2T: /(^|[\n\r])=(.*?) ?=(?=[\n\r]|$)/$1---\+$2/ # H1
Plugin settings are stored as preferences variables. To reference a plugin setting write %<plugin>_<setting>%
, i.e. %EDITSYNTAXPLUGIN_SHORTDESCRIPTION%
data/debug.txt
)
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 TWiki server.
EditSyntaxPlugin.zip
in your twiki installation directory. Content: File: | Description: |
---|---|
data/TWiki/EditSyntaxPlugin.txt | Plugin topic |
data/TWiki/MediawikiEditSyntaxRegex.txt | Mediawiki edit syntax converter topic |
data/TWiki/MediawikiWikiSyntaxSummary.txt | Mediawiki edit syntax summary topic |
data/TWiki/MediawikiTextFormattingRules.txt | Mediawiki edit syntax help topic |
data/TWiki/MediawikiEditSyntaxTest.txt | Mediawiki edit syntax test topic |
lib/TWiki/Plugins/EditSyntaxPlugin.pm | Plugin Perl module |
TinyMCEPlugin
to the {PluginsOrder}
setting, such as: SpreadSheetPlugin, TinyMCEPlugin
Set EDITSYNTAX = Mediawiki
EDITSYNTAX
setting in your Main.TWikiPreferences
and set it to an empty value
twiki/templates/edit.pattern.tmpl
and change "%SYSTEMWEB%.WikiSyntaxSummary"
to "%SYSTEMWEB%.%EDITSYNTAX%WikiSyntaxSummary"
twiki/templates/edit.*.tmpl
template files as needed
*EditSyntaxRegex
converter topics so that only TWikiAdminGroup members can edit the topics.
*EditSyntaxRegex
converter topics so that only TWikiAdminGroup members can edit the topics. It is not recommended to use this plugin on a public website.
Plugin Author: | TWiki:Main.PeterThoeny![]() |
Copyright: | © 2006-2011 TWiki:Main.PeterThoeny![]() © 2008-2011 TWiki:TWiki.TWikiContributor ![]() |
License: | GPL (GNU General Public License![]() |
Plugin Version: | 2011-06-04 |
Change History: | |
2011-06-04: | TWikibug:Item6701![]() ![]() |
2010-10-29: | Fix to make this plugin coexist with new WYSIWYG editor in TWiki-4.2 and later |
2006-07-09: | Initial version |
TWiki Dependency: | $TWiki::Plugins::VERSION 1.1 |
CPAN Dependencies: | none |
Other Dependencies: | none |
Perl Version: | 5.005 |
Benchmarks![]() |
GoodStyle nn%, FormattedSearch nn%, EditSyntaxPlugin nn% |
Plugin Home: | http://TWiki.org/cgi-bin/view/Plugins/EditSyntaxPlugin![]() |
Feedback: | http://TWiki.org/cgi-bin/view/Plugins/EditSyntaxPluginDev![]() |
Appraisal: | http://TWiki.org/cgi-bin/view/Plugins/EditSyntaxPluginAppraisal![]() |
Related Topics: TWikiPlugins, DeveloperDocumentationCategory, AdminDocumentationCategory, TWikiPreferences