Extensible modular markup/Practical guide

From Wikiversity
Jump to navigation Jump to search

What EMM means for me now in practice? You can create a file in a mix of XHTML1.0 or XHTML1.1 syntax and some EMM markup to auto-generate a XHTML1.0 or XHTML1.1 file from your "template".

It is useful to produce sophisticated HTML files with such functionality as including other files, auto-generating table of content, syntax highlighting, etc. In the future even Turing-complete programming inside the template XML files will be supported!

Currently only the following modules are supported in the XML template:

  • XInclude
  • Comment
  • Structured Sections
  • Table of Content
  • Syntax Highlighting

XML Boiler[edit | edit source]

The support is available using XML Boiler software. This software is written in Python, in the future a rewrite in D Language is planned.

Installation[edit | edit source]

Download it from https://pypi.org/project/xml-boiler/#files and install the Wheel file:

  1. Install Python.
  2. pip install NAME-OF-THE-FILE.whl (or pip3 install NAME-OF-THE-FILE.whl on some platforms such as Debian or Ubuntu Linux). If you run the installation on Unix, you need to run it as root to install the script bin/boiler.

Usage[edit | edit source]

This is black magic. Just type this command:

boiler -i YOUR-EMM-FILE.xml -o OUTPUT-XHTML1-FILE.xhtml --preload http://portonvictor.org/ns/base --preload 'http://portonvictor.org/ns/EMM' \
  pipe 'c -t http://www.w3.org/1999/xhtml -n ignore + t http://portonvictor.org/ns/base#NSClean'

It will do everything automatically!