A compiler for "Ecmarkdown" algorithm shorthand into HTML.
npm install ecmarkdownEcmarkdown is a Markdown-inspired syntax for writing text and algorithms in the style of the ECMAScript spec. This package will convert Ecmarkdown input to HTML output.
Some of Ecmarkdown's biggest benefits are when using it to write algorithm steps, without the many formalities HTML requires for list items and inline formatting of common algorithmic constructs.
``"return"
1. Assert: Type(_iterator_) is Object.
1. Assert: _completion_ is a Completion Record.
1. Let _hasReturn_ be HasProperty(_iterator_, )."return"
1. ReturnIfAbrupt(_hasReturn_).
1. If _hasReturn_ is true, then
1. Let _innerResult_ be Invoke(_iterator_, , ( )).`
1. If _completion_.[[type]] is not ~throw~ and _innerResult_.[[type]] is ~throw~, then
1. Return _innerResult_.
1. Return _completion_.
will be converted to
`html`
"return").
"return", ( )).
#### Lists
Lists are written as a series of lines, each starting with either a number, e.g. 1., or a star, e.g. *. Inside a list item line you can use inline Ecmarkdown constructs. The first list item's number determines the starting number in the output (via
); subsequent list items' numbers are ignored.Lists can be nested. To do so, use any number of spaces to indent; as long as the number of spaces is consistent, list items will stay together in a nested list.
List items can be given arbitrary attributes by putting
[attr="something"] at the start of the item, as in 1. [attr="something"]. This will generate . Multiple attributes are also supported as comma-seperated lists, as in [attr1="a", attr2="b"].#### HTML Blocks
Any line which starts with a block-level HTML tag (as defined by CommonMark, with the addition of
, , , , , , , , , , and ) is a HTML block line. Ecmarkdown cannot be used on the line starting a HTML block, but subsequent lines before the closing tag do allow it.#### Opaque HTML Blocks
The tags
, , , ,,