arraysize: 0


Method 1: using the standard page editor with WikiEditor and CodeEditor

If WikiEditor and CodeEditor are installed (recommended), any page in the Cetei namespace is automatically associated with an Ace code editor that includes syntax highlighting for XML and other useful features. See documentation on Github. Without those extensions, it should default to the plain source code editor that comes with MediaWiki.

Method 2: using other form extensions

The default editor above focuses on a single document, but sometimes your editing environment may require other content or features to be placed somewhere alongside your editor, such as images for transcription or comparison. Some MediaWiki extensions are available that let you design your own forms. Of those that exist, FlexForm is known to support our use case and Page Forms is likely to do so.

Ace editor

Either way, you can hook up the Ace editor to your form, which is optional but recommended, as follows:

  • Add {{#cetei-ace:}} anywhere in the page. This is necessary for loading the required JS.
  • Add the class "ace-editor" to your textarea input. It should be possible to apply it to multiple textareas, although it is probably best used sparingly.

This feature currently comes with CETEIcean v0.4, but may become part of another extension in the future.

Form extension: FlexForm

The FlexForm extension allows you to embed HTML5 forms in your wiki.

<input type="textarea" name="xmlcontent" class="ace-editor" html="all"><!-- content goes here --></input>
  • To load Ace, use the instructions above.
  • To make sure FlexForm does not filter out all manner of tags in the TEI, set "html" to "all". Be aware though of any potential risks involved in allowing XML in your form.
  • One piece is still missing. Where the example says "content goes here", we use a parser function to fetch content from the wiki page containing our XML and load it here (unparsed).
{{#cr-transfer-data:
|page=Cetei:...
|mode=transcluderaw
}}

The use of mode=transcluderaw should ensure that the content is loaded without being first parsed.

Example

For an example, see Lab/Parallel/Transcription.

Form extension: Page Forms

Page Forms is a popular extension for adding forms to your MediaWiki site. Likely to work with our use case, but not tested. Unlike FlexForm, Page Forms uses a special page to load a form, does not support editing multiple documents together and may lack some of the flexibility that you do get with FlexForm. On the other hand, Page Forms is probably easier to start with if you're new to MediaWiki.

Example of syntax for an Ace-enabled input:

{{{field|free text|input type=textarea |class=ace-editor |style=height:500px }}}