jekyll-gl 0.1.2 → 0.1.3

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.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +72 -1
  3. data/jekyll-gl.gemspec +2 -2
  4. data/lib/jekyll-gl.rb +53 -0
  5. metadata +4 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a3c057ae6377c1321a169a6b536da7211ba801d6
4
- data.tar.gz: 23640f722cf1365da78b9ac654a049f676e2756b
3
+ metadata.gz: bd1bebec56902ea7801d352ddda0306cf4c6db5a
4
+ data.tar.gz: b5a5d914d2749327d8c499600f2342fc19c60c90
5
5
  SHA512:
6
- metadata.gz: 3a5a84405c8341a0d9600506e86f581f1db04dc4834faf8bd596fa93bb0c80b6cc1600ea661e82ab34ce2714d29a046a313754151cb26443c1b68d9f83fc10ac
7
- data.tar.gz: 36d28d2988e3e9b1748d555c9ff0d84e8fc9fddf9097281eb634111a5d352bea5857bab674ee1632c663c31d64a21696609d0dd9fdea2a372182ac1ae1652853
6
+ metadata.gz: db34c7162d368277850b210d8e92fe44c57c49185bcab45bfd8e52c05367cc6b78c226151588562ecd3f28417a44d9d14ba3363c8721a6555378a9290dad34a9
7
+ data.tar.gz: 19596fc361d2885cc7e03fd231c492c1682523aecfcfacb87ca92bd9cc07b9a410d1428d2db1d5e137ee13893befc71961247f580cb752fbb5ecdd71c8b0e2f6
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # jekyll-gl
2
2
 
3
- This is a very simple Jekyll plugin to be used on Hyojun.guideline project. It'll place `.gl` class on all markdown generated elements.
3
+ This is a very simple Jekyll plugin to be used on Hyojun.guideline project. It'll place `.gl` class on all markdown generated elements. It also creates some liquid tags for creating specific modules: `example`, `typography`, `colors` and.
4
4
 
5
5
  ## Installation
6
6
 
@@ -39,6 +39,77 @@ kramdown:
39
39
  transliterated_header_ids: true
