Markup Language Zoo

11 min read Original article ↗

A round up of interesting and novel ideas in the design space of markup and templating languages.

I recently did a survey of markup langauges, mostly via web searching, and looking at repositories under the “markup-languages” topic on Github.

The more interesting ones I found had some kind of focus or an underlying philosophy. Too many were basically “Markdown is amazing but also it sucks so here's my amazing Incompatible-Markdown-Alike for my personal blog”.

Some of these languages no longer exist, except as pages recorded in the hallowed temple of archive.org.

Here are some of the more interesting ones I happened across.

I'm not going to discuss or mention common ones such as: HTML, Docbook, Dita, TEI, The TeX family, Djot, Gemtext, Typst, Creole et al., or Markdown ad nauseum.

Markup Languages

Listed in alphabetical order.

Aftertext

An alternative to inline markup … You write some text. After your text, you add your markup instructions with selectors to select the text to markup, one command per line.


Here is a silly another example, with a lot of aftertext.
  strike a silly
  italics a lot
  bold with
  underline aftertext
  https://www.example.com Here 
		
Example of Aftertext Markup
<a href="http://www.example.com">Here</a> is <strike>a silly</strike> another example, <b>with</b> <i>a lot</i> of <u>aftertext</u>.
		
Aftertext Output

Archie ML

ArchieML is a structured text format optimized for human writability. It was created at The New York Times to make it easier to write and edit structured text on deadline that could be rendered in web pages, or more specifically, rendered in interactive graphics.


title: Hi, World!
description: This is the description of the hello world post.

[+content]
# A Blog Post with Titles

This is the content of a blog post.

{.object}
text: This is a nested object I can add into my content, parsed with some kind of custom component.
number: 1
{}

{.text}
value:
\* These are bullet points
\* Second bullet point
:end
{}
[]
		
Example of Archie ML markup

(I do idly wonder if the New York Times is still using this, if it ever really did)

AtJSON

Similar to Aftertext, this JSON formatted language decouples the semantic and styling information from the raw content.

“Our goals at Condé Nast are to provide best-in-class content to our readers, and best-in-class tools for our editors. To do this, we need a format that can be rich, extensible, and portable. It is important that the content source provide little ambiguity about how a story should be displayed.”

“… When constructing this format, we chose to separate the original text from the data associated for this purpose. ”


{
  "content": "The best writing anywhere, everywhere.",
  "annotations": [{
    type: "-offset-italic",
    start: 4,
    end: 8,
    attributes: {}
  }]
}
Example of AtJSON code

This renders as:

The best writing anywhere, everywhere.

cxt

cxt is an ultra-simple markup language similar in spirit to BBCode, designed to be as easy as possible to parse (for computers and humans) while delivering any features necessary to the CivBoot project


[!]##########################################################################[/]
[h1]cxt: text markup for civilization[/]

