# markdown-simple-ast

> # Installation ``` $ npm i -D markdown-simple-ast ```

Latest version **1.2.1** (published 2017-09-01) · ISC license · 0 weekly downloads

## Install

```sh
npm install markdown-simple-ast
pnpm add markdown-simple-ast
yarn add markdown-simple-ast
bun add markdown-simple-ast
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.1 |
| Published | 2017-09-01 |
| First published | 2017-08-22 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | seanjm |

## Links

- npm: https://www.npmjs.com/package/markdown-simple-ast
- npm.io page: https://npm.io/package/markdown-simple-ast

## Recent versions

- 1.2.1 (latest) — 2017-09-01
- 1.2.0 — 2017-09-01
- 1.1.5 — 2017-08-31
- 1.1.4 — 2017-08-31
- 1.1.3 — 2017-08-31
- 1.1.2 — 2017-08-31
- 1.1.1 — 2017-08-30
- 1.1.0 — 2017-08-30
- 1.0.13 — 2017-08-29
- 1.0.12 — 2017-08-28
- 1.0.11 — 2017-08-26
- 1.0.10 — 2017-08-25
- 1.0.9 — 2017-08-25
- 1.0.8 — 2017-08-25
- 1.0.7 — 2017-08-25
- … 7 more at https://npm.io/package/markdown-simple-ast/versions

## README

# File size
## 6.14 kB

# Installation
```
$ npm i -D markdown-simple-ast
```

# Usage
```javascript
  const md = require("markdown-simple-ast");
  md("# Markdown\nParagraph");
  // [{
  //    type: "h1",
  //    depth: 0,
  //    children: ["Markdown"]
  // }, {
  //    type: "p",
  //    depth: 0,
  //    children: ["Paragraph"]
  //  }
  // ]
```

# Node types
### Inline

#### Strong
\*\*Strong\*\*
```
  {
    type: "strong",
    children: ["Strong"]
  }
```

#### Emphasis (Italics)
\*Emphasis\*
```
  {
    type: "emphasis",
    children: ["Emphasis"]
  }
```

#### Strikethrough (del)
\~\~Strikethrough\~\~
```
  {
    type: "strikethrough",
    children: ["Strikethrough"]
  }
```

#### Image
\!\[A picture](http://www.cats.com/pictures/cat00001.jpg)
```
  {
    type: "img",
    src: "http://www.cats.com/pictures/cat00001.jpg",
    alt: "A picture"
  }
```

#### Inline code
\`var inline_code`
```
  {
    type: "inline-code",
    children: ["var inline_code"]
  }
```

### Links

#### Link
\[A link](http://www.google.com)
```
  {
    type: "a",
    href: "http://www.google.com",
    children: ["A link"]
  }
```

#### Reference style link
\[Reference style link][1]
```
  {
    type: "rlink",
    href: "1",
    children: ["A reference style link"]
  }
```

#### Reference
\[arbitrary case-insensitive reference text]: https://www.mozilla.org
```
  {
    type: 'ref',
    depth: 0,
    href: 'https://www.mozilla.org',
    link: 'arbitrary case-insensitive reference text'
  }
```

### Block

- `depth` is relative depth to the block parent

#### Block quote
\> Block quote
```
  {
    type: "quote",
    depth: 0,
    children: [{
      type: "p",
      depth: 0,
      children: ["Block quote"]
    }]
  }
```

#### Horizontal rule
\_\_\_ or \*\*\* or \-\-\-
```
  {
    type: "hr",
    depth: 0,
    children: []
  }
```

#### Paragraph text
Paragraph text
```
  {
    type: "p",
    depth: 0,
    children: ["Paragraph text"]
  }
```

#### Heading
\# Heading

Maximum heading size is `6`

```
  {
    type: "h1",
    depth: 0,
    children: ["Heading"]
  }
```

#### Unordered list
\- List items

\- List items

\- List items

```
  {
    type: "ul",
    depth: 0,
    children: [{
      type: "li",
      children: ["List items"]
    }
    ...
    ]
  }
```

#### Ordered list
1. Ordered list items

2. Ordered list items

3. Ordered list items

```
  {
    type: "ol",
    depth: 0,
    children: [{
      type: "li",
      children: ["Ordered list items"]
    }
    ...
    ]
  }
```

---
_Source: https://npm.io/package/markdown-simple-ast · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
