Code Monkey home page Code Monkey logo

jeanny's Introduction

#Jeanny

Библиотека для сокращения имён css классов.

##Пример использования

#!/usr/bin/env ruby

require 'rubygems'
require 'jeanny'

include Jeanny::Sugar

analyze('serp/css/_*.css', :compare_with => 'classes.saved') and save

group :html, :title => 'replacing in template files' do
    replace :in => 'serp/static/*.html'
end

group :css, :title => 'replacing in stylesheets' do
    replace :include => ['serp/css/_*.css', 'serp/block/*/*.css']
end

group :js, :title => 'replacing in scripts' do
    replace :in => 'serp/js/_serp.js'
end

##Ещё один пример #!/usr/bin/env ruby

require 'rubygems'
require 'jeanny'

j = Jeanny::Engine.new
j.analyze '.l-head { ... } .l-head__l, .l-head__r { ... } .z-colors { ololo } .z-colors__text { blah-blah-blah... }'

data = '<div class = "l-head"><div class = "l-head__l">Left</div><div class = "l-head__r">Right</div></div><div class = "z-colors"><div class = "z-colors__text">Colors Wizard</div></div>'
puts j.replace data, :html

# На выходе будет:
# => <div class="a"><div class="d">Left</div><div class="e">Right</div></div><div class="b"><div class="f">Colors Wizard</div></div>

##Установка sudo gem sources -a http://gemcutter.org && sudo gem install jeanny

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.