["][b]Note:[b] This file is created using cxt. To see the source view
   README.cxt in this directory.[/]

It should not take more than a few minutes to know how to read and write
documentation.

cxt is an ultra-simple markup language similar in spirit to @BBCode, designed
to be as easy as possible to parse (for computers [i]and[i] humans) while
delivering any features necessary to the @CivBoot project.

cxt is designed to:[+]
 * Make document writing easy.
 * Make document parsing easy.
 * Make reading of raw (text) documents easy.
 * Make consuming structured data from documents easy.
[/]
		
Example of CTX markup

D★Mark

D★Mark is a language for marking up prose. It facilitates writing semantically meaningful text, without limiting itself to the semantics provided by HTML or Markdown. If you’re a technical writer looking for a flexible markup language, D★Mark might be a good fit.


#para I am a paragraph with an %em{amazing} inline element.

#list[unordered]
	#item glob patterns
	#item regular expression patterns
	#item legacy patterns
		
Example of D★Mark markup

Frundis

frundis is a tool for compiling documents written in the frundis language, a semantic markup language primarily intended for supporting authoring of novels, but also well suited for many other kinds of documents. The frundis tool can export documents to LaTeX, XHTML 5, EPUB, markdown and groff mom.


.\" Table of Contents
.Tc
.\" A Section (without numbering)
.Sh -nonum Overview
.\" Call to user defined .frundis macro
.frundis
is a tool for compiling documents written in the
.Lk /man/frundis_syntax-5.html "frundis language" ,
a semantic markup language primarily intended for
supporting authoring of novels, but also well suited for
many other kinds of documents.
The
.Lk /man/frundis-1.html Bm -t frundis frundis Em \& tool
can export documents to LaTeX, XHTML\~5, EPUB, markdown
and groff mom.
.P
The language has a focus on simplicity. It provides a few
flexible built-in macros with extensible semantics. It
strives to provide good error messages and catch typos,
while still allowing one to finely control output for a
specific format when needed.
.P
Here is a list of its main features:
.Bl \" Begin list
.It
Common elements such as links, images, cross-references,
lists (including verse), simple tables, table of
contents, etc.
		
Example of Frundis Markup

My Own Private Markup Langauge (MOPL)

I came up with my own markup language to make writing blog posts easier while still leaving the ability to drop down to HTML if I really need it. This isn't even close to being Markdown, Org mode or TeX, but a horrible mishmash of the three, with my own custom addtions.


author: spc
title: ``Lorem ipsum,'' I said, ``dolor sit amet.''
class: testing, debugging, programming
status: Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
email: no
abbr:	HTML	HyperText Markup Language
	HTTP	HyperText Transport Protocol

(omitted)
Lorem ipsum dolor sit amet, <i>consectetur adipiscing *elit*</i>, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua.  ``<span
lang="lt" title="Over the years ...">Ut enim ad minim</span> veniam,'' quis
{-nostrud exercitation-}
		
Example of My Own Private Markup Language code

SAM

SAM is a markup language for semantic authoring. It is not a fixed language like Markdown. It is a meta-language like XML. Markdown has a fixed set of document structures that you can use. SAM, like XML, lets you define and create your own structures to suit your own needs. Unlike XML, and like Markdown, SAM is designed to be easy to write in a plain text editor.

Structured writing essentially divides content into a set of nested named blocks. SAM introduces blocks with a one word label followed by a colon. It shows the nesting of one block inside another by indenting the nested block under its parent. Here is an example of a structured document, a recipe, written in SAM:


recipe: Hard Boiled Egg
    introduction:
        A hard boiled egg is simple and nutritious. It makes
        a quick and delicious addition to any breakfast.

        Hard boiled eggs can also be an ingredients in
        other dishes, such as a {Cobb Salad}(recipe).

    ingredients:: ingredient, quantity
        eggs, 12
        water, 2qt
    preparation:
        1. Place eggs in pan and cover with water.
        2. Bring water to a boil.
        3. Remove from heat and cover for 12 minutes.
        4. Place eggs in cold water to stop cooking.
        5. Peel and serve.
    prep-time: 15 minutes
    serves: 6
    wine-match: champagne and orange juice
    beverage-match: orange juice
    nutrition:
        serving: 1 large (50 g)
        calories: 78
		...
		
Example of SAM markup

SECST

SECST (Semantic, Extensible, Computational, Styleable, Tagged) markup language. Use it to joyfully create compelling, interactive HTML SEO enabled documents. SECST is intended to be a more expressive, but just as easy to learn and use, alternative to Markdown.


:abbr[SECST] is a :strong[S]emantic, :strong[E]xtensible, :strong[C]omputational, :strong[S]tyleable :strong[T]ag oriented markup language. You can use it to joyfully create compelling, interactive, SEO enabled documents backed by HTML.

SECST is intended to be a more expressive, but just as easy to learn and use, alternative to Markdown. It provides these features and more:

:ul[
  - Support for almost all HTML tags.
  - :a(.#tables-of-contents)[Table of contents] and :a(.#footnotes)[footnote management].
  - :a(.#hashtags)[Hashtag] and social media :a(.#mentions)[support].
  - Reactive :a(.#values-and-formulas)[formulas and data import] that are no more complex than Excel formulas, e.g. :code[:value[2 * 2]] = :value[2 * 2].
  - The use of JSON-LD :a(.#structured-data)[structured data] for both content generation/layout and SEO optimization.
  - :a(.#images)[Asset bundling] for images, video, and audio.
  - Server and client generated well structured HTML output resistant to XSS attacks.
]
		
Example of SECST markup

Sexpcode

SexpCode is a specialised mark-up language designed to replace BBCode and, to a lesser extent, user-generated HTML in general. It is not as yet intended as a general-purpose mark-up language, or to replace HTML for general web design.

It permits functions to be defined, and redefined.


{b This is bold text.}

{b This text is bold. {i This text is italic and bold.}}

{b.i This text is both bold and italic.}

{url http://example.com/ Click here!}

{define em i}{em This text is highly semantic.}
		
Example of Sexpcode markup

Tagged{Text}

Tagged{ Text} is a file format for tagging and organizing text with tags. These tags can be whatever the author wishes them to be. The first goal of tagged text is to get your document structured according to whatever organizing tags you care about. Whenever you face a new problem of expressing your ideas, just invent tags that structure your text into something sane.


Blog{
Title{What grinds my gears}
Date{2016-3-4}

P{
Ipsum delio gro! Thrunk fo violio of my Streout Santo Listria?
asddsjk kasjdf ksjf ks fks fkfksj dks fksj f
sdfjs f ksf ksfd s
}

P{
Thats all for now. Be back in a few months after I return
from the intl. space station. Oh, here is a cool equation
I wrote in C++:
}

Equation<<_EOC_
    E = M C ^ 2
_EOC_

}
		
Example of Tagged{Text} markup

DEFINE{ MainCharacter{Bob H. Smith} }
DEFINE{ BirthYear{1971} }

P{
My main character in this novel is named MainCharacter{}. He was born
in the year BirthYear{}.
}
		
Second Example of Tagged{Text} markup

Tjakra Markup Language

Tjakra (cakra) is a markup language that can be used to create PDF documents with simple syntax. Tjakra is expected to be an easier and more powerful markup language than other markup languages such as LaTeX and Markdown.


/ helloworld.tj
// Document configuration
config: {
    papersize: A4;
    margin: normal;
    line-height: 1.0;
    space-bp: none;
    space-ap: none;
    font-family: Times New Roman;
    font-size: 12pt;
    font-weight: normal;
    font-style: normal;
    text-align: left;
}
pages: {
    // Page 1
    header: { // Header section
        align: left;
        p: {
            content: "Hello World";
            text-align: left;
            font-size: 10pt;
        }
    }
    main: { // Main section
        // Title
        h1: {
            content: "{i: Hello World}";
            text-align: center;
            font-size: 16pt;
            font-weight: bold;
        }
    }
    footer: { // Footer section
        align: right;
        p: {
            content: "{pgnum}";
            text-align: right;
            font-size: 10pt;
        }
    }
}
		
Example of Tjakra markup

Templating Languages

Maud

A macro for writing HTML

Maud is an HTML template engine for Rust. It's implemented as a macro, html!, which compiles your markup to specialized Rust code. This unique approach makes Maud templates fast, type-safe, and easy to deploy.


html! {
    h1 { "Hello, world!" }
    p.intro {
        "This is an example of the "
        a href="https://github.com/lambda-fairy/maud" { "Maud" }
        " template language."
    }
}
Example of Maud code

See Also

➡️ Lua-HTML

A Lua implementation of a similar templating language based on Maud

Slim

A lightweight templating engine for Ruby.


doctype html
html
  head
    title Slim Examples
    meta name="keywords" content="template language"
    meta name="author" content=author
    javascript:
      alert('Slim supports embedded javascript!')

  body
    h1 Markup examples

    #content
      p This example shows you what a basic Slim file looks like.

      == yield

      - unless items.empty?
        table
          - items.each do |item|
            tr
              td.name = item.name
              td.price = item.price
      - else
        p
         | No items found.  Please add some inventory.
           Thank you!

    div id="footer"
      = render 'footer'
      | Copyright © #{year} #{author
Example of Slim code