z0.is
NOTMARKDOWN(1) General Commands Manual NOTMARKDOWN(1)

notmarkdown-html, notmarkdown-gpha trivial markdown to gopher and html static page generator

notmarkdown file.md | notmarkdown-html >file.html

notmarkdown file.md | notmarkdown-gph >file.gph

notmarkdown-html converts markdown to html and notmarkdown-gph converts markdown to geomyidae(8) .gph format. The supported subset of markdown is described in notmarkdown(5)

To convert an entire website from markdown to html and gopher:

find . -name "*.md" -print -exec sh -euc '
	notmarkdown "$0" | notmarkdown-html | cat head.html - >${0%.md}.html
	notmarkdown "$0" | notmarkdown-gph | cat head.gph - >${0%.md}.gph
' {} \;

To map HTTP-style domain name to subdirectories:

$ cd /var/gopher
$ notmarkdown wiki/index.md | SERVER=wiki.example.com PREFIX=wiki notmarkdown-gph >wiki/index.gph
$ notmarkdown news/index.md | SERVER=news.example.com PREFIX=news notmarkdown-gph >news/index.gph

notmarkdown(5), geomyidae(8)

Josuah Demangeon <me@josuah.net>

$Mdocdate: Jully 18 2021$ OpenBSD 6.9
NOTMARKDOWN(5) File Formats Manual NOTMARKDOWN(5)

NotMarkdowna subset of markdown used by notwiki

The NotMarkdown format is a subset of the markdown format, with fewer, and unambiguous conversion rules:

NotMarkdown uses a first pass of line-based syntax, forming blocks such as paragraphs, list or headings. The following syntax occurences provoke switching from the current block to a new block:

  • Empty lines:
    Line of the first block.
    
    Line of the second block.
  • Lines with only ‘=’ or ‘-’, which set the previous block to h1/h2.
    This is a setext-style heading
    ==============================
    This is part of the paragraph, there may be a
    blank line above.

These patterns are matched at line start, opening a new block:

/ - / +
Unordered lists. Any space before, at least one after.
/ 2. / ...
Ordered lists. Any space before, at least one after.
, ##, ### ...
Headings. Any space before, at least one after.
Link reference. No space before, at least one after.
/ ```
Consecutive lines starting with a leading tab — as well as lines after ``` alone on a line until the next ``` — are literal blocks. No conversion is done inside the block, and formatting is preserved.
Quoted text. Unlike markdown, it cannot contain list or any other block syntax, but support all inline syntax.

Within each block, these syntax element are matched:

Italic text.
Bold text.
Bold italic text.
Inline link “link” with description “desc”.
Link with description “desc” refering to “ref”.
Link with description “descref” refering to “descref”.
Image with alt-text “alt” and refernce “ref” for source.
Inline image with alt-text “alt” and “link” for source.

The source repository comes with a doc/index.md file that is a complete document example.

notmarkdown-gph(5), notmarkdown-html(5), NotWiki's wiki

Josuah Demangeon <me@josuah.net>

April 18, 2020 OpenBSD 6.9