Coder Social home page Coder Social logo

casualuser / guarded_preprocessors Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kugaevsky/guarded_preprocessors

1.0 2.0 0.0 76 KB

Simple bundle to mock up web frontends with HAML/Coffee/Sass/Less. Autocompiles your files on every save and refreshes browser without ⌘+R or F5.

guarded_preprocessors's Introduction

Guarded preprocessors

Simple bundle to mock up web frontends with HAML/Coffee/Sass/Less. Autocompiles your files on every save and refreshes browser without ⌘+R or F5

Installing

Environment: You must have installed ruby with bundler gem in your environment to use guarded_preprocessors.

  1. git clone git://github.com/kugaevsky/guarded_preprocessors.git – сlone (or download) repository to your machine
  2. cd guarded_preprocessors change your working directory.
  3. Uncomment notification gems that you really need in Gemfile.
  4. Uncomment notification instructions in Guardfile.
  5. Run bundle install to install all dependencies.
  6. Run guard command to watch files you modify.

Usage

Just run guard command in your working directory and edit files in your source directory. All of them will be automagically compile in html directory of your project.

Anatomy

  • source/ - directory for source files written in HAML/Coffee/Sass/Less
  • html/ - directory for compiled files in HTML/Javascript/CSS

Anyway, your can edit relative paths for each preprocessor in your Guardfile. Syntax is really very simple. Just redefine paths hash. PATHS = { :in => 'source', :out => 'html' }

Preprocessors

Right out the box you can use configured preprocessors

  • HAML – for HTML preprocessing
  • Coffescript – for Javascript preprocessing
  • Sass, Scss or LESS – for CSS preprocessing

Notifications

Your can configure system notifications for guarded files compilation. Follow instructions in Gemfile. Just uncomment gem lines for your OS. And install notification software if needed.

  • MacOS users: Growl notifications – GrowlNotify
  • Linix users: Libnotify notifications – install libnotify-bin package with your favorite package manager.
  • Windows users: Notifu notifications – Notifu

LiveReload

LiveReload can autorefresh page in your browser on every file modification. To use this incredible feature just

  1. Install extension for your browser (Safari, Chrome, Firefox supported) from livereload extension page.
  2. Open your page in browser and turn on LiveReload by clicking on extension icon.
  3. NB Chrome users: if you work without any web-server (opened file URL looks something like file:///my-perfect-page.html), you have to grant permissions for extensions to work with local files in Chrome. Go to extension management page chrome://chrome/extensions/ and check Allow access to file URLs option below LiveReload extension.

That's all. Just save your file and it will be compiled and rendered in your browser in a moment.

TIP If you want more information about livereload connection to your browser add ?LR-verbose to your file URL.

Thanks

To all guys that make frontend development faster and cleaner

guarded_preprocessors's People

Contributors

kugaevsky avatar

Stargazers

Aleksei Tcelishchev avatar

Watchers

James Cloos avatar Aleksei Tcelishchev 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.