1.0.1 • Published 10 years ago

gulp-ljs v1.0.1

Weekly downloads
1
License
-
Repository
github
Last release
10 years ago

gulp-ljs

This is a gulp plugin for ljs - Literate Javascript. Note, that there are two ways of literating your code:

  • .lit.js -> .md and .lit.js -> .js (see literate)
  • .js -> .md *THIS*

Everything inside /* and */ is handled as markup. Your code will be transformed into the markup code environment. Just to give you an idea:

/*
   # Literate me :-)
   Prosa..
   * item1
   * item2
*/
var awesome = "Awesome";
console.log(awesome);

Usage

Install gulp-ljs:

npm install gulp-ljs --save-dev

Using this plugin is pretty straight forward. For the sake of sanity I replace the extension of the filepath automatically.

var ljs = require('gulp-ljs');

gulp.task('literate', function () {
  gulp.src('path/**/*.js')
    .pipe(ljs())
    .pipe(gulp.dest('path/')) // writes *.md
});

Options

code

Don't include the code in the markup file. Default: true

var ljs = require('gulp-ljs');

gulp.task('literate', function () {
  gulp.src('path/**/*.js')
    .pipe(ljs({code : false}))
    .pipe(gulp.dest('path/'))
});
1.0.1

10 years ago

1.0.0

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago