# broccoli-markdown-resolver

> Broccoli plugin to resolve markdown files to a tree with content and frontmatter parsing

Latest version **0.0.1** (published 2017-09-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install broccoli-markdown-resolver
pnpm add broccoli-markdown-resolver
yarn add broccoli-markdown-resolver
bun add broccoli-markdown-resolver
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2017-09-12 |
| First published | 2017-09-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | ^4.5 \|\| 6.* \|\| >= 7.* |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Will Viles |
| Maintainers | willviles |
| Keywords | broccoli-plugin, javascript, markdown, md, resolver, frontmatter |

## Links

- npm: https://www.npmjs.com/package/broccoli-markdown-resolver
- Repository: https://github.com/willviles/broccoli-markdown-resolver
- Homepage: https://github.com/willviles/broccoli-markdown-resolver#readme
- Issues: https://github.com/willviles/broccoli-markdown-resolver/issues
- npm.io page: https://npm.io/package/broccoli-markdown-resolver

## Dependencies (3)

- [mkdirp](https://npm.io/package/mkdirp.md) ^0.5.1
- [front-matter](https://npm.io/package/front-matter.md) ^2.2.0
- [broccoli-plugin](https://npm.io/package/broccoli-plugin.md) ^1.3.0

## Alternatives

- [@mdxeditor/editor](https://npm.io/package/@mdxeditor/editor.md) — 962.4K weekly downloads
- [mmdb-lib](https://npm.io/package/mmdb-lib.md) — 680.9K weekly downloads
- [playcanvas](https://npm.io/package/playcanvas.md) — 36.2K weekly downloads
- [@glw907/cairn-cms](https://npm.io/package/@glw907/cairn-cms.md) — 967 weekly downloads
- [markdown-to-confluence](https://npm.io/package/markdown-to-confluence.md) — 103 weekly downloads

## Recent versions

- 0.0.1 (latest) — 2017-09-12

## README

Broccoli Markdown Resolver ![Download count all time](https://img.shields.io/npm/dt/broccoli-markdown-resolver.svg) [![npm](https://img.shields.io/npm/v/broccoli-markdown-resolver.svg)](https://www.npmjs.com/package/broccoli-markdown-resolver)
======

Given an input node, Broccoli Markdown Resolver outputs a file exporting data for our .md files, with content and frontmatter parsed automatically.

## Installation
```
yarn add broccoli-markdown-resolver
```

## Usage

Consider the following folder structure inside our `inputNode`.

```shell
.
├── quick-start.md
├── sdks.md
└── sdks/
    └── node-js.md
```

Run the resolver and choose an output destination.

```js
var MarkdownResolver = require('broccoli-markdown-resolver');

var outputNode = new MarkdownResolver(inputNodes, {
  outputFile: '/markdown-file-data.js'
});
```

## Data

Require the data

```js
const markdownData = require('./path/to/markdown-file-data');
```

### markdownData.trees

Returns a tree of markdown data for each inputNode.

```js
{
  "path/to/input-node": [
    {
      "path": "path/to/input-node/quick-start",
      "content": "\nGet started quickly with Acme API.\n",
      "attributes": {
        "title": "Quick Start"
      }
    },
    {
      "path": "path/to/input-node/sdks",
      "children": [
        {
          "path": "path/to/input-node/sdks/node-js",
          "content": "\nAbout the Acme Node.js SDK.\n",
          "attributes": {
            "title": "Node.js SDK"
          }
        }
      ],
      "content": "\nAcme offer SDKs in many different languages.\n",
      "attributes": {
        "title": "SDKs",
        "custom-attr": true
      }
    }
  ]
}
```

### markdownData.files

Returns a list of all files in a flat object format.

```js
[
  {
    "path": "path/to/input-node/quick-start",
    "content": "\nGet started quickly with Acme API.\n",
    "attributes": {
      "title": "Quick Start"
    }
  },
  {
    "path": "path/to/input-node/sdks/node-js",
    "content": "\nAbout the Acme Node.js SDK.\n",
    "attributes": {
      "title": "Node.js SDK"
    }
  },
  {
    "path": "path/to/input-node/sdks",
    "children": [
      {
        "path": "path/to/input-node/sdks/node-js",
        "content": "\nAbout the Acme Node.js SDK.\n",
        "attributes": {
          "title": "Node.js SDK"
        }
      }
    ],
    "content": "\nAcme offer SDKs in many different languages.\n",
    "attributes": {
      "title": "SDKs",
      "custom-attr": true
    }
  }
]
```

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