n-pn / hmark

Yet another markup language

Home Page:https://hmark.nipin.xyz/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Highmark

A bastard child of markdown and bbcode. Combining the flexibility of bbcode tags with the convenient of some markdown markups.

Installation

TODO

Usage

TODO

Cheatsheet

Inline elements

Markup:

  • Inline element with no attribute: [mark]content[/mark]
  • Inline element with attributes: [mark attr1="value1" attr2="value2"]content[/mark]
  • Inline element short hand: [mark body="content" /]

Example

Lorem [b]ipsum [i]dolor[/i] sit[/b] amet, [url href="http://consectetur.com"]consectetur[/url] adipisicing elit.

Yield:

<p>
  Lorem <strong>ipsum <em>dolor</em> sit</strong> amet,
  <a href="http://consectetur.com">consectetur</a> adipisicing elit.
</p>

Current supported inline elements:

Markup HTML evaquilent Description
[b] <strong> strong emphasis
[i] <em> emphasis
[u] <u> underline
[s] <s> strikethrough
[sup] <sup> superscript
[sub] <sub> subscript
[math] <math> math
[code] <code> code

Markdown-esque markups:

Inline

Type Special markup Html output
bold *text* text
italic _text_ text
code `text` text
emoji :grinning: 😀
link <http://example.com> http://example.com
link with title <google.com>(Google) Google
image !<https://picsum.photos/200>

Single line

Type Markup Output
h1 = Heading

Heading

h2 == Heading

Heading

h3 === Heading

Heading

hr --- <hr />

Multi lines

Blockquote

Markup

> block
>
> > nested block

Output

block

nested block

Unordered list

Markup

- list item 1
- list item 2

Output

  • list item 1
  • list item 2

Ordered list

Markup

- list item 1
- list item 2

Output

  1. list item 1
  2. list item 2

Code block

Markup

```js
console.log('Hello, World!')
```

Output

console.log('Hello, World!')

Table

Markup

| Tables        |      Are      |   Cool |
| ------------- | :-----------: | -----: |
| col 3 is      | right-aligned | \$1600 |
| col 2 is      |   centered    |   \$12 |
| zebra stripes |   are neat    |    \$1 |

Output

Tables Are Cool
col 3 is right-aligned $1600
col 2 is centered $12
zebra stripes are neat $1

BBCode-esque tags

TODO

Block

Markup:

  • No attribute:

    [[tag]]
    content
    [[/tag]]
    
  • With attributes:

    [[tag attr1="value1" attr2="value2"]]
    content
    [/url]
    
  • auto closing

    [[tag option="value" body="content" /]]
    

Examples:

  1. Syntax highlight

    [[code lang="ruby"]]
    print "Hey!"
    [[/code]]
    
  2. Ascii art, poems

    [[ascii]]
    /\_/\
    =( °w° )=
    )   (  //
    (__ __)//
    [[/ascii]]
    
  3. Spoiler/collapsible block

    [[spoiler title="Spoiler"]]
    Hidden content.
    [[/spoiler]]
    
  4. Math block

    [[math syntax="latext"]]
    \Gamma(z) = \int_0^\infty t^[z-1]e^[-t]dt\,.
    [[/math]]
    
  5. Hidden content

    [[crypted hash="hmark"]]
    U2FsdGVkX18dmf1WcEODtR/m0vnPezX918/9/qHI56g=
    [[/crypted]]
    

License

MIT

About

Yet another markup language

https://hmark.nipin.xyz/

License:MIT License


Languages

Language:JavaScript 79.1%Language:TypeScript 11.9%Language:Svelte 6.9%Language:HTML 2.1%