0.0.1 • Published 1 year ago

himd v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Himd (Hierarchically Indented Markdown)

Himd is basically Markdown, but it is outlined with indentations. Himd clarifies the sections of text and helps you organize the document structure. This library provides functions to convert Himd text into Markdown.

The following example shows how Himd text looks like:

# Heading 1
  Paragraphs...

  # Heading 2
    Paragraphs...

    # Heading 3
      Paragraphs...

  # heading 2
    Paragraphs...

The example above is converted into Markdown like this:

# Heading 1
Paragraphs...

<section>

## Heading 2
Paragraphs...

<section>

### Heading 3
Paragraphs...

</section>

</section>

<section>

## heading 2
Paragraphs...

</section>

You can optionally prevent the emission of <section></section>.

Installation

$ npm i himd
$ yarn add himd

Usage

import * as himd from 'himd';

const markdown = himd.compile(`# Heading 1
  Paragraphs...

  # Heading 2
    Paragraphs...`);

/*
markdown == `# Heading 1
Paragraphs...

<section>

## Heading 2
Paragraphs...

</section>`
*/

Known issues

  • Lines starting with # within code blocks may not be handled correctly.

License

MIT License

0.0.1

1 year ago