Skip to content

dmonad/gulp-ljs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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/'))
});

About

Literate Javascript Gulp plugin

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published