40
40
  ```
41
41
 
42
+ ### Tags
43
+
44
+ There are some liquid tags defined to be used inside the markdown files that should be used as helpers on creating the guideline:
45
+
46
+ #### Example boxes
47
+
48
+ To create an example box with an html inside, just wrap the code with `{% example [checkers] [dark|inline] [full] %}` tag. Ex.:
49
+
50
+ * Basic example box:
51
+
52
+ ```
53
+ {% example %}
54
+ box de exemplo padrão
55
+ {% endexample %}
56
+ ```
57
+
58
+ * Example box with checkers background:
59
+
60
+ ```
61
+ {% example checkers %}
62
+ box de exemplo padrão com checkers
63
+ {% endexample %}
64
+ ```
65
+
66
+ * Dark version of the checkers background:
67
+
68
+ ```
69
+ {% example checkers dark %}
70
+ box de exemplo padrão com checkers escuro
71
+ {% endexample %}
72
+ ```
73
+
74
+ * Full-width example box won't be limited by the guideline default max-width:
75
+ ```
76
+ {% example full %}
77
+ box de exemplo full
78
+ {% endexample %}
79
+ ```
80
+
81
+ * Inline example box to be used in the middle of texts for small examples:
82
+ ```
83
+ {% example inline %}
84
+ box de exemplo full
85
+ {% endexample %}
86
+ ```
87
+
88
+ > Note that any of the options can be combined, such as `full checkers`, `inline checkers dark`, etc.
89
+
90
+ ### Char-tables
91
+
92
+ To create a chartable, just use the `{% typography [...font-family] %}` tag with the glyph list inside, separated by `,`. Example:
93
+
94
+ ```
95
+ {% typography Helvetica, sans-serif %}
96
+ a,b,c,d,e,f,g,h,i,j,k
97
+ A,B,C,D,E,F,G,H,I,J,K
98
+ {% endtypography %}
99
+ ```
100
+
101
+ ### Color pallete
102
+
103
+ To create a color pallete, just use the `{% colors %}` tag with the colors values inside, separated by a line break. You can algo place another value to be shown to the user instead of the raw data, useful for projects that uses color variables:
104
+
105
+ ```
106
+ {% colors %}
107
+ #fefede
108
+ rgba(10,20,10,.5)
109
+ rgba(10,20,10,.3);$var-name
110
+ {% endcolors %}
111
+ ```
112
+
42
113
  ## Contributing
43
114
 
44
115
  Go to [Hyojun.guideline](https://bitbucket.org/fbiz/hyojun.guideline/) for more information.
data/jekyll-gl.gemspec CHANGED
@@ -4,11 +4,11 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "jekyll-gl"
7
- spec.version = "0.1.2"
7
+ spec.version = "0.1.3"
8
8
  spec.authors = ["Marcelo Miranda Carneiro"]
9
9
  spec.email = ["mcarneiro@fbiz.com.br"]
10
10
  spec.summary = %q{Hyojun.guideline Jekyll Plugin}
11
- spec.description = %q{This Jekyll plugin will place a ".gl" class in every mardown generated elment to automate Hyojun.guideline.}
11
+ spec.description = %q{This Jekyll plugin will place a ".gl" class in every mardown generated elment to automate Hyojun.guideline. Also, creates some liquid tags for the markdown files.}
12
12
  spec.homepage = "http://fbiz.bitbucket.org/hyojun.guideline/"
13
13
  spec.license = "MIT"
14
14
 
data/lib/jekyll-gl.rb CHANGED
@@ -87,5 +87,58 @@ module Jekyll
87
87
  end
88
88
  end
89
89
 
90
+ module Jekyll
91
+ class Typography < Liquid::Block
92
+
93
+ def initialize(tag_name, markup, options)
94
+ super
95
+
96
+ @font_family = markup
97
+ end
98
+
99
+ def render(context)
100
+ content = ''
101
+
102
+ super.split(/[,\n]/).each do |val|
103
+ next if val == ''
104
+ content += '<li title="{{glyph}}"> {{glyph}} </li>'.gsub('{{glyph}}', val);
105
+ end
106
+
107
+ '<ul class="gl-char-table" style="font-family: {{family}};">{{content}}</ul>'
108
+ .gsub('{{family}}', @font_family)
109
+ .sub('{{content}}', content)
110
+ end
111
+ end
112
+ end
113
+
114
+ module Jekyll
115
+ class Colors < Liquid::Block
116
+
117
+ def initialize(tag_name, markup, options)
118
+ super
119
+
120
+ @font_family = markup
121
+ end
122
+
123
+ def render(context)
124
+ content = ''
125
+
126
+ super.split(/[\n]/).each do |val|
127
+ next if val == ''
128
+
129
+ data = (val && val.split(';')) || [];
130
+ content += '<li title="{{var}}" style="background-color:{{color}};"></li>'
131
+ .sub('{{var}}', data[1] || data[0] || '')
132
+ .gsub('{{color}}', data[0] || '');
133
+ end
134
+
135
+ '<ul class="gl-colors">{{content}}</ul>'
136
+ .sub('{{content}}', content)
137
+ end
138
+ end
139
+ end
140
+
90
141
  Liquid::Template.register_tag('example', Jekyll::Example)
142
+ Liquid::Template.register_tag('typography', Jekyll::Typography)
143
+ Liquid::Template.register_tag('colors', Jekyll::Colors)
91
144
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-gl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcelo Miranda Carneiro
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-20 00:00:00.000000000 Z
11
+ date: 2015-09-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -25,7 +25,8 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.7'
27
27
  description: This Jekyll plugin will place a ".gl" class in every mardown generated
28
- elment to automate Hyojun.guideline.
28
+ elment to automate Hyojun.guideline. Also, creates some liquid tags for the markdown
29
+ files.
29
30
  email:
30
31
  - mcarneiro@fbiz.com.br
31
32
  executables: []