1. Introduction

Modular Markup Language (MML) is a semantic document language designed around a simple principle:

Documents should describe meaning rather than formatting.

MML is intended to remain readable as plain text while providing enough structure for parsing, validation, compilation, and semantic analysis.

Unlike Markdown, MML does not rely on symbolic formatting conventions.

Unlike HTML, MML prioritizes semantic relationships and parent-child validation over presentation.


2. Design Goals

MML is designed to be:


3. Core Principles

3.1 Meaning First

Elements should represent meaningful concepts rather than visual presentation.

Preferred:

argument
claim
evidence
timeline
event
comparison
image
caption

Avoided:

div
span
wrapper
container

3.2 Text Wins

If content is not valid markup, it is treated as text.

The parser should never aggressively reinterpret ordinary writing as structure.


3.3 Explicit Structure

All elements must be explicitly opened and closed.


3.4 Semantic Validation

MML validates semantic relationships, not merely syntax.


4. Syntax

4.1 Opening Tags

Opening tags consist of a valid element name.

Example:

claim

Attributes may be included:

section title="Background"

4.2 Element Names

All element names are singular.

Valid:

claim
event
entity
image

Invalid:

claims
events
entities
images

4.3 Attributes

Attributes may only appear on opening tag lines.

Example:

section title="Introduction"

Attributes are parsed only when attached to a valid opening tag.

Example:

section

title="Introduction"

In this example:

title="Introduction"

is plain text.


5. Text Handling

5.1 Automatic Text Nodes

Plain text is automatically wrapped in text elements.

Source:

claim
Markdown introduces an unnecessary abstraction layer.

Internal Representation:

<claim>
  <text>Markdown introduces an unnecessary abstraction layer.</text>

Authors are not expected to manually create text elements in most situations.


5.2 Reserved Words

Reserved words only act as markup when they appear in tag position.

Example:

claim
Arguments are not always unhealthy.

The word "Arguments" is text content.


6. Parsing Rules

6.1 Opening Tag Recognition

A line is interpreted as an opening tag when:


7. Validation Rules

7.1 Parent Validation

Elements may define required parents.

Example:

evidence

requires:

claim

parent.


7.2 Missing Parent Errors

Example:

evidence
Some evidence.

Produces:

Error:
evidence requires parent claim.

The parser should provide structured repair information whenever possible.


8. Element Definitions

8.1 Argument System

argument

Purpose:

Rules:

Allowed Children:

claim

claim

Purpose:

Rules:

Allowed Children:

text
evidence
quote
source

evidence

Purpose:

Rules:

Allowed Children:

text
quote
source

9. Timeline System

timeline

Purpose:

Required Children:

year-start
year-end

Optional Children:

event

A timeline containing only year-start and year-end is valid.


year-start

Rules:


year-end

Rules:


event

Purpose:

Rules:

Allowed Children:

date
text
image
media
source
note
link

date

Rules:


10. Calendar System

calendar

Purpose:

Required Children:

year-month

Optional Children:

event

A calendar containing only year-month is valid.


year-month

Rules:


11. Comparison System

MML supports multiple comparison schemas.


11.1 Before / After Schema

Required Children:

before
after

Example:

comparison

before
Old design.

after
New design.

11.2 Entity Schema

Required:

entity
entity

Optional:

shared

entity

Rules:

Allowed Children:

unique
text

unique

Rules:


shared

Rules:


11.3 Scenario Schema

Required:

scenario
scenario

Each scenario should contain:

conditions

scenario

Rules:

Allowed Children:

conditions
text
note

conditions

Rules:


12. Media System

media

Purpose:

Required Children:

image
audio
video

Optional Children:

caption
source

image


audio


video


caption

Purpose:

Preferred Parent:

media

13. Structural Elements

section

Purpose:

Attributes:

title

Example:

section title="Background"

The title attribute functions as the section heading.


subhead

Purpose:


14. Future Considerations

Potential future areas include:


15. Guiding Principle

A document should remain understandable as plain text while remaining unambiguously parseable as structured semantic data.


15.1 SUPPORT

Check out the README if you're not sure where to start.

You can read the full SPEC here.

Try the PARSER.

You can find the full list of TAGS here.

#specification #draft #syntax #markup #semantic #grammar #language