Socket
Socket
Sign inDemoInstall

assemble-markdown-import

Package Overview
Dependencies
68
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    assemble-markdown-import

An Assemble plugin for importing and parsing of markdown from data sources.


Version published
Weekly downloads
2
Maintainers
1
Install size
119 kB
Created
Weekly downloads
 

Readme

Source

assemble-markdown-import

An Assemble plugin for importing and parsing of markdown from data sources.

Inspired and borrowed heavily from adjohnson916's assemble-markdown-data plugin.

Usage

First, setup a project with Grunt and Assemble.

Then install the plugin:

npm install --save-dev assemble-markdown-import

Add the plugin to your Grunt assemble config:

assemble: {
  options: {
    plugins: [ 'assemble-markdown-import' ]
  },
  ...
},

For any markdown file you want to be imported and parsed, define it as an object with markdownFile as the key whose value is the full path to the markdown file. After being imported, but before rendering, this object will be replaced by the HTML that results from parsing the markdown.

Example

# profile.yml
name: Julio Barnes
about:
  markdownFile: './text/about_julio_barnes.md'
age: 64

Resulting JavaScript object:

{
  "name": "Julio Barnes",
  "about": "<h2>I am Julio</h2><p>I am...<ul><li>Brave</li><li>Strong</li><li>Noble</li></ul><p>I also like pudding.</p>",
  "age": 64
}

If you're using Jade with Assemble, then output the item with the != operator to output the unescaped HTML. Eg:

div!=profile.markdownFile

Keywords

FAQs

Last updated on 23 Apr 2015

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc