Skip to content

no-markup-markup/nmm

Repository files navigation

The No-Markup-Markup markup language

No-Markup-Markup (nmm) is a heavily opinionated markup language. Its intended use is for writing scientific manuscripts. It is opinionated in at least the following senses:

  • nmm is intended to be as what-you-see-is-what-you-get (WYSIWYG) as possible, only deviating from this goal for necessities such as cross-references.

  • In line with the WYSIWYG goal, available markup options are very few. Users are expected to make heavy use of the quite generous Unicode coverage of symbols used in scientific writing. For example, instead of LaTeX's $\alpha$ users are expected to simply write α (U+03B1), or even 𝛼 (U+1D6FC “Mathematical Italic Small Alpha”).

  • Currently, nmm has two semantics: raw text and HTML. The raw text semantics is not flexible at all: it reflects a specific approach to manuscript organization and layout that the nmm creators like. The HTML semantics is flexible only in the sense that one might override the default CSS. (One may of course also do some JavaScript magic—please do not!) Of course, one may write one's own semantics. nmm is capable of generating an XML representation of the abstract syntax tree of an nmm source. Thus using these XML representations, one may implement one's own semantics—though doing so most likely would be a non-trivial amount of work.

Project status

Heavily work-in-progress:

  • currently very unpolished;

  • not user friendly—unforgiving grammar, uninformative error messages and inadequate documentation.

Why design another markup language for scientific writing? What is wrong with, for example, Markdown?

  • While Markdown is indeed quite WYSIWYG, the designer of the language wanted even more WYSIWYG—in particular, WYSIWYG with respect to the intended semantics.

  • The designer of the language wanted a particular semantics—for example, sections and paragraphs numbered using the section symbol (‘§’) respectively the paragraph symbol (‘¶’). To the best of the language designer's knowledge, no close-to-WYSIWYG language provided this semantics out of the box.

  • For the language creators, it has so far been a fun and educational project!

Examples

Do note that the nmm source below include tabs. These tabs cannot be turned into spaces. When working with nmm sources, a tab width of 6 spaces corresponds to the raw text semantics.

nmm source:
This is a no-markup-markup document, sporting the following features:

[]	Bullet lists:

	-	Here is one bullet item.

	-	Here is another one.

[]	Numbered lists with labels that are either

	[]	automatic, or

	[!]	custom.

	Furthermore, each item can be *named* and *referred to*:

	[]	ITM:x
		The named item can be referred to anywhere in the
		document.

	[]	ITM:y
		When referring to [ITM:x] above, any common initial path
		shared between the location of the referring expression
		and the location of its referent will be omitted. The same
		applies with respect to [ITM:z] below.

	[S]	ITM:z
		Of course, items with custom labels can also be named!

Due to the feature mentioned in [ITM:y], a reference to [ITM:x] or
[ITM:z] occurring elsewhere may appear differently.

[]	Displayed lines of text suitable for mathematical equations,
	which are either

	()	automatically labeled (and named),	DSP:one
	(+)	custom labeled (and named), or,		DSP:two
		unlike [DSP:one] above, unlabeled.
default raw text semantics:
This is a no-markup-markup document, sporting the following
features:

(1)   Bullet lists:

      ─     Here is one bullet item.

      ─     Here is another one.

(2)   Numbered lists with labels that are either

      (a)   automatic, or

      (!)   custom.

      Furthermore, each item can be n̲a̲m̲e̲d̲ and r̲e̲f̲e̲r̲r̲e̲d̲ ̲t̲o̲:

      (b)   The named item can be referred to anywhere in the
            document.

      (c)   When referring to (b) above, any common initial path
            shared between the location of the referring expression
            and the location of its referent will be omitted. The
            same applies with respect to (S) below.

      (S)   Of course, items with custom labels can also be named!

Due to the feature mentioned in (2)(c), a reference to (2)(b) or
(2)(S) occurring elsewhere may appear differently.

(3)   Displayed lines of text suitable for mathematical equations,
      which are either

      (a)   automatically labeled (and named),
      (+)   custom labeled (and named), or,
            unlike (a) above, unlabeled.

More examples in TODO

Try it out

  • With a flake-enabled* install of the Nix package manager:

    nix run --refresh github:no-markup-markup/nmm
    

    (The --refresh flag may be omitted once a first version is released.)

    * This one should work-out-of-the box:

    https://github.com/DeterminateSystems/nix-installer

  • Without a flake-enabled install of the Nix package manager: sorry, but currently you are on your own.† The following might work:

    • Check flake.nix for buildInputs and make sure you have these installed.

    • Clone this repo and run make bin.

    • Run ./bin/nmm.

    † Help with how to package for other systems very much appreciated! The creators of nmm has no packaging experience outside of the nix ecosystem.

Features

