Skip to content
This repository has been archived by the owner on Oct 26, 2021. It is now read-only.

A grunt connect task middleware for live editing Github md files (README.md or even Github wiki pages) by just using Grunt.

License

GPL-2.0, MIT licenses found

Licenses found

GPL-2.0
LICENSE-GPL
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

lgersman/orangevolt-livereload

Repository files navigation

Dependency status NPM version Bitdeli Badge

orangevolt-livereload lets you easily edit your Github wiki pages (aka Markdown / gfm files) in your favorite editor while having live preview in the browser.

orangevolt-livereload screencast

You dont need Gollum anymore - use your favorite editor. Just save the file and the browser reloads it automatically.

Features

Requirements

orangevolt-livereload requires Grunt.

Installation

$ npm install orangevolt-livereload -g

If you want to use orangevolt-livereload in your Grunt file you should install it locally (without -g option).

Usage

Command line

Go to your project directory and execute

$ orangevolt-livereload

A new browser window will appear displaying the contents of the directory.

Select the file to watch and you're done !

Grunt project integration

Add

watch : {
  all : {
    options: {
      livereload : 9091
    },
    files: [ 'README.md', /* add more files/directories to watch here */]
  }
},
connect : {
  all : {
    options : {
      port        : 9090,
      middleware  : require( 'orangevolt-livereload').grunt.livereload.middleware(),
      hostname    : '*',
      livereload  : 9091,
      directory   : __dirname
    }        
  }
}

to your grunt.initConfig( ...) section and

...
grunt.loadNpmTasks( 'grunt-contrib');
grunt.loadNpmTasks( 'grunt-open'); 

grunt.registerTask( 'livereload', ['connect', 'open', 'watch']);
...

to the bottom of your Grunt file. Execute

grunt livereload

and a new browser tab will appear. Select the file to watch and you're done !

See Gruntfile.js as a working example for the Grunt integration.

Caveats

When grunt aborts with Fatal error: watch ENOSPC message you're system is getting out of inotify watche handles.

Go to the terminal and enter

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

to increase inotify watche handles (See http://stackoverflow.com/questions/16748737/grunt-watch-error-waiting-fatal-error-watch-enospc).

License

orangevolt-livereload is dual licensed under

About

A grunt connect task middleware for live editing Github md files (README.md or even Github wiki pages) by just using Grunt.

Resources

License

GPL-2.0, MIT licenses found

Licenses found

GPL-2.0
LICENSE-GPL
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published