ULMUL (Ultra Lightweight MarkUp Language)

“ULMUL” is an original Ultra Lightweight MarkUp Language. ULMUL texts can be converted into HTML5 with “ulmul2html5” command and into XHTML with “ulmul2xhtml” command. TeX style equations are converted into MathML. ULMUL is written in Ruby. You can also use ulmul.rb as a library.

Homepage of ULMUL: ulmul.rubyforge.org/

Download ULMUL from: rubyforge.org/projects/ulmul or rubygems.org/gems/ulmul

Features

* TeX style equations between two dollar marks ($) and between Eq. and /Eq.
  will be converted into MathML. You can use Firefox version 3.x, IE+MathPlayer,
  etc. to read MathML.
* ulmul2xhtml output is good with the Slidy presentation environment
  http://www.w3.org/Talks/Tools/Slidy/ using Firefox+CSS+XHTML+JavaScript.
  Please use ulmul-slidy.js and ulmul-slidy.css in the package.
* Lines starting from "#" are comments.
* You can add your conversion rules to @subs_rules.
* List of contents will be automatically generated.
* "= ABC EFGH" will be the document title and the cover page of Slidy.
* Use utf-8 for ULMUL texts.
  Specify your natural language with a --language option, e.g. --language=en.

Installation of ULMUL

There are two different ways to install ULMUL.

I. Conservative way; use setup.rb

ulmul-X.Y.Z.tgz package can be installed as:

$ tar zxf ulmul-X.Y.Z.tgz
$ cd ulmul-X.Y.Z
$ su
# ruby setup.rb

Note that the eim_xml and math_ml libraries are required.

II. RubyGems users can take an easy way

There is an easy way, if you are a RubyGems user:

$ su
# gem install ulmul

If you do not have the eim_xml and math_ml libraries, gem will download and install the library automatically.

How to write ULMUL texts

The encode of input file must be utf-8.

lines

empty

Empty lines divide paragraphs.

heading

Starting with “= ”, “== ”, “=== ”, “==== ”, “===== ”, and “====== ”. “= ” will be used for the title.

asterisk

Lines starting with

" *"
"   *"
"     *"
"       *"
"         *"

become itemize.

offset

Lines starting with some spaces but not asterisks become verbatim lines.

end

EOF or “=end” end the process.

ignore

Lines starting with“#” and “=begin” are ignored.

normal

Other lines.

Other rules

* Lines after "=end" are ignored.
* Add your substitution rules to @subs_rules.

Equations

Input:

Mass $m$ can be converted into energy $E$ as
Eq. 1
           E=mc^2.
/Eq.

Output:

Mass $m$ can be converted into energy $E$ as Eq. 1

E=mc^2.

/Eq.

To view the equations in MathML correctly, please use

* Firefox http://mozilla.jp/firefox/
* IE8 + MathPlayer http://www.dessci.com/en/products/mathplayer/
* etc.

Figures

Input:

Fig. 1 ruby.jpg
  The is a dummy figure for an example.
  Cute red logo of Ruby, isn't it?
/Fig.

Output: Fig. 1 ruby.jpg

The is a dummy figure for an example.
Cute red logo of Ruby, isn't it?

/Fig.

Usage

There are ulmul2xhtml and ulmul2html5 commands.

Use .html extensions even for ulmul2xhtml outputs.

To view HTML5 documents, change the setting of the “html5.enable” entry to “true” in “about:config”. See kb.mozillazine.org/About:config for details.

Examples

$ ulmul2xhtml without-equations.txt > without-equations.html   # XHTML1.0 Transitional
$ ulmul2xhtml with-equations.txt    > with-equations.html      # XHTML1.1 + MathML2.0
$ ulmul2xhtml -n 'Takeshi Nishimatsu' -s ulmul-slidy.css -j ulmul-slidy.js presentation.txt > presentation.xhtml
$ ulmul2html5 with-equations.txt    > with-equations.html      # HTML5

Command options

–help

Show a help message.

-s, –style

Specify stylesheet filename.

-n, –name

Specify your name for copyright notices.

-j, –javascript

Specify JavaScript filename.

-l, –language

Specify natural language. Its default is “en”.

-c, –contents-range

Range of “Contents”. Its default is “2..3”. If you do not need “Contents” at the beginning of the output HTML file, set it 3..2.

ULMUL and Slidy examples

* http://loto.sourceforge.net/feram/
  * Its source is http://loto.sourceforge.net/feram/README
* http://loto.sourceforge.net/feram/doc/film.xhtml
  * It is a Slidy presentation made from http://loto.sourceforge.net/feram/doc/film.txt
* http://ulmul.rubyforge.org/index.en.html
  * Its source is http://ulmul.rubyforge.org/README-en (this document)

TODO

* rescue syntax errors (raises) in an input file and report the
  errors as #{$FILENAME}:#{file.lineno}:...
* Unit test, tests/ulmul_test.rb
* @body must be XML object, not a String.
* Tables.
* References to figures, tables and code.
* Citation.
* Include highlighted code between Code.../Code.

Subversion repository

You can checkout the latest source tree of ULMUL anonymously from RubyForge with svn(1) command:

$ svn co svn://rubyforge.org/var/svn/ulmul/ulmul/trunk ulmul

Copying

Copyright © 2008-2010 by Takeshi Nishimatsu

ulmul.rb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. You can copy, modify and redistribute ulmul.rb, but only under the conditions described in the GNU General Public License (the “GPL”).

W3C has copyrights for ulmul-slidy.js and ulmul-slidy.css. Their original names were slidy.js and slidy.css, respectively. Takeshi Nishimatsu slightly modified them. You can download the original package, slidy.zip, from www.w3.org/Talks/Tools/Slidy/ . You can find their licenses at www.w3.org/Consortium/Legal/copyright-documents and www.w3.org/Consortium/Legal/copyright-software .

Author of ULMUL

Takeshi Nishimatsu (t_nissieatyahoo.co.jp) t-nissie.users.sourceforge.net/

# Local variables: # mode: rd # compile-command: “rake index.en.html” # End: