itcsscli 0.1.5 → 0.1.6

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8337a75fa188afb984b2026a799dda9f23509ba2
4
- data.tar.gz: dac5734eda6722be15c560c0673192c76439595c
3
+ metadata.gz: 4956e3ec5ea69d47e2c97569413d43bc6e72e2e1
4
+ data.tar.gz: 058c9edc263a9c88c9185643e04e02c3b23de78d
5
5
  SHA512:
6
- metadata.gz: 39f0981a3631f26f9c52e1072dcc15eab81e56a10d5d54a14decaf6cd64b74b31e12a48d9682f751b03e92a65cd4e19378a39fcfbf9e7fe371e6a572f26251af
7
- data.tar.gz: b78e43ec22318f9dc626b4947da4f6b0ff1f02c5a5724a5cfd88910f8d6e191deb9926c9db8af10910414f038d19216b7c825c06d8a9263f67176b98671bc750
6
+ metadata.gz: 589179371db5bed85943d9f2ee853288ee94c488b8742df3f981c71248444e9047102b009ed0bc2325197bbabc0573374931ff1a748599da57381a87e7905613
7
+ data.tar.gz: 7a9fbcc008b93703deaf43c7d58a56be68abe1b8fcae7c92a9c85eeb8b0937a60391c0e68825fc9faa5bb22e5524441ae57f2425896bc98130000397ec4a0880
data/assets/itcss.css CHANGED
@@ -1 +1 @@
1
- code[class*="language-"],pre[class*="language-"]{color:#000;background:none;text-shadow:0 1px #fff;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}pre[class*="language-"]::-moz-selection,pre[class*="language-"] ::-moz-selection,code[class*="language-"]::-moz-selection,code[class*="language-"] ::-moz-selection{text-shadow:none;background:#b3d4fc}pre[class*="language-"]::selection,pre[class*="language-"] ::selection,code[class*="language-"]::selection,code[class*="language-"] ::selection{text-shadow:none;background:#b3d4fc}@media print{code[class*="language-"],pre[class*="language-"]{text-shadow:none}}.token.comment,.token.prolog,.token.doctype,.token.cdata{color:#708090}.token.punctuation{color:#999}.namespace{opacity:.7}.token.property,.token.tag,.token.boolean,.token.number,.token.constant,.token.symbol,.token.deleted{color:#6F6F6F}.token.selector,.token.attr-name,.token.string,.token.char,.token.builtin,.token.inserted{color:#690}.token.operator,.token.entity,.token.url,.language-css .token.string,.style .token.string{color:#a67f59;background:rgba(255,255,255,0.5)}.token.atrule,.token.attr-value,.token.keyword{color:#07a}.token.function{color:#DD4A68}.token.regex,.token.important,.token.variable{color:#e90}.token.important,.token.bold{font-weight:bold}.token.italic{font-style:italic}.token.entity{cursor:help}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td{margin:0;padding:0;border:0;outline:0}a{color:inherit;text-decoration:none}body{font-family:"Roboto Mono",Consolas,Monaco,monospace;font-size:14px;background-color:#E1DFE1}.container{max-width:600px;margin:60px auto;border-radius:2px;transform:translateX(130px);display:flex;flex-direction:column}.sidebar{position:fixed;width:260px;height:100%;top:0;background-color:#232F42;overflow-y:scroll}header{height:48px;background-color:#567FA8;width:100%;top:0;position:absolute}.logo{height:24px;top:12px;position:absolute;left:12px}.sidebar .logo{position:relative}.sidebar .logo .logo__cli{fill:#567FA8}.nav{position:absolute;width:100%;top:48px;bottom:0;padding-bottom:24px;border-top:1px solid rgba(255,255,255,0.1);overflow-y:scroll}.nav__item{display:block;color:#fff;padding:10px 16px;font-weight:100}.nav__link{padding:6px 16px;margin-left:24px;border-left:4px solid #567FA8;transition:border .2s;font-size:12px}.nav__link:hover{border-left:4px solid #fff}.file{padding-top:6px}.file:before{content:attr(id);text-align:right;display:block;color:#6F6F6F;font-weight:lighter}.file+.file{margin-top:20px}.file__content{padding:20px;background-color:#fff;border:1px solid #BCBCBC;box-shadow:0 3px 6px rgba(0,0,0,0.16);overflow-x:scroll}.file__content .blank_slate{font-size:12px;text-align:center;color:#BCBCBC}.file__content pre{font-size:12px}.module{font-size:26px;line-height:18px;padding:18px 0 8px;color:#6F6F6F}.module:after{content:"";position:absolute;left:-24px;border-style:solid;border-width:10px 0 10px 17.3px;border-color:transparent transparent transparent #567FA8}.file+.module{margin-top:30px}h3:after{color:#fff;font-size:9px;padding:2px 4px;border-radius:4px;vertical-align:middle}h3.bl{color:#2196F3}h3.bl:after{content:"block";background-color:#2196F3}h3.el{color:#9C27B0}h3.el:after{content:"element";background-color:#9C27B0}h3.md{color:#E91E63}h3.md:after{content:"modifier";background-color:#E91E63}h3.va{color:#e90}h3.va:after{content:"variable";background-color:#e90}h3.mx{color:#673AB7}h3.mx:after{content:"mixin";background-color:#673AB7}h3.ke{color:#4CAF50}h3.ke:after{content:"keyframes";background-color:#4CAF50}h3.un{color:#795548}h3.un:after{content:"unclassed";background-color:#795548}h3.ps{color:#3F51B5}h3.ps:after{content:"placeholder selector";background-color:#3F51B5}h3.va{font-size:14px;font-weight:400}
1
+ code[class*="language-"],pre[class*="language-"]{color:#000;background:none;text-shadow:0 1px #fff;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}pre[class*="language-"]::-moz-selection,pre[class*="language-"] ::-moz-selection,code[class*="language-"]::-moz-selection,code[class*="language-"] ::-moz-selection{text-shadow:none;background:#b3d4fc}pre[class*="language-"]::selection,pre[class*="language-"] ::selection,code[class*="language-"]::selection,code[class*="language-"] ::selection{text-shadow:none;background:#b3d4fc}@media print{code[class*="language-"],pre[class*="language-"]{text-shadow:none}}.token.comment,.token.prolog,.token.doctype,.token.cdata{color:#708090}.token.punctuation{color:#999}.namespace{opacity:.7}.token.property,.token.tag,.token.boolean,.token.number,.token.constant,.token.symbol,.token.deleted{color:#6F6F6F}.token.selector,.token.attr-name,.token.string,.token.char,.token.builtin,.token.inserted{color:#690}.token.operator,.token.entity,.token.url,.language-css .token.string,.style .token.string{color:#a67f59;background:rgba(255,255,255,0.5)}.token.atrule,.token.attr-value,.token.keyword{color:#07a}.token.function{color:#DD4A68}.token.regex,.token.important,.token.variable{color:#e90}.token.important,.token.bold{font-weight:bold}.token.italic{font-style:italic}.token.entity{cursor:help}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td{margin:0;padding:0;border:0;outline:0}a{color:inherit;text-decoration:none}body{font-family:"Roboto Mono",Monaco,monospace;font-size:14px;background-color:#E1DFE1}.container{max-width:600px;margin:60px auto;border-radius:2px;transform:translateX(130px);display:flex;flex-direction:column}.sidebar{position:fixed;width:260px;height:100%;top:0;background-color:#232F42;overflow-y:scroll}header{height:48px;background-color:#567FA8;width:100%;top:0;position:absolute}.logo{height:24px;top:12px;position:absolute;left:12px}.sidebar .logo{position:relative}.sidebar .logo .logo__cli{fill:#567FA8}.nav{position:absolute;width:100%;top:48px;bottom:0;padding-bottom:24px;border-top:1px solid rgba(255,255,255,0.1);overflow-y:scroll}.nav__item{display:block;color:#fff;padding:10px 16px;font-weight:100}.nav__link{padding:6px 16px;margin-left:24px;border-left:4px solid #567FA8;transition:border .2s;font-size:12px}.nav__link:hover{border-left:4px solid #fff}.file{padding-top:6px}.file:before{content:attr(id);text-align:right;display:block;color:#6F6F6F;font-weight:lighter}.file+.file{margin-top:20px}.file__content{padding:20px;background-color:#fff;border:1px solid #BCBCBC;box-shadow:0 3px 6px rgba(0,0,0,0.16);overflow-x:scroll}.file__content .blank_slate{font-size:12px;text-align:center;color:#BCBCBC}.file__content pre{font-size:12px}.module{font-size:26px;line-height:18px;padding:18px 0 8px;color:#6F6F6F}.module:after{content:"";position:absolute;left:-24px;border-style:solid;border-width:10px 0 10px 17.3px;border-color:transparent transparent transparent #567FA8}.file+.module{margin-top:30px}h3:after{color:#fff;font-size:9px;padding:2px 4px;border-radius:4px;vertical-align:middle;content:attr(data-type)}h3[data-type="block"]{color:#2196F3}h3[data-type="block"]:after{background-color:#2196F3}h3[data-type="element"]{color:#9C27B0}h3[data-type="element"]:after{background-color:#9C27B0}h3[data-type="modifier"]{color:#E91E63}h3[data-type="modifier"]:after{background-color:#E91E63}h3[data-type="variable"]{color:#e90}h3[data-type="variable"]:after{background-color:#e90}h3[data-type="mixin"]{color:#673AB7}h3[data-type="mixin"]:after{background-color:#673AB7}h3[data-type="keyframes"]{color:#4CAF50}h3[data-type="keyframes"]:after{background-color:#4CAF50}h3[data-type="unclassed"]{color:#795548}h3[data-type="unclassed"]:after{background-color:#795548}h3[data-type="placeholder-selector"]{color:#3F51B5}h3[data-type="placeholder-selector"]:after{background-color:#3F51B5}h3[data-type="import"]{color:#03A9F4}h3[data-type="import"]:after{background-color:#03A9F4}h3[data-type='variable'],h3[data-type='import']{font-size:14px;font-weight:400}
data/assets/itcss.sass CHANGED
@@ -1,27 +1,30 @@
1
1
  @import "_syntax"
2
2
 
3
3
  // Colors
4
- $color-bg: #E1DFE1
5
- $color-blue: #567FA8
6
- $color-dark-blue: #232F42
7
- $color-gray: #BCBCBC
8
- $color-dark-gray: #6F6F6F
9
-
10
- $color-block: #2196F3
11
- $color-element: #9C27B0
12
- $color-modifier: #E91E63
13
- $color-variable: #e90
14
- $color-mixin: #673AB7
15
- $color-keyframes: #4CAF50
16
- $color-unclassed: #795548
17
- $color-place-sel: #3F51B5
4
+ $c-bg: #E1DFE1
5
+ $c-blue: #567FA8
6
+ $c-dark-blue: #232F42
7
+ $c-gray: #BCBCBC
8
+ $c-dark-gray: #6F6F6F
9
+
10
+ $c-block: #2196F3
11
+ $c-element: #9C27B0
12
+ $c-modifier: #E91E63
13
+ $c-variable: #e90
14
+ $c-mixin: #673AB7
15
+ $c-keyframes: #4CAF50
16
+ $c-unclassed: #795548
17
+ $c-place-sel: #3F51B5
18
+ $c-import: #03A9F4
19
+ $c-lines: (('block', $c-block),('element', $c-element),('modifier', $c-modifier),('variable', $c-variable),('mixin', $c-mixin),('keyframes', $c-keyframes),('unclassed', $c-unclassed),('placeholder-selector', $c-place-sel),('import', $c-import))
20
+
18
21
 
19
22
  // Settings
20
23
  $sidebar-width: 260px
21
24
  $container-width: 600px
22
25
 
23
26
  // Font
24
- $monospace: "Roboto Mono", Consolas, Monaco, monospace
27
+ $monospace: "Roboto Mono", Monaco, monospace
25
28
 
26
29
  // Resets
27
30
  html, body, div, span, applet, object, iframe,
@@ -45,7 +48,7 @@ a
45
48
  body
46
49
  font-family: $monospace
47
50
  font-size: 14px
48
- background-color: $color-bg
51
+ background-color: $c-bg
49
52
 
50
53
  .container
51
54
  max-width: $container-width
@@ -61,13 +64,13 @@ body
61
64
  width: $sidebar-width
62
65
  height: 100%
63
66
  top: 0
64
- background-color: $color-dark-blue
67
+ background-color: $c-dark-blue
65
68
  overflow-y: scroll
66
69
 
67
70
  // Header
68
71
  header
69
72
  height: 48px
70
- background-color: $color-blue
73
+ background-color: $c-blue
71
74
  width: 100%
72
75
  top: 0
73
76
  position: absolute
@@ -83,7 +86,7 @@ header
83
86
  position: relative
84
87
 
85
88
  .logo__cli
86
- fill: $color-blue
89
+ fill: $c-blue
87
90
 
88
91
  // Navigation
89
92
  .nav
@@ -104,7 +107,7 @@ header
104
107
  .nav__link
105
108
  padding: 6px 16px
106
109
  margin-left: 24px
107
- border-left: 4px solid $color-blue
110
+ border-left: 4px solid $c-blue
108
111
  transition: border .2s
109
112
  font-size: 12px
110
113
 
@@ -119,7 +122,7 @@ header
119
122
  content: attr(id)
120
123
  text-align: right
121
124
  display: block
122
- color: $color-dark-gray
125
+ color: $c-dark-gray
123
126
  font-weight: lighter
124
127
 
125
128
  & + &
@@ -128,14 +131,14 @@ header
128
131
  .file__content
129
132
  padding: 20px
130
133
  background-color: white
131
- border: 1px solid $color-gray
134
+ border: 1px solid $c-gray
132
135
  box-shadow: 0 3px 6px rgba(0,0,0,0.16)
133
136
  overflow-x: scroll
134
137
 
135
138
  .blank_slate
136
139
  font-size: 12px
137
140
  text-align: center
138
- color: $color-gray
141
+ color: $c-gray
139
142
 
140
143
  pre
141
144
  font-size: 12px
@@ -145,7 +148,7 @@ header
145
148
  font-size: 26px
146
149
  line-height: 18px
147
150
  padding: 18px 0 8px
148
- color: $color-dark-gray
151
+ color: $c-dark-gray
149
152
 
150
153
  &:after
151
154
  content: ''
@@ -153,7 +156,7 @@ header
153
156
  left: -24px
154
157
  border-style: solid
155
158
  border-width: 10px 0 10px 17.3px
156
- border-color: transparent transparent transparent $color-blue
159
+ border-color: transparent transparent transparent $c-blue
157
160
 
158
161
  .file + &
159
162
  margin-top: 30px
@@ -165,63 +168,14 @@ h3:after
165
168
  padding: 2px 4px
166
169
  border-radius: 4px
167
170
  vertical-align: middle
171
+ content: attr(data-type)
168
172
 
169
- h3.bl
170
- color: $color-block
171
-
172
- &:after
173
- content: 'block'
174
- background-color: $color-block
175
-
176
- h3.el
177
- color: $color-element
178
-
179
- &:after
180
- content: 'element'
181
- background-color: $color-element
182
-
183
- h3.md
184
- color: $color-modifier
185
-
186
- &:after
187
- content: 'modifier'
188
- background-color: $color-modifier
189
-
190
- h3.va
191
- color: $color-variable
192
-
193
- &:after
194
- content: 'variable'
195
- background-color: $color-variable
196
-
197
- h3.mx
198
- color: $color-mixin
199
-
200
- &:after
201
- content: 'mixin'
202
- background-color: $color-mixin
203
-
204
- h3.ke
205
- color: $color-keyframes
206
-
207
- &:after
208
- content: 'keyframes'
209
- background-color: $color-keyframes
210
-
211
- h3.un
212
- color: $color-unclassed
213
-
214
- &:after
215
- content: 'unclassed'
216
- background-color: $color-unclassed
217
-
218
- h3.ps
219
- color: $color-place-sel
220
-
221
- &:after
222
- content: 'placeholder selector'
223
- background-color: $color-place-sel
173
+ @each $c-line in $c-lines
174
+ h3[data-type="#{nth($c-line,1)}"]
175
+ color: nth($c-line,2)
176
+ &:after
177
+ background-color: nth($c-line,2)
224
178
 
225
- h3.va
179
+ h3[data-type='variable'], h3[data-type='import']
226
180
  font-size: 14px
227
181
  font-weight: 400
@@ -1,4 +1,6 @@
1
1
  def initialize_doc
2
+ puts 'parsing your files...'.yellow
3
+
2
4
  @ITCSS_MODULES.each do |current_module|
3
5
  itcss_module_files = Dir[ File.join("#{@ITCSS_DIR}/#{current_module}/", '**', '*') ].reject { |p| File.directory? p }
4
6
  if itcss_module_files.kind_of?(Array) && itcss_module_files.any?
@@ -51,21 +53,23 @@ end
51
53
 
52
54
  def get_selector_type line
53
55
  if line.start_with? '='
54
- "mx" # mixin
56
+ "mixin"
55
57
  elsif line.start_with? '$'
56
- "va" # variable
58
+ "variable"
59
+ elsif line.start_with? '@import'
60
+ "import"
57
61
  elsif line.start_with? '@keyframes'
58
- "ke" # keyframe
62
+ "keyframes"
59
63
  elsif line.start_with? '%'
60
- "ps" # placeholder selector
64
+ "placeholder selector"
61
65
  elsif !line.include? '.'
62
- "un" # unclassed
66
+ "unclassed"
63
67
  elsif line.include? '--'
64
- "md" # modifier
68
+ "modifier"
65
69
  elsif line.include? '__'
66
- "el" # element
70
+ "element"
67
71
  else
68
- "bl" # block
72
+ "block"
69
73
  end
70
74
  end
71
75
 
@@ -87,7 +91,7 @@ def construct_file_markup selector_blocks, file_name
87
91
  if selector_blocks.kind_of?(Array) && selector_blocks.any?
88
92
  selector_blocks.each do |selector_block|
89
93
  selector_type = get_selector_type selector_block.first
90
- file_markup += "<h3 class='#{selector_type}'>#{line_break_string selector_block.shift}</h3>"
94
+ file_markup += "<h3 data-type='#{selector_type}'>#{line_break_string selector_block.shift}</h3>"
91
95
  file_markup += "<pre><code class='language-sass'>#{line_break_array selector_block}</code></pre>"
92
96
  end
93
97
  else
@@ -128,6 +132,7 @@ def write_itcss_map_file content, nav
128
132
  out.puts template.result binding
129
133
  end
130
134
 
135
+ puts "The documentation has been successfully generated.".green
131
136
  puts "create #{@ITCSS_DOC_FILE}".green
132
137
  puts "opening #{@ITCSS_DOC_FILE}...".yellow
133
138
  puts `open #{@ITCSS_DOC_FILE}`
@@ -1,3 +1,3 @@
1
1
  module Itcsscli
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: itcsscli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kande Bonfim
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-10 00:00:00.000000000 Z
11
+ date: 2016-06-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler