npm

gulp-markdown-code-blocks

1.1.1 • Public • Published

gulp-markdown-code-blocks Build Status

Gulp task for running markdown-code-blocks.

Installation

npm install --save-dev gulp gulp-markdown-code-blocks markdown-code-blocks

Usage

Evaluating the code of your readme file is as easy as this:

'use strict';
 
var gulp    = require('gulp');
var mdBlock = require('gulp-markdown-code-blocks');
 
gulp.task('default', function () {
  return gulp.src('./README.md').pipe(mdBlock());
});

Niceties

Please note that the previous snippet is a code fence, that is evaluated by the code block parser as well. That means it will try to evaluate require('gulp-markdown-code-blocks'), a.k.a. it will try to resolve the name of this project, which is not part of the package.json file. Before throwing the readme file into markdown-code-blocks, the gulp task try to find your package.json in the same directory as the readme file and replace require('name-of-your-package') with require('value-of-the-main-property-of-your-package-json'). So in case of this lib, it will actually be require('./index.js').

Test

The following snippet will be executed and evaluated:

require('assert')(true);

License

MIT

Package Sidebar

Install

npm i gulp-markdown-code-blocks

Weekly Downloads

1

Version

1.1.1

License

MIT

Last publish

Collaborators

  • sdepold