Do note that many of the nmm sources below include tabs. These tabs cannot be turned into spaces.

Text blocks

nmm source:
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore
eu fugiat nulla pariatur.
default raw text semantics:
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim
ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
aliquip ex ea commodo consequat. Duis aute irure dolor in
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
pariatur.

Text marked to be emphasized by the semantics

nmm source:
*Lorem ipsum dolor sit amet.*
default raw text semantics
L̲o̲r̲e̲m̲ ̲i̲p̲s̲u̲m̲ ̲d̲o̲l̲o̲r̲ ̲s̲i̲t̲ ̲a̲m̲e̲t̲.̲

Bullet blocks

nmm source:
-	bullet block 1

-	bullet block 2

-	bullet block 3
default raw text semantics
─     bullet block 1

─     bullet block 2

─     bullet block 3

Automatically labeled item blocks

nmm source:
[]	item block 1

[]	item block 2
default raw text semantics
(1)   item block 1

(2)   item block 2

Manually labeled item blocks

nmm source:
[!]	item block 1

[?]	item block 2
default raw text semantics
(!)   item block 1

(?)   item block 2

Unlabeled displayed blocks

nmm source:
By Pythagoras we have:

	a²+b² = c²
default raw text semantics
By Pythagoras we have:

      a²+b² = c²

Automatically labeled displayed blocks

nmm source:
By Pythagoras we have:

()	a²+b² = c²
default raw text semantics
By Pythagoras we have:

(1)   a²+b² = c²

Manually labeled displayed blocks

nmm source:
By Pythagoras we have:

(P)	a²+b² = c²
default raw text semantics
By Pythagoras we have:

(P)   a²+b² = c²

Displayed block spanning more than one row

nmm source:
()	1+(1+1)
	  = 1+1
	  = 2
default raw text semantics
(1)   1+(1+1)
        = 1+1
        = 2

Verbatim blocks

nmm source:
START	VERBATIM
This text is inside a verbatim block.

Here nothing needs escaping and nothing can be escaped. For each expression E:
⌜\E⌝ renders as ⌜\E⌝.
END	VERBATIM
default raw text semantics
This text is inside a verbatim block.

Here nothing needs escaping and nothing can be escaped. For each expression E:
⌜\E⌝ renders as ⌜\E⌝.

Nested blocks

nmm source:
[]	Pythagoras:

	()	a²+b² = c²

	What a remarkable discovery that was!

[]	Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
	tempor incididunt ut labore et dolore magna aliqua.

	-	a bullet

	-	another bullet
default raw text semantics
(1)   Pythagoras:

      (a)   a²+b² = c²

      What a remarkable discovery that was!

(2)   Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed
      do eiusmod tempor incididunt ut labore et dolore magna aliqua.

      ─     a bullet

      ─     another bullet

Tags, names, IDs and cross-references

nmm source:
[]	ITM:name
	This item block has the tag ‘ITM’ and the name ‘name’ and the ID
	‘ITM:name’.

[]	DEF
	This item block has the tag ‘DEF’. It has no name, and thus
	neither an ID.

[]	Names need not be unique but IDs must be.

[]	Neither tags nor names may include whitespace, which together
	with where they must be placed removes virtually any practical
	need for escaping valid tags or IDs.

[]	Tags allow the semantics to have special treatment of blocks
	with certain tags.

This is a reference to the item block with ID ‘ITM:name’: [ITM:name].
The following displayed block has the ID ‘DSP:Q5’.

()	x+Sy = S(x+y)	DSP:Q5
default raw text semantics
(1)   This item block has the tag ‘ITM’ and the name ‘name’ and the
      ID ‘ITM:name’.

(2)   DEF This item block has the tag ‘DEF’. It has no name, and
      thus neither an ID.

(3)   Names need not be unique but IDs must be.

(4)   Neither tags nor names may include whitespace, which together
      with where they must be placed removes virtually any practical
      need for escaping valid tags or IDs.

(5)   Tags allow the semantics to have special treatment of blocks
      with certain tags.

This is a reference to the item block with ID ‘ITM:name’: (1). The
following displayed block has the ID ‘DSP:Q5’.

(6)   x+Sy = S(x+y)

Chapters, sections, appendices and paragraphs

nmm source:
CH
This is this chapter's (optional) header

§
This is this section's (optional) header

¶
This is this paragraph's (optional) header

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua:

	a²+b² = c²

¶

This is another paragraph. It has no header. As mentioned above, section headers
may also be omitted. This results in poor layout however, as the following
section demonstrates.

§

This is a section without a header.

§ APP
An appendix

This is an appendix. Neither a section nor an appendix must consist of
paragraphs, as this text block demonstrates.

An nmm source is made up of the following, in that order:

-	an optional *preamble part*,

-	an optional *title part*,

