Extension:TEI

The TEI extension makes MediaWiki compatible with TEI XML P5, allowing to use TEI instead of Wikitext in some or all wiki pages.

It is currently a work in progress. It aims at providing an implementation of a subset of TEI, probably inspired by TEI simplePrint with an XML editor and a WYSIWYG editor.

Currently only a small set of TEI tags are supported, excluding the TEI header. A simple XML editor is provided with validation and autocomplete based on a configurable ODD bundled with the extension. A (buggy) beginning of VisualEditor customization is also available. A demo wiki is updated daily with the latest version of the extension. A bug tracker dashboard is available.

Installation
This extension depends on the following extensions:
 * CodeMirror: in order to provide syntax highlight to the XML editor
 * VisualEditor:to provide a VisualEditor for TEI. Parsoid installation is not required to allow usage on servers without node.js.
 * Math: for math rendering.

By default the  ContentModel is not enabled anywhere. You could, e.g. create a new namespace called "TEI" and enable TEI by default in it by adding to your :

An other option is to use  to change the content model of some pages from "wikitext" to "TEI".

How to customize the TEI ODD
A TEI ODD is used to define the validation of TEI content. It might also be used in the future to customize the HTML rendering. The ODD used by default is stored in the  file of the extension git repository. After having modified it you should update the internal JSON definition file used directly by running  from the main directory of the TEI extension.

How this extension work

 * It defines a new content format in the  and   classes.
 * The class  is used to provide access to the current ODD. It is read from the   JSON file that is generated from an ODD (see previous section).
 * The class  validates a DOM tree against a  . It is written directly in PHP to get better error messages, building automata to validate node children and tags values.
 * The classes  and   handle the rountrip conversions between TEI and HTML.
 * There is a small set of unit tests in the  folder, especially for the HTML from/to TEI conversion. The roundrip conversion tests are in   file.