New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

markdown-doc-bundler

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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.

  • 0.0.13
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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

  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:

{
  '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
  const markdownDocBundler = require('markdown-doc-bundler').bundler
  const docs = markdownDocBundler(/* absolute path to directory */)
Routes Maker

Given input that looks like this:

{
  '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:

[
  [ '/', '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
  const docs = markdownDocBundler(/* absolute path to directory */)
  const routesMaker = require('markdown-doc-bundler').routesMaker
  const routes = routesMaker(docs)

Tests

  npm test

Keywords

FAQs

Package last updated on 24 Jul 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc