# sundown-ast

> # Description Sundown is a flavor of Markdown with the addition of imports

Latest version **1.4.0** (published 2017-09-13) · ISC license · 0 weekly downloads

## Install

```sh
npm install sundown-ast
pnpm add sundown-ast
yarn add sundown-ast
bun add sundown-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.4.0 |
| Published | 2017-09-13 |
| First published | 2017-09-04 |
| 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/sundown-ast
- npm.io page: https://npm.io/package/sundown-ast

## Recent versions

- 1.4.0 (latest) — 2017-09-13
- 1.3.2 — 2017-09-13
- 1.3.1 — 2017-09-11
- 1.3.0 — 2017-09-11
- 1.2.1 — 2017-09-08
- 1.2.0 — 2017-09-07
- 1.1.0 — 2017-09-07
- 1.0.3 — 2017-09-06
- 1.0.2 — 2017-09-04
- 1.0.1 — 2017-09-04
- 1.0.0 — 2017-09-04

## README

# File size
## 8.77 kB

# Description
Sundown is a flavor of Markdown with the addition of imports

# Installation
```
$ npm i -D sundown-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 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
#2 Heading
```

Maximum heading size is `6`

```
  {
    type: "h2",
    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"]
    }
    ...
    ]
  }
```

#### Tables
Status Code|Error|Description
-|-|-
400|request_conflict|Attempted to create **board** that already exists.
400|request_invalid|Attempted to create invalid board
401|authorization_expired|Authorization token has expired
401|authorization_missing|Authorization token was not found
403|authorization_forbidden|Authenticated user is not allowed this action.

```javascript
[{
type: "table",
depth: 0,
children: [{
  type: "th",
  depth: 0,
  children: [ [ "Status Code" ], [ "Error" ], [ "Description" ] ]
}, {
  type: "td",
  depth: 0,
  children: [ [ "400" ], [ "request_conflict" ], [ "Attempted to create ", { type: "strong", children: ["board"] } ," that already exists." ] ]
}, {
  type: "td",
  depth: 0,
  children: [ [ "400" ], [ "request_invalid" ], [ "Attempted to create invalid board" ] ]
}, {
  type: "td",
  depth: 0,
  children: [ [ "401" ], [ "authorization_expired" ], [ "Authorization token has expired" ] ]
}, {
  type: "td",
  depth: 0,
  children: [ [ "401" ], [ "authorization_missing" ], [ "Authorization token was not found" ] ]
}, {
  type: "td",
  depth: 0,
  children: [ [ "403" ], [ "authorization_forbidden" ], [ "Authenticated user is not allowed this action." ] ]
}]
```

# Import

Three different ways to write your imports

#### Single import
```
@import(file/name.type)
```

#### Multiple import
```
@import(
  file/name.type
  file/name2.type
)
```
```
@import(
  file/name.type
  file/name2.type)
```
```
{
  type: "import",
  depth: 1,
  children: ["file/name.type", "file/name2.type"]
}
```

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