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

markdown-it-include

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

markdown-it-include - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

73

package.json
{
"name": "markdown-it-include",
"version": "0.0.1",
"description": "Markdown-it plugin which adds the ability to include markdown fragment files.",
"keywords": [
"markdown-it-plugin",
"markdown-it",
"markdown",
"inlcude"
],
"repository" : {
"type" : "git",
"url" : "https://github.com/camelaissani/markdown-it-include"
},
"bugs": {
"url": "https://github.com/camelaissani/markdown-it-include/issues"
},
"license": "MIT",
"main": "index.js",
"scripts": {
"test": "make test"
},
"devDependencies": {
"eslint": "0.10.2",
"eslint-plugin-nodeca": "^1.0.0",
"browserify": "*",
"coveralls": "^2.11.2",
"uglify-js": "*",
"istanbul": "*",
"chai": "*",
"mocha": "*",
"markdown-it-testgen": "~0.1.0",
"markdown-it": "markdown-it/markdown-it"
}
}
"name": "markdown-it-include",
"version": "0.0.2",
"description": "Markdown-it plugin which adds the ability to include markdown fragment files.",
"keywords": [
"markdown-it-plugin",
"markdown-it",
"markdown",
"inlcude"
],
"repository": {
"type": "git",
"url": "https://github.com/camelaissani/markdown-it-include"
},
"bugs": {
"url": "https://github.com/camelaissani/markdown-it-include/issues"
},
"license": "MIT",
"main": "index.js",
"scripts": {
"test": "make test"
},
"author": {
"name" : "Camel Aissani",
"email" : "camel.aissani@gmail.com",
"url" : "https://nuageprive.fr/"
},
"devDependencies": {
"eslint": "0.10.2",
"eslint-plugin-nodeca": "^1.0.0",
"browserify": "*",
"coveralls": "^2.11.2",
"uglify-js": "*",
"istanbul": "*",
"chai": "*",
"mocha": "*",
"markdown-it-testgen": "~0.1.0",
"markdown-it": "markdown-it/markdown-it"
}
}

@@ -5,2 +5,4 @@ # markdown-it-include

[![NPM](https://nodei.co/npm/markdown-it-include.png)](https://npmjs.org/package/markdown-it-include)
Markdown-it plugin which adds the ability to include markdown fragment files.

@@ -19,14 +21,46 @@

Let's create a markdown which uses a header and a footer from two separate files:
**header.md**
```markdown
# This is my header for all my markdowns
```
**footer.md**
```markdown
Follow me on twitter!
```
Let's assume that header.md and footer.md are located in `/in/this/directory`.
Now it's your turn to play markdown-it!
```js
var path = require('path'),
md = require('markdown-it')()
.use(require('markdown-it-include', path.join(__dirname, 'your_md_directory')));
var md = require('markdown-it')()
.use(require('markdown-it-include'), '/in/this/directory');
md.render('!!!include(header.md)!!!\n\n*content*\n\n!!!include(footer.md)!!!');
md.render('!!!include(header.md)!!!\n\n*your content*\n\n!!!include(footer.md)!!!');
```
header.md and footer.md should be located in `your_md_directory`.
It will produce this
```html
<h1>This is my header for all my markdowns</h1>
<p><em>your content</em></p>
<p>Follow me on twitter!</p>
```
## Disclaimer
This purposefully doesn't conform to any spec or discussion related to CommonMark.
## License
[MIT](https://github.com/camelaissani/markdown-it-include/blob/master/LICENSE)
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