Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

metamd

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

metamd

Parse out meta data from your markdown content

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

metamd

Parse meta Markdown data and render in the browser or server. You can add meta data in the format of

Page 1
======
title: page1.md
tags: test

This is a _test_.

and automatically parse it out before rendering the markdown.

Installation

Node

clone [url] && cd metamd
npm link

Client

<script type="text/javascript" src="metamd.client.min.js"></script>

Example

var fs = require('fs');
var metamd = require('metamd');

var parsed = metamd.parse(fs.readFileSync('./example/page1.md', 'utf-8'));
console.log(parsed);
console.log(metamd.render(parsed.body));

Will result in:

> { title: 'page1.md',
    tags: 'test',
    body: 'Page 1\n=\n\nThis is a _test_.\n\n```\nThis is another test\n```' }

> <h1>Page 1
  </h1>
  <p>This is a <em>test</em>.

  </p>
  <pre><code>This is another test</code></pre>

Usage

metamd.parse(<markdown>) - returns an object with meta data parsed out of the markdown. There will be a body key that contains the markdown.

metamd.render(<markdown>) - returns html rendered using marked.

Test

Testing is done with mocha and chai and can be run on the server or client. Remember to install the dev dependencies before running the tests.

Node

npm test

Client

Maybe start a server, then navigate to test/browser/index.html.

Compiling

If you make changes, you need to recompile for browser usage. After you install the dev dependencies, it's easy:

npm run compile

Keywords

FAQs

Package last updated on 04 Aug 2012

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