-	an optional *author part*,

-	an optional *abstract part*,

-	a non-optional *main part*, and

-	an optional *references part*.

-	The main part must consist of either of:

	-	chapters;

	-	sections (appendices count as sections);

	-	paragraphs;

	-	blocks.

-	*The main part of a chapter* must consist of either of:

	-	sections (appendices count as sections);

	-	paragraphs;

	-	blocks.

-	*The main part of a section*, or *of an appendix*, must consist of
	either of:

	-	paragraphs;

	-	blocks.

-	*The main part of a paragraph* must consist of blocks.

CH

¶

This chapter's header is omitted.
default raw text semantics
            CHAPTER 1
            This is this chapter's (optional) header
            ════════════════════════════════════════

§ 1.1       This is this section's (optional) header
            ────────────────────────────────────────

¶ 1.1.1     This is this paragraph's (optional) header  Lorem ipsum dolor sit
            amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
            ut labore et dolore magna aliqua:

                  a²+b² = c²


¶ 1.1.2     This is another paragraph. It has no header. As mentioned above,
            section headers may also be omitted. This results in poor layout
            however, as the following section demonstrates.



§ 1.2

            This is a section without a header.



§ 1.A       An appendix
            ───────────

            This is an appendix. Neither a section nor an appendix must consist
            of paragraphs, as this text block demonstrates.

            An nmm source is made up of the following, in that order:

            ─     an optional p̲r̲e̲a̲m̲b̲l̲e̲ ̲p̲a̲r̲t̲,

            ─     an optional t̲i̲t̲l̲e̲ ̲p̲a̲r̲t̲,

            ─     an optional a̲u̲t̲h̲o̲r̲ ̲p̲a̲r̲t̲,

            ─     an optional a̲b̲s̲t̲r̲a̲c̲t̲ ̲p̲a̲r̲t̲,

            ─     a non-optional m̲a̲i̲n̲ ̲p̲a̲r̲t̲, and

            ─     an optional r̲e̲f̲e̲r̲e̲n̲c̲e̲s̲ ̲p̲a̲r̲t̲.

            ─     The main part must consist of either of:

                  ─     chapters;

                  ─     sections (appendices count as sections);

                  ─     paragraphs;

                  ─     blocks.

            ─     T̲h̲e̲ ̲m̲a̲i̲n̲ ̲p̲a̲r̲t̲ ̲o̲f̲ ̲a̲ ̲c̲h̲a̲p̲t̲e̲r̲ must consist of either of:

                  ─     sections (appendices count as sections);

                  ─     paragraphs;

                  ─     blocks.

            ─     T̲h̲e̲ ̲m̲a̲i̲n̲ ̲p̲a̲r̲t̲ ̲o̲f̲ ̲a̲ ̲s̲e̲c̲t̲i̲o̲n̲, or o̲f̲ ̲a̲n̲ ̲a̲p̲p̲e̲n̲d̲i̲x̲, must consist of
                  either of:

                  ─     paragraphs;

                  ─     blocks.

            ─     T̲h̲e̲ ̲m̲a̲i̲n̲ ̲p̲a̲r̲t̲ ̲o̲f̲ ̲a̲ ̲p̲a̲r̲a̲g̲r̲a̲p̲h̲ must consist of blocks.




            CHAPTER 2
            ═════════

¶ 2.1       This chapter's header is omitted.

Title, author, abstract, references

nmm source:
TITLE:
	Some chapters

AUTHOR:
	Donald Duck

AUTHOR:
	Mickey Mouse

ABSTRACT:
	Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
	eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut
	enim ad minim veniam, quis nostrud exercitation ullamco laboris
	nisi ut aliquip ex ea commodo consequat.

	Duis aute irure dolor in reprehenderit in voluptate velit esse
	cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
	cupidatat non proident, sunt in culpa qui officia deserunt
	mollit anim id est laborum.

CH
First chapter

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad
minim veniam, quis nostrud exercitation ullamco laboris nisi ut
aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum
dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est
laborum.

CH
Second chapter

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad
minim veniam, quis nostrud exercitation ullamco laboris nisi ut
aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum
dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est
laborum.

§ REFS

-	Euler, Leonhard (1740): De summis serierum reciprocarum. In:
	Commentarii academiae scientiarum Petropolitanae, volume 7,
	pages 123–134

-	Tarski, Alfred, and Andrzej Mostowski, and Raphael M.
	Robinson (1953): Undecidable Theories; North-Holland Publishing
	Company; Amsterdam.
default raw text semantics
════════════════════════════════════════════════════════════════════
Some chapters
════════════════════════════════════════════════════════════════════

Donald Duck

Mickey Mouse


ABSTRACT
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim
ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
cupidatat non proident, sunt in culpa qui officia deserunt mollit
anim id est laborum.




