Now you need to go to Chrome and activate livereload Extension. After installation we need to go to our project and start our livereload application in that directory, this will tell livereload to keep track of all file inside this file and subdirectories.This will watch the directories (that we’re working on) for the changes in css, js, and html files inside them (or in their subdirectories) How to use? NOTE - you can add as many extensions you want, like for php, we just need to add php besides html separated by pipe(|) Put the following in the file and save it. When you are done with that, create a new file named. Here, we are installing rubygems, guard and finally guard-livereload. In order to install LiveReload on Ubuntu, hit the following commands on your terminal one after another: Installing Live Reload is a pretty straightforward process in Windows, Mac and on Linux too (somewhat different though). Installing Livereload on window and mac is pretty straight forward, we just need to download it from official website here.No more browser fresh and command re-issuing.How to Install LiveReload in Window and Mac? LiveReload 2 server listens on port 35729 and serves livereload.js over HTTP (besides speaking the web socket protocol on the same port). But in the meantime, I just need to have two panes open and have both monitoring tools running independently. I wish there is a method as easy as using nodemon via a single command. Having live browser reload is a bit complicated. Ruby on rails ,ruby-on-rails,Ruby On Rails, class Foo < ApplicationRecord def self.bar(params) if paramssome-param. Then, you can use nodemon as you normally do: nodemon - x docco /path/ to/app.coffee Now you need to make sure set the generated files into the correct directory: nodemon - x 'docco -o /usr/share/nginx/www/livereload' /path/ to/app.coffeeĪnother way is to create a soft link to the directory, since the docs in the current execution directory is the default output directory: ln -s /usr/share /nginx/www /livereload docs You should see the dot in the middle becomes solid. Launch Guard: cd /usr/share /nginx/www /livereload & guardĮnable the live reload by clicking the menu icon. Therefore, an easy way is to set up a web server, such as Nginx, and configure a directory for this usage, such as: /usr/share /nginx/www /livereloadĪdd the following Guardfile into the directory: guard 'livereload' do ![]() You need to have a web server to make the livereload work, live reload does not work on files directly served from the file system: file:/ //home /chao/docs /app.html I have followed some of the steps from the post: Auto-refresh your browser when saving files or restarting node.js.įirst install LiveReload Chrome extension, and then install Guard and Guard::LiveReload gems: sudo gem install guard guard-livereload TODO: Need to find a way to avoid using Ruby and its gems. Making live reload in browser is a little bit trickier, it involves using some Ruby gems. With this command, docco will be executed upon any change to the file. We can use it with any command: nodemon - x docco /path/ to/app.coffee It does not have to be limited to Node and JavaScript files. nodemon will watch the files in the directory that nodemon was started, and if they change, it will automatically restart your node application. A better alternative is to use nodemon:įor use during development of a node.js based application. One way is to use grunt-contrib-watch, but the limitation is that this is not for an individual file on the command line, it is more for a build process. Lucky, there is a way to eliminate this step. I'm using Bash to initiate guard, then activating LiveReload in the browser. It's not working and I don't know how I can trouble shoot this really. I'm trying to use Guard with LiveReload plugin for Chrome on Windows 7. However, every time I made a change, I had to issue docco command again, even I could use the up arrow key, but still a pain. LiveReload with Guard not working, even though it says it does. ![]() ![]() When I am editting comments in my code, I would like to use Docco to generate a pretty print source code documentation and review it in web browser.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |