Socket
Book a DemoInstallSign in
Socket

doc-down

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

doc-down

Renders markdown with custom elements inline for documentation

latest
Source
npmnpm
Version
0.0.2
Version published
Maintainers
1
Created
Source

doc-down

Renders markdown with custom elements inline for documentation

Build Status Dependency Status NPM version

Installation

npm install doc-down --save

Usage

Some **markdown**

This is a custom element where the content is treated as markdown:

: MyElementName(attribute="value")
  This content **must** be indented to appear inside the element.

This is a custom element where the content is treated as plain text:

: MyElementName(attribute="value").
  This is plain text.

This is an element without any content

: MyElementName(attribute="value")

On the server side/in advance if possible:

var DocDown = require('doc-down');

const dd = new DocDown();

fs.writeFileSync('data.json', JSON.stringify(dd.parse('some **markdown**')));

On the client side:

const data = require('./data.json');

// you can use any kind of react component here
function MyElementName(props) {
  return <div>{props.children}</div>;
}
const customElements = {
  MyElementName,
};

ReactDOM.render(
  <Page data={data} customElements={customElements}/>,
  document.body,
)

License

MIT

FAQs

Package last updated on 22 Jan 2017

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