CHAPTER 1
First chapter
═════════════

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim
ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
cupidatat non proident, sunt in culpa qui officia deserunt mollit
anim id est laborum.




CHAPTER 2
Second chapter
══════════════

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim
ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
cupidatat non proident, sunt in culpa qui officia deserunt mollit
anim id est laborum.




REFERENCES
══════════

─     Euler, Leonhard (1740): De summis serierum reciprocarum. In:
      Commentarii academiae scientiarum Petropolitanae, volume 7,
      pages 123–134

─     Tarski, Alfred, and Andrzej Mostowski, and Raphael M.
      Robinson (1953): Undecidable Theories; North-Holland
      Publishing Company; Amsterdam.

Restating paragraphs

nmm source:
¶ FCT:pythagoras

	a²+b² = c²


¶

I think what Pythagoras discovered is such a remarkable fact that I
want to state it again!


¶ rpt FCT:pythagoras
default raw text semantics
¶ 1         FACT

                  a²+b² = c²


¶ 2         I think what Pythagoras discovered is such a remarkable fact that I
            want to state it again!


¶ 3         FACT 1 [restated]

                  a²+b² = c²

Under typical circumstances, no need for escape sequences

Even under most atypical circumstances there is no need:

nmm source:
¶ EX:no_escape

¶ ← this is the paragraph symbol.

While a line ‘¶’ (optional followed by tag or id, then optionally followed by a
header and one or more empty lines) always marks the start of a paragraph, ‘¶ ←
this’ does not. Thus no need for escaping in the preceeding text block.

\¶ If one wants to, one may still escape any magic---as in used for
markup---character.

¶

One possible exception to the intended no need for escaping is the need for
sometimes escaping the symbol ‘\*’ (by writing ‘\\\*’). The creators of
No-Markup-Markup acknowledges that this is unfortunate. However, they think
that in most scientific writing ‘\*’ should be reserved for footnotes*.

-	Instead of using ‘*’ for multiplication one should use ‘×’. (One should
	not use the abonimation ‘⋅’!)

-	For denoting *the Kleene star operator* as ‘\*’, one may have to resort
	to escaping. As the No-Markup-Markup grammar uses ‘\*’ as the notation
	for this operator, this is somewhat ironic.

-	For including code snippets, which of course may unavoidably include ‘*’,
	support for verbatim input of files is planned.

* No-Markup-Markup support for footnotes is planned.

¶

At least theoretically there are situations where escaping of something other
than ‘\*’ is needed.

-	This is a reference to the first paragraph: [EX:no_escape]. This is the
	markup that was used to produce that reference: ‘\[EX:no_escape]’. (This
	is the markup that was used to produce ‘\[EX:no_escape]’:
	‘‘\\\[EX:no_escape]’’.)

-	But, for example, ‘[x,y,z]’ is not valid syntax for a cross-reference,
	and thus needs no escaping.
default raw text semantics
¶ 1         ¶ ← this is the paragraph symbol.

            While a line ‘¶’ (optional followed by tag or id, then optionally
            followed by a header and one or more empty lines) always marks the
            start of a paragraph, ‘¶ ← this’ does not. Thus no need for escaping
            in the preceeding text block.

            ¶ If one wants to, one may still escape any magic---as in used for
            markup---character.


¶ 2         One possible exception to the intended no need for escaping is the
            need for sometimes escaping the symbol ‘*’ (by writing ‘\*’). The
            creators of No-Markup-Markup acknowledges that this is unfortunate.
            However, they think that in most scientific writing ‘*’ should be
            reserved for footnotes*.

            ─     Instead of using ‘*’ for multiplication one should use ‘×’.
                  (One should not use the abonimation ‘⋅’!)

            ─     For denoting t̲h̲e̲ ̲K̲l̲e̲e̲n̲e̲ ̲s̲t̲a̲r̲ ̲o̲p̲e̲r̲a̲t̲o̲r̲ as ‘*’, one may have to
                  resort to escaping. As the No-Markup-Markup grammar uses ‘*’
                  as the notation for this operator, this is somewhat ironic.

            ─     For including code snippets, which of course may unavoidably
                  include ‘*’, support for verbatim input of files is planned.

            * No-Markup-Markup support for footnotes is planned.


¶ 3         At least theoretically there are situations where escaping of
            something other than ‘*’ is needed.

            ─     This is a reference to the first paragraph: ¶ 1. This is the
                  markup that was used to produce that reference:
                  ‘[EX:no_escape]’. (This is the markup that was used to produce
                  ‘[EX:no_escape]’: ‘‘\[EX:no_escape]’’.)

            ─     But, for example, ‘[x,y,z]’ is not valid syntax for a
                  cross-reference, and thus needs no escaping.

Help out

TODO

About

The No-Markup-Markup markup language

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published