jekyll-less 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +4 -0
- data/Gemfile +4 -0
- data/Rakefile +1 -0
- data/jekyll-less.gemspec +23 -0
- data/lib/jekyll-less.rb +37 -0
- data/lib/jekyll-less/version.rb +5 -0
- data/readme.md +44 -0
- metadata +100 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'bundler/gem_tasks'
|
data/jekyll-less.gemspec
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "jekyll-less/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "jekyll-less"
|
7
|
+
s.version = Jekyll::Less::VERSION
|
8
|
+
s.authors = ["Roger López"]
|
9
|
+
s.email = ["roger@zroger.com"]
|
10
|
+
s.homepage = "http://github.com/zroger/jekyll-less"
|
11
|
+
s.summary = %q{Less CSS converter for Jekyll}
|
12
|
+
s.description = %q{Convert Less CSS files to standard CSS files as part of your Jekyll build.}
|
13
|
+
|
14
|
+
s.rubyforge_project = "jekyll-less"
|
15
|
+
|
16
|
+
s.files = `git ls-files`.split("\n")
|
17
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
|
+
s.require_paths = ["lib"]
|
20
|
+
|
21
|
+
s.add_runtime_dependency('jekyll', [">= 0.10.0"])
|
22
|
+
s.add_runtime_dependency('less', [">= 2.0.5"])
|
23
|
+
end
|
data/lib/jekyll-less.rb
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
require "jekyll-less/version"
|
2
|
+
|
3
|
+
module Jekyll
|
4
|
+
module Less
|
5
|
+
class LessConverter < Converter
|
6
|
+
pygments_prefix "\n"
|
7
|
+
pygments_suffix "\n"
|
8
|
+
|
9
|
+
def setup
|
10
|
+
return if @setup
|
11
|
+
require 'less'
|
12
|
+
@setup = true
|
13
|
+
rescue LoadError
|
14
|
+
STDERR.puts 'You are missing a library required for less. Please run:'
|
15
|
+
STDERR.puts ' $ [sudo] gem install less'
|
16
|
+
raise FatalException.new("Missing dependency: less")
|
17
|
+
end
|
18
|
+
|
19
|
+
def matches(ext)
|
20
|
+
ext =~ /less/i
|
21
|
+
end
|
22
|
+
|
23
|
+
def output_ext(ext)
|
24
|
+
".css"
|
25
|
+
end
|
26
|
+
|
27
|
+
def convert(content)
|
28
|
+
setup
|
29
|
+
begin
|
30
|
+
::Less::Parser.new().parse(content).to_css
|
31
|
+
rescue => e
|
32
|
+
puts "Less Exception: #{e.message}"
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
data/readme.md
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
Less for Jekyll
|
2
|
+
===============
|
3
|
+
|
4
|
+
This gem provides a [Jekyll](http://github.com/mojombo/jekyll) converter for
|
5
|
+
[Less CSS](http://lesscss.org/) files.
|
6
|
+
|
7
|
+
Basic Setup
|
8
|
+
-----------
|
9
|
+
Install the gem:
|
10
|
+
|
11
|
+
[sudo] gem install jekyll-less
|
12
|
+
|
13
|
+
In a plugin file within your Jekyll project's _plugins directory:
|
14
|
+
|
15
|
+
# _plugins/my-plugin.rb
|
16
|
+
require "jekyll-less"
|
17
|
+
|
18
|
+
Place .less files anywhere in your Jekyll project's directory. These will be
|
19
|
+
converted to .css files with the same directory path and filename. For example,
|
20
|
+
if you create a Less file at _css/my-stuff/styles.less_, then the corresponding
|
21
|
+
css file would end up at _css/my-stuff/styles.css_.
|
22
|
+
|
23
|
+
Important Note
|
24
|
+
--------------
|
25
|
+
All .less files __MUST__ have a [YAML Front Matter](http://wiki.github.com/mojombo/jekyll/yaml-front-matter)
|
26
|
+
header, even if empty. Jekyll will only convert files that have a valid Front
|
27
|
+
Matter header, so if you do not include this, the files will not be converted.
|
28
|
+
This header will be removed from the final CSS file, so feel free to put
|
29
|
+
whatever you want in it, or nothing at all.
|
30
|
+
|
31
|
+
Bundler Setup
|
32
|
+
-------------
|
33
|
+
Already using bundler to manage gems for your Jekyll project? Then just add
|
34
|
+
|
35
|
+
gem "jekyll-less"
|
36
|
+
|
37
|
+
to your gemfile and create the following plugin in your projects _plugins
|
38
|
+
directory. I've called mine bundler.rb. This will automatically require all
|
39
|
+
of the gems specified in your Gemfile.
|
40
|
+
|
41
|
+
# _plugins/bundler.rb
|
42
|
+
require "rubygems"
|
43
|
+
require "bundler/setup"
|
44
|
+
Bundler.require(:default)
|
metadata
ADDED
@@ -0,0 +1,100 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: jekyll-less
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
version: 0.0.1
|
10
|
+
platform: ruby
|
11
|
+
authors:
|
12
|
+
- "Roger L\xC3\xB3pez"
|
13
|
+
autorequire:
|
14
|
+
bindir: bin
|
15
|
+
cert_chain: []
|
16
|
+
|
17
|
+
date: 2011-06-30 00:00:00 -04:00
|
18
|
+
default_executable:
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: jekyll
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
25
|
+
requirements:
|
26
|
+
- - ">="
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
segments:
|
29
|
+
- 0
|
30
|
+
- 10
|
31
|
+
- 0
|
32
|
+
version: 0.10.0
|
33
|
+
type: :runtime
|
34
|
+
version_requirements: *id001
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: less
|
37
|
+
prerelease: false
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
segments:
|
44
|
+
- 2
|
45
|
+
- 0
|
46
|
+
- 5
|
47
|
+
version: 2.0.5
|
48
|
+
type: :runtime
|
49
|
+
version_requirements: *id002
|
50
|
+
description: Convert Less CSS files to standard CSS files as part of your Jekyll build.
|
51
|
+
email:
|
52
|
+
- roger@zroger.com
|
53
|
+
executables: []
|
54
|
+
|
55
|
+
extensions: []
|
56
|
+
|
57
|
+
extra_rdoc_files: []
|
58
|
+
|
59
|
+
files:
|
60
|
+
- .gitignore
|
61
|
+
- Gemfile
|
62
|
+
- Rakefile
|
63
|
+
- jekyll-less.gemspec
|
64
|
+
- lib/jekyll-less.rb
|
65
|
+
- lib/jekyll-less/version.rb
|
66
|
+
- readme.md
|
67
|
+
has_rdoc: true
|
68
|
+
homepage: http://github.com/zroger/jekyll-less
|
69
|
+
licenses: []
|
70
|
+
|
71
|
+
post_install_message:
|
72
|
+
rdoc_options: []
|
73
|
+
|
74
|
+
require_paths:
|
75
|
+
- lib
|
76
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
77
|
+
none: false
|
78
|
+
requirements:
|
79
|
+
- - ">="
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
segments:
|
82
|
+
- 0
|
83
|
+
version: "0"
|
84
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
85
|
+
none: false
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
segments:
|
90
|
+
- 0
|
91
|
+
version: "0"
|
92
|
+
requirements: []
|
93
|
+
|
94
|
+
rubyforge_project: jekyll-less
|
95
|
+
rubygems_version: 1.3.7
|
96
|
+
signing_key:
|
97
|
+
specification_version: 3
|
98
|
+
summary: Less CSS converter for Jekyll
|
99
|
+
test_files: []
|
100
|
+
|