# markdown-doc-bundler

> Accepts the path of a directory. Produces an object containing the contents of markdown files as strings organized according to the directory's original structure.

Latest version **0.0.13** (published 2016-07-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install markdown-doc-bundler
pnpm add markdown-doc-bundler
yarn add markdown-doc-bundler
bun add markdown-doc-bundler
```

## 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.13 |
| Published | 2016-07-24 |
| First published | 2016-06-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | W. Blaine Price |
| Maintainers | wbprice |
| Keywords | markdown, documentation, bundle |

## Links

- npm: https://www.npmjs.com/package/markdown-doc-bundler
- Repository: https://github.com/wbprice/js-markdown-doc-bundler
- Homepage: https://github.com/wbprice/js-markdown-doc-bundler#readme
- Issues: https://github.com/wbprice/js-markdown-doc-bundler/issues
- npm.io page: https://npm.io/package/markdown-doc-bundler

## Dependencies (5)

- [chai](https://npm.io/package/chai.md) ^3.5.0
- [mocha](https://npm.io/package/mocha.md) ^2.5.3
- [sinon](https://npm.io/package/sinon.md) ^1.17.4
- [lodash](https://npm.io/package/lodash.md) ^4.13.1
- [sinon-chai](https://npm.io/package/sinon-chai.md) ^2.8.0

## Alternatives

- [@cantoo/pdf-lib](https://npm.io/package/@cantoo/pdf-lib.md) — 297.9K weekly downloads
- [datatables.net-buttons](https://npm.io/package/datatables.net-buttons.md) — 200.1K weekly downloads
- [@ckeditor/ckeditor5-export-pdf](https://npm.io/package/@ckeditor/ckeditor5-export-pdf.md) — 167.0K weekly downloads
- [scanbot-web-sdk](https://npm.io/package/scanbot-web-sdk.md) — 15.0K weekly downloads
- [@syncfusion/ej2-angular-pdfviewer](https://npm.io/package/@syncfusion/ej2-angular-pdfviewer.md) — 8.8K weekly downloads

## Recent versions

- 0.0.13 (latest) — 2016-07-24
- 0.0.12 — 2016-06-21
- 0.0.11 — 2016-06-21
- 0.0.10 — 2016-06-20
- 0.0.9 — 2016-06-09
- 0.0.8 — 2016-06-09
- 0.0.7 — 2016-06-09
- 0.0.6 — 2016-06-09
- 0.0.4 — 2016-06-09
- 0.0.3 — 2016-06-09
- 0.0.2 — 2016-06-08
- 0.0.1 — 2016-06-08

## README

# markdown-doc-bundler
Accepts the path of a directory. Produces an object containing the contents of
markdown files as strings organized according to the directory's original structure.

## Usage

### Installation
```sh
  npm install --save markdown-doc-bundler
```

#### Bundler

Given a path to a directory containing markdown files organized like this:

```
  README.md
  - anatomy
  -- README.md
  -- backbone.md
  -- kneebone.md
  -- tailbone.md
  --- trailsProject
  ---- README.md
  --- api
  ---- README.md
  - concepts
  -- README.md
```

Returns an object that looks like this:

```js
{
  'README.md': 'This is a markdown file',
  'anatomy': {
    'trailsProject': {
      'README.md': 'A different markdown file',
      'backbone.md': 'Backbone is a client side JavaScript framework',
      'kneebone.md': 'The kneebone is connected to the ankle bone',
      'tailbone.md': 'The tailbone is connected to the backbone',
      'api': {
        'README.md': 'A totally new thing'
      }
    },
    'README.md': 'Bomb diggity'
  },
  'concepts': {
    'concepts.md': 'Last markdown file, I promise.'
  }
}
```

##### Usage

```js
  const markdownDocBundler = require('markdown-doc-bundler').bundler
  const docs = markdownDocBundler(/* absolute path to directory */)
```

#### Routes Maker

Given input that looks like this:

```js
{
  'README.md': 'This is a markdown file',
  'anatomy': {
    'trailsProject': {
      'README.md': 'A different markdown file',
      'backbone.md': 'Backbone is a client side JavaScript framework',
      'kneebone.md': 'The kneebone is connected to the ankle bone',
      'tailbone.md': 'The tailbone is connected to the backbone',
      'api': {
        'README.md': 'A totally new thing'
      }
    },
    'README.md': 'Bomb diggity'
  },
  'concepts': {
    'concepts.md': 'Last markdown file, I promise.'
  }
}
```

Returns output that look like:

```js
[
  [ '/', 'This is a markdown file' ],
  [ '/anatomy/', 'Bomb diggity' ],
  [ '/anatomy/backbone', 'Backbone is a client side JavaScript framework'],
  [ '/anatomy/kneebone', 'The kneebone is connected to the ankle bone'],
  [ '/anatomy/tailbone', 'The tailbone is connected to the backbone'],
  [ '/anatomy/trailsProject/', 'A different markdown file' ],
  [ '/anatomy/trailsProject/api', 'A totally new thing' ],
  [ '/concepts/', 'Last markdown file, I promise.' ]
}
```

This allows us to create routes on the server based on the structure of the
directory containing our documentation, passing the contents of the markdown
files as context to the views.

##### Usage

```js
  const docs = markdownDocBundler(/* absolute path to directory */)
  const routesMaker = require('markdown-doc-bundler').routesMaker
  const routes = routesMaker(docs)
```

### Tests
```sh
  npm test
```

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