@smotaal.io/markout

smotaal.io/markout

Usage no npm install needed!

<script type="module">
  import smotaalIoMarkout from 'https://cdn.skypack.dev/@smotaal.io/markout';
</script>

README



Markout
HTML-flavoured Markdown

Markout borrows a lot of nice features from Markdown, but uses a completely different rendering architecture that makes it easy to also leverage builtin features of the actual HTML renderer.

While the engine caters primarily to the richer features of the DOM, it does so with clear intent to make it work in a shell-based environment longer-term.

Current experimental efforts divide the rendering into two phases, the first portion uses a custom tokenizer that captures HTML and other notation, yielding the static content (HTML for now) output, the second portion uses a custom element and real-time DOM operations to yield the dynamic content (HTML for now) tailored to every aspect of the user experience.

Compatibility Notes

  • Headings

    • HTML Headings
    • ATX Headings
    • Ruled Headings Excluded
  • Fenced Blocks

    • Syntaxes

      one of md/markdown, html, css, json, js/javascript, es/ecmascript

      defaults to markup

    • Markdown Triple-Grave-Block Notation

      Note: Additionally allows annotations after close fence — not recommended for cross-compatibility.

    • Markdown Triple-Tilde-Block Excluded

    • Markdown Indented-Block Excluded

  • Block Quotes

    • HTML Block/Inline Quotes

    • [-] Markdown Block Quote Notation

      Note: Not yet fully implemented in some places, not limited to lists.

  • Tables

    • HTML Tables
    • Markdown Tables Excluded


Excluded notation is not planned to be supported by the engine directly, but indirect support can potentially be introduced in pre/post transformations.

Features

Styles

  • Markout Attribute Styles

    • `one`
      one
      one
    • ` … one … `
      one
      one
  • Markdown-Style Italics

    • `one _two_ three`
      one _two_ three
      one two three
    • `_one_two_three_`
      _one_two_three_
      one_two_three
    • `_one__two__three_`
      _one__two__three_
      one__two__three
    • `one *two* three`
      one *two* three
      one two three
    • `one*two*three`
      one*two*three
      onetwothree
    • `*one*_two_*three*`
      *one*_two_*three*
      onetwothree
  • Markdown-Style Bold

    • `one **two** three`
      one **two** three
      one two three
    • `one**two**three`
      one**two**three
      onetwothree
    • `**one****two****three**`
      **one****two****three**
      onetwothree
    • `one __two__ three`
      one __two__ three
      one two three
    • `_one__two__three_`
      __one__two__three__
      one__two__three
    • `__one____two____three__`
      __one____two____three__
      one____two____three
  • Markdown-Style Bold + Italics

    • `one **_two_ three**`
      one **_two_ three**
      one two three
    • `__*one*two*three*__`
      __*one*two*three*__
      onetwothree
  • Markdown-Style Strikethrough

    • `one ~~two~~ three`
      one ~~two~~ three
      one two three
    • `one~~two~~three`
      one~~two~~three
      onetwothree
    • `~~one~~two~~three~~`
      ~~one~~two~~three~~
      onetwothree
    • `~~one~~~~two~~~~three~~`
      ~~one~~~~two~~~~three~~
      onetwothree
  • Markdown-Style Escapes (ie not styled)

    • `one\*two\*three`
      one\*two\*three
      one*two*three
    • `\_one_two_three\_`
      \_one_two_three\_
      _one_two_three_
    • `one\**two\**three`
      one\**two\**three
      one**two**three
    • `one\*\*two\*\*three`
      one\*\*two\*\*three
      one**two**three
    • `one\~~two\~~three`
      one\~~two\~~three
      one~~two~~three
    • `one\~\~two\~\~three`
      one\~\~two\~\~three
      one~~two~~three

Links

  • Markdown-Style Links
- [Link]()
- [Link](?)
- [Link](#)
- [Link](./README.md)
- [Link](.)
- [Link](..)
- [Link](/)
  • Markdown-Style References
- [Alias Reference][referenced-alias]
- [Not Alias Reference]
- [Non-Aliased Reference][undefined-alias]

[unreferenced-alias]: ./README.md
[referenced-alias]: ./README.md
  • Alias Reference
  • [Not Alias Reference]
  • [Non-Aliased Reference][undefined-alias]

Note: aliases render as hidden anchors

  • Markout-Style References
- [[Reference Link]]
- [Reference Link][]

[Reference Link]: ?

Note: aliases render as hidden anchors

Lists

Note: Markdown has limited support for this!

Headings

  • ATX headings
# Heading 1
---
## Heading 2
---
### Heading 3
---
#### Heading 4
---
##### Heading 5
---
###### Heading 6
---
####### No Heading 7

Heading 1


Heading 2


Heading 3


Heading 4


Heading 5

Heading 6

####### No Heading 7

  • HTML headings
<h1>Heading 1</h1>

---
<h2>Heading 2</h2>

---
<h3>Heading 3</h3>

---
<h4>Heading 4</h4>

---
<h5>Heading 5</h5>

---
<h6>Heading 6</h6>

---
<h7>No Heading 7</h7>

Heading 1


Heading 2


Heading 3


Heading 4


Heading 5


Heading 6


No Heading 7

Heading Groups

Note: Markdown does not support this!