Git Product home page Git Product logo

vogue's Introduction

Vogue

Vogue creates a real-time link between your web browser and your file system. When you save a CSS file, used by the HTML page in your browser, Vogue will make the browser reload the stylesheet. Only the stylesheet is reloaded, not the entire page, making it work even for very dynamic/ajax pages.

Vogue is all javascript. It runs a server on Node.js, which will watch the file system. The server accepts WebSocket connections from the client code (which uses socket.io). The client javascript can be loaded into a HTML page using a single script tag.

Install using npm

Make sure you have Node.JS and npm installed.
Then run:

npm install vogue -g

Usage

Run the Vogue server.

vogue --port 8001 /path/to/website

--port : The port used for Vogue's HTTP server. Optional, defaults to 8001.

--rewrite : A rule in the form of "regexp:replacement" (e.g. "v[0-9]/(.*)$:files/$1" ) to rewrite urls to filesystem paths. Submatches such as $1 will probably need to entered in your shell as $1 to escape the $.

Open http://localhost:8001/ to see instructions for loading the Vogue client into your web pages.

Demo

Vogue runs a separate HTTP server to the one running your website. To run the demo website, for example, do something like this first:

cd demo  
python -m SimpleHTTPServer

Then, from another terminal session, run Vogue:

vogue demo

Open http://localhost:8000 (or whatever the port used by your web server is) to view the demo index page. The demo page has the Vogue client javascript already included. So it will connect to the Vogue server and be watching the two CSS files used by the page.

Try editing the CSS files in the demo/styles directory. Whenever you save, you will see the browser update the reflect the changes made. This is done without reloading the entire page.

Copyright © 2011 Andrew Davey ([email protected])

vogue's People

Contributors

andrewdavey avatar anentropic avatar asuth avatar bkw avatar idflood avatar poetro avatar stephband avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.