himd
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i himd

Weekly Downloads

0

Version

0.0.1

License

MIT

Unpacked Size

6.86 kB

Total Files

6

Last publish

Collaborators

  • k0michi