itcsscli 0.1.12 → 0.1.13

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: 15814717847cd7788fd7cefe0d8de1e7436db24e
4
- data.tar.gz: 7e29ee26fd39346b0b39f10c76304b9a94ffdb42
3
+ metadata.gz: 668cf6ed0593348da0a80325eb0120b32d94bc1c
4
+ data.tar.gz: 323f9f6745ad393d388b6b15f4a493e1159820a2
5
5
  SHA512:
6
- metadata.gz: cb584114c152abadb45ad6efd7df60a563a188c508819b52010dc6ce7a4382989931281b408284c4d53ed4f9b73af7071575b7812ec50c0731322256273e7180
7
- data.tar.gz: 3065b49c3e9fd63f9a00a948f2c4a4531aba6af18080a2add7b5debfca7c9d06f393ee60647a33aa62f45631050e3a81385645e167a878197abf83e12989c91c
6
+ metadata.gz: 4ec93d82e613b983f148275cd18f0ee134cd457b3cc540fdc55406da2ab278d4a24d48ebe5e2d9519f95e94a9932a76b1e657aed2287717177f92f74aeeaee74
7
+ data.tar.gz: 8de3805c1d22a4198c89c19220db3f8cc2f3ac6c8b5c03a6222e755bbcdaa57b88a66bfd4dcd6ec8059dfc154b407ca10bce2f7ebebe5bd0e22669ce4504ddde
data/.gitignore CHANGED
@@ -7,3 +7,4 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ .sass-cache
data/README.md CHANGED
@@ -25,7 +25,7 @@ First, you'll need to set up ITCSS by running:
25
25
  ```{r, engine='bash'}
26
26
  $ itcss init
27
27
  ```
28
-
28
+
29
29
  Now go to `itcss.yml` and do your itcss_cli config:
30
30
 
31
31
  ```yml
@@ -150,9 +150,15 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERN
150
150
 
151
151
  ## Development
152
152
  ```{r, engine='bash'}
153
+ $ bundle
153
154
  $ rvm gemset create itcsscli && rvm gemset use itcsscli
154
155
  ```
155
156
 
157
+ To compile sass:
158
+ ```
159
+ $ sass --watch assets/itcss.sass:assets/itcss.css --style compressed --sourcemap=none
160
+ ```
161
+
156
162
  ## License
157
163
 
158
164
  The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
@@ -0,0 +1,95 @@
1
+ code[class*="language-"],
2
+ pre[class*="language-"]
3
+ color: black
4
+ background: none
5
+ text-shadow: 0 1px white
6
+ text-align: left
7
+ white-space: pre
8
+ word-spacing: normal
9
+ word-break: normal
10
+ word-wrap: normal
11
+ line-height: 1.5
12
+
13
+ -moz-tab-size: 4
14
+ -o-tab-size: 4
15
+ tab-size: 4
16
+
17
+ -webkit-hyphens: none
18
+ -moz-hyphens: none
19
+ -ms-hyphens: none
20
+ hyphens: none
21
+
22
+ pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection,
23
+ code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection
24
+ text-shadow: none
25
+ background: #b3d4fc
26
+
27
+ pre[class*="language-"]::selection, pre[class*="language-"] ::selection,
28
+ code[class*="language-"]::selection, code[class*="language-"] ::selection
29
+ text-shadow: none
30
+ background: #b3d4fc
31
+
32
+ @media print
33
+ code[class*="language-"],
34
+ pre[class*="language-"]
35
+ text-shadow: none
36
+
37
+ .token.comment,
38
+ .token.prolog,
39
+ .token.doctype,
40
+ .token.cdata
41
+ color: slategray
42
+
43
+ .token.punctuation
44
+ color: #999
45
+
46
+ .namespace
47
+ opacity: .7
48
+
49
+ .token.property,
50
+ .token.tag,
51
+ .token.boolean,
52
+ .token.number,
53
+ .token.constant,
54
+ .token.symbol,
55
+ .token.deleted
56
+ color: #6F6F6F
57
+
58
+ .token.selector,
59
+ .token.attr-name,
60
+ .token.string,
61
+ .token.char,
62
+ .token.builtin,
63
+ .token.inserted
64
+ color: #690
65
+
66
+ .token.operator,
67
+ .token.entity,
68
+ .token.url,
69
+ .language-css .token.string,
70
+ .style .token.string
71
+ color: #a67f59
72
+ background: hsla(0, 0%, 100%, .5)
73
+
74
+ .token.atrule,
75
+ .token.attr-value,
76
+ .token.keyword
77
+ color: #07a
78
+
79
+ .token.function
80
+ color: #DD4A68
81
+
82
+ .token.regex,
83
+ .token.important,
84
+ .token.variable
85
+ color: #e90
86
+
87
+ .token.important,
88
+ .token.bold
89
+ font-weight: bold
90
+ .token.italic
91
+ font-style: italic
92
+
93
+ .token.entity
94
+ cursor: help
95
+
data/assets/itcss.css ADDED
@@ -0,0 +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",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.js ADDED
@@ -0,0 +1 @@
1
+ var _self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},Prism=function(){var e=/\blang(?:uage)?-(\w+)\b/i,t=0,n=_self.Prism={util:{encode:function(e){return e instanceof a?new a(e.type,n.util.encode(e.content),e.alias):"Array"===n.util.type(e)?e.map(n.util.encode):e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).match(/\[object (\w+)\]/)[1]},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++t}),e.__id},clone:function(e){var t=n.util.type(e);switch(t){case"Object":var a={};for(var r in e)e.hasOwnProperty(r)&&(a[r]=n.util.clone(e[r]));return a;case"Array":return e.map&&e.map(function(e){return n.util.clone(e)})}return e}},languages:{extend:function(e,t){var a=n.util.clone(n.languages[e]);for(var r in t)a[r]=t[r];return a},insertBefore:function(e,t,a,r){r=r||n.languages;var l=r[e];if(2==arguments.length){a=arguments[1];for(var i in a)a.hasOwnProperty(i)&&(l[i]=a[i]);return l}var o={};for(var s in l)if(l.hasOwnProperty(s)){if(s==t)for(var i in a)a.hasOwnProperty(i)&&(o[i]=a[i]);o[s]=l[s]}return n.languages.DFS(n.languages,function(t,n){n===r[e]&&t!=e&&(this[t]=o)}),r[e]=o},DFS:function(e,t,a,r){r=r||{};for(var l in e)e.hasOwnProperty(l)&&(t.call(e,l,e[l],a||l),"Object"!==n.util.type(e[l])||r[n.util.objId(e[l])]?"Array"!==n.util.type(e[l])||r[n.util.objId(e[l])]||(r[n.util.objId(e[l])]=!0,n.languages.DFS(e[l],t,l,r)):(r[n.util.objId(e[l])]=!0,n.languages.DFS(e[l],t,null,r)))}},plugins:{},highlightAll:function(e,t){var a={callback:t,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};n.hooks.run("before-highlightall",a);for(var r,l=a.elements||document.querySelectorAll(a.selector),i=0;r=l[i++];)n.highlightElement(r,e===!0,a.callback)},highlightElement:function(t,a,r){for(var l,i,o=t;o&&!e.test(o.className);)o=o.parentNode;o&&(l=(o.className.match(e)||[,""])[1].toLowerCase(),i=n.languages[l]),t.className=t.className.replace(e,"").replace(/\s+/g," ")+" language-"+l,o=t.parentNode,/pre/i.test(o.nodeName)&&(o.className=o.className.replace(e,"").replace(/\s+/g," ")+" language-"+l);var s=t.textContent,u={element:t,language:l,grammar:i,code:s};if(n.hooks.run("before-sanity-check",u),!u.code||!u.grammar)return n.hooks.run("complete",u),void 0;if(n.hooks.run("before-highlight",u),a&&_self.Worker){var c=new Worker(n.filename);c.onmessage=function(e){u.highlightedCode=e.data,n.hooks.run("before-insert",u),u.element.innerHTML=u.highlightedCode,r&&r.call(u.element),n.hooks.run("after-highlight",u),n.hooks.run("complete",u)},c.postMessage(JSON.stringify({language:u.language,code:u.code,immediateClose:!0}))}else u.highlightedCode=n.highlight(u.code,u.grammar,u.language),n.hooks.run("before-insert",u),u.element.innerHTML=u.highlightedCode,r&&r.call(t),n.hooks.run("after-highlight",u),n.hooks.run("complete",u)},highlight:function(e,t,r){var l=n.tokenize(e,t);return a.stringify(n.util.encode(l),r)},tokenize:function(e,t){var a=n.Token,r=[e],l=t.rest;if(l){for(var i in l)t[i]=l[i];delete t.rest}e:for(var i in t)if(t.hasOwnProperty(i)&&t[i]){var o=t[i];o="Array"===n.util.type(o)?o:[o];for(var s=0;s<o.length;++s){var u=o[s],c=u.inside,g=!!u.lookbehind,h=!!u.greedy,f=0,d=u.alias;u=u.pattern||u;for(var p=0;p<r.length;p++){var m=r[p];if(r.length>e.length)break e;if(!(m instanceof a)){u.lastIndex=0;var y=u.exec(m),v=1;if(!y&&h&&p!=r.length-1){var b=r[p+1].matchedStr||r[p+1],k=m+b;if(p<r.length-2&&(k+=r[p+2].matchedStr||r[p+2]),u.lastIndex=0,y=u.exec(k),!y)continue;var w=y.index+(g?y[1].length:0);if(w>=m.length)continue;var _=y.index+y[0].length,P=m.length+b.length;if(v=3,P>=_){if(r[p+1].greedy)continue;v=2,k=k.slice(0,P)}m=k}if(y){g&&(f=y[1].length);var w=y.index+f,y=y[0].slice(f),_=w+y.length,S=m.slice(0,w),A=m.slice(_),O=[p,v];S&&O.push(S);var j=new a(i,c?n.tokenize(y,c):y,d,y,h);O.push(j),A&&O.push(A),Array.prototype.splice.apply(r,O)}}}}}return r},hooks:{all:{},add:function(e,t){var a=n.hooks.all;a[e]=a[e]||[],a[e].push(t)},run:function(e,t){var a=n.hooks.all[e];if(a&&a.length)for(var r,l=0;r=a[l++];)r(t)}}},a=n.Token=function(e,t,n,a,r){this.type=e,this.content=t,this.alias=n,this.matchedStr=a||null,this.greedy=!!r};if(a.stringify=function(e,t,r){if("string"==typeof e)return e;if("Array"===n.util.type(e))return e.map(function(n){return a.stringify(n,t,e)}).join("");var l={type:e.type,content:a.stringify(e.content,t,r),tag:"span",classes:["token",e.type],attributes:{},language:t,parent:r};if("comment"==l.type&&(l.attributes.spellcheck="true"),e.alias){var i="Array"===n.util.type(e.alias)?e.alias:[e.alias];Array.prototype.push.apply(l.classes,i)}n.hooks.run("wrap",l);var o="";for(var s in l.attributes)o+=(o?" ":"")+s+'="'+(l.attributes[s]||"")+'"';return"<"+l.tag+' class="'+l.classes.join(" ")+'" '+o+">"+l.content+"</"+l.tag+">"},!_self.document)return _self.addEventListener?(_self.addEventListener("message",function(e){var t=JSON.parse(e.data),a=t.language,r=t.code,l=t.immediateClose;_self.postMessage(n.highlight(r,n.languages[a],a)),l&&_self.close()},!1),_self.Prism):_self.Prism;var r=document.currentScript||[].slice.call(document.getElementsByTagName("script")).pop();return r&&(n.filename=r.src,document.addEventListener&&!r.hasAttribute("data-manual")&&("loading"!==document.readyState?requestAnimationFrame(n.highlightAll,0):document.addEventListener("DOMContentLoaded",n.highlightAll))),_self.Prism}();"undefined"!=typeof module&&module.exports&&(module.exports=Prism),"undefined"!=typeof global&&(global.Prism=Prism);Prism.languages.css={comment:/\/\*[\w\W]*?\*\//,atrule:{pattern:/@[\w-]+?.*?(;|(?=\s*\{))/i,inside:{rule:/@[\w-]+/}},url:/url\((?:(["'])(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,selector:/[^\{\}\s][^\{\};]*?(?=\s*\{)/,string:/("|')(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1/,property:/(\b|\B)[\w-]+(?=\s*:)/i,important:/\B!important\b/i,"function":/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:]/},Prism.languages.css.atrule.inside.rest=Prism.util.clone(Prism.languages.css),Prism.languages.markup&&(Prism.languages.insertBefore("markup","tag",{style:{pattern:/(<style[\w\W]*?>)[\w\W]*?(?=<\/style>)/i,lookbehind:!0,inside:Prism.languages.css,alias:"language-css"}}),Prism.languages.insertBefore("inside","attr-value",{"style-attr":{pattern:/\s*style=("|').*?\1/i,inside:{"attr-name":{pattern:/^\s*style/i,inside:Prism.languages.markup.tag.inside},punctuation:/^\s*=\s*['"]|['"]\s*$/,"attr-value":{pattern:/.+/i,inside:Prism.languages.css}},alias:"language-css"}},Prism.languages.markup.tag));!function(e){e.languages.sass=e.languages.extend("css",{comment:{pattern:/^([ \t]*)\/[\/*].*(?:(?:\r?\n|\r)\1[ \t]+.+)*/m,lookbehind:!0}}),e.languages.insertBefore("sass","atrule",{"atrule-line":{pattern:/^(?:[ \t]*)[@+=].+/m,inside:{atrule:/(?:@[\w-]+|[+=])/m}}}),delete e.languages.sass.atrule;var a=/((\$[-_\w]+)|(#\{\$[-_\w]+\}))/i,t=[/[+*\/%]|[=!]=|<=?|>=?|\b(?:and|or|not)\b/,{pattern:/(\s+)-(?=\s)/,lookbehind:!0}];e.languages.insertBefore("sass","property",{"variable-line":{pattern:/^[ \t]*\$.+/m,inside:{punctuation:/:/,variable:a,operator:t}},"property-line":{pattern:/^[ \t]*(?:[^:\s]+ *:.*|:[^:\s]+.*)/m,inside:{property:[/[^:\s]+(?=\s*:)/,{pattern:/(:)[^:\s]+/,lookbehind:!0}],punctuation:/:/,variable:a,operator:t,important:e.languages.sass.important}}}),delete e.languages.sass.property,delete e.languages.sass.important,delete e.languages.sass.selector,e.languages.insertBefore("sass","punctuation",{selector:{pattern:/([ \t]*)\S(?:,?[^,\r\n]+)*(?:,(?:\r?\n|\r)\1[ \t]+\S(?:,?[^,\r\n]+)*)*/,lookbehind:!0}})}(Prism);
data/assets/itcss.sass ADDED
@@ -0,0 +1,181 @@
1
+ @import "_syntax"
2
+
3
+ // Colors
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
+
21
+
22
+ // Settings
23
+ $sidebar-width: 260px
24
+ $container-width: 600px
25
+
26
+ // Font
27
+ $monospace: "Roboto Mono", Monaco, monospace
28
+
29
+ // Resets
30
+ html, body, div, span, applet, object, iframe,
31
+ h1, h2, h3, h4, h5, h6, p, blockquote, pre,
32
+ a, abbr, acronym, address, big, cite, code,
33
+ del, dfn, em, font, img, ins, kbd, q, s, samp,
34
+ small, strike, strong, sub, sup, tt, var,
35
+ dl, dt, dd, ol, ul, li,
36
+ fieldset, form, label, legend,
37
+ table, caption, tbody, tfoot, thead, tr, th, td
38
+ margin: 0
39
+ padding: 0
40
+ border: 0
41
+ outline: 0
42
+
43
+ a
44
+ color: inherit
45
+ text-decoration: none
46
+
47
+ // Objects
48
+ body
49
+ font-family: $monospace
50
+ font-size: 14px
51
+ background-color: $c-bg
52
+
53
+ .container
54
+ max-width: $container-width
55
+ margin: 60px auto
56
+ border-radius: 2px
57
+ transform: translateX($sidebar-width/2)
58
+ display: flex
59
+ flex-direction: column
60
+
61
+ // Sidebar
62
+ .sidebar
63
+ position: fixed
64
+ width: $sidebar-width
65
+ height: 100%
66
+ top: 0
67
+ background-color: $c-dark-blue
68
+ overflow-y: scroll
69
+
70
+ // Header
71
+ header
72
+ height: 48px
73
+ background-color: $c-blue
74
+ width: 100%
75
+ top: 0
76
+ position: absolute
77
+
78
+ // Logo
79
+ .logo
80
+ height: 24px
81
+ top: 12px
82
+ position: absolute
83
+ left: 12px
84
+
85
+ .sidebar &
86
+ position: relative
87
+
88
+ .logo__cli
89
+ fill: $c-blue
90
+
91
+ // Navigation
92
+ .nav
93
+ position: absolute
94
+ width: 100%
95
+ top: 48px
96
+ bottom: 0
97
+ padding-bottom: 24px
98
+ border-top: 1px solid rgba(white, .1)
99
+ overflow-y: scroll
100
+
101
+ .nav__item
102
+ display: block
103
+ color: white
104
+ padding: 10px 16px
105
+ font-weight: 100
106
+
107
+ .nav__link
108
+ padding: 6px 16px
109
+ margin-left: 24px
110
+ border-left: 4px solid $c-blue
111
+ transition: border .2s
112
+ font-size: 12px
113
+
114
+ &:hover
115
+ border-left: 4px solid white
116
+
117
+ // File
118
+ .file
119
+ padding-top: 6px
120
+
121
+ &:before
122
+ content: attr(id)
123
+ text-align: right
124
+ display: block
125
+ color: $c-dark-gray
126
+ font-weight: lighter
127
+
128
+ & + &
129
+ margin-top: 20px
130
+
131
+ .file__content
132
+ padding: 20px
133
+ background-color: white
134
+ border: 1px solid $c-gray
135
+ box-shadow: 0 3px 6px rgba(0,0,0,0.16)
136
+ overflow-x: scroll
137
+
138
+ .blank_slate
139
+ font-size: 12px
140
+ text-align: center
141
+ color: $c-gray
142
+
143
+ pre
144
+ font-size: 12px
145
+
146
+ // Module
147
+ .module
148
+ font-size: 26px
149
+ line-height: 18px
150
+ padding: 18px 0 8px
151
+ color: $c-dark-gray
152
+
153
+ &:after
154
+ content: ''
155
+ position: absolute
156
+ left: -24px
157
+ border-style: solid
158
+ border-width: 10px 0 10px 17.3px
159
+ border-color: transparent transparent transparent $c-blue
160
+
161
+ .file + &
162
+ margin-top: 30px
163
+
164
+ // Markup
165
+ h3:after
166
+ color: white
167
+ font-size: 9px
168
+ padding: 2px 4px
169
+ border-radius: 4px
170
+ vertical-align: middle
171
+ content: attr(data-type)
172
+
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)
178
+
179
+ h3[data-type='variable'], h3[data-type='import']
180
+ font-size: 14px
181
+ font-weight: 400
@@ -0,0 +1 @@
1
+ <svg class="logo" viewBox="0 0 139 21" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><path id="a" d="M138.824 31.625V0H0v31.625h138.824z"/></defs><g transform="translate(0 -3)" fill="none" fill-rule="evenodd"><mask id="b" fill="#fff"><use xlink:href="#a"/></mask><path class="logo__cli" d="M91.32 17.28c-.073-.29-3.062-.62-3.1-.947-.072-.438 2.08-.875 2.845-1.35.29-.18 2.952-.765 3.025-1.13.037-.4-2.88-.765-2.77-1.166.4-1.968 1.35-3.973 2.88-5.613 1.786-1.896 4.447-3.28 7.946-3.28 3.718 0 6.38 2.113 7.108 5.394l-5.176 2.406c-.364-1.53-1.385-2.26-2.697-2.26-1.166 0-2.114.51-2.843 1.276-.51.583-.91 1.312-1.166 2.077-.145.547 3.318.584 3.318 1.167 0 .22-3.572.984-3.536 1.166.073.51-2.734.948-2.515 1.313.255.4 3.536.73 3.9.947.4.183.84.292 1.313.292 1.312 0 2.405-.693 3.353-1.932l3.973 3.39c-1.713 2.442-4.228 4.046-7.91 4.046-4.046 0-7.035-2.187-7.946-5.796zm20.23.328l-1.567-.947 2.15-1.348 2.662-1.203-2.078-1.167 2.15-8.603h5.87l-2.15 8.603 2.077 1.166s-2.115.8-2.698 1.202c-.11.437-2.005.91-2.114 1.35-.11.4 1.604.764 1.567.946-.037.073-.037.11-.037.11h7.983l-1.35 5.358h-13.85l1.385-5.468zm17.28.037l-2.735-.948 3.317-1.312 3.244-1.167-2.66-1.166 2.15-8.53h5.796l-2.15 8.53 2.66 1.166-3.244 1.167-3.28 1.312 2.697.948-1.35 5.43h-5.795l1.35-5.43z" fill="#232F42" mask="url(#b)"/><path d="M3.09 17.645l-2.733-.948 3.318-1.312 3.244-1.167-2.662-1.166 2.15-8.53h5.796l-2.15 8.53 2.66 1.166-3.244 1.167-3.28 1.312 2.697.948-1.35 5.43H1.744l1.348-5.43zm13.525-.073l-2.15-.948 2.733-1.312 2.66-1.203-2.077-1.167.84-3.318h-5.176l1.75-5.322h16.585l-2.152 5.322h-5.14l-.838 3.318 2.078 1.166-2.697 1.202-2.697 1.312 2.15.948-1.384 5.504h-5.87l1.385-5.504zM32.112 17.28c-.073-.29-3.062-.62-3.1-.947-.07-.438 2.08-.875 2.845-1.35.29-.18 2.952-.765 3.025-1.13.037-.4-2.88-.765-2.77-1.166.4-1.968 1.35-3.973 2.88-5.613 1.786-1.896 4.447-3.28 7.946-3.28 3.718 0 6.38 2.113 7.108 5.394l-5.176 2.406c-.364-1.53-1.385-2.26-2.697-2.26-1.167 0-2.115.51-2.844 1.276-.51.583-.912 1.312-1.167 2.077-.146.547 3.317.584 3.317 1.167 0 .22-3.572.984-3.536 1.166.073.51-2.734.948-2.515 1.313.254.4 3.535.73 3.9.947.4.183.838.292 1.312.292 1.312 0 2.405-.693 3.353-1.932l3.974 3.39c-1.715 2.442-4.23 4.046-7.912 4.046-4.046 0-7.035-2.187-7.946-5.796zM50.232 19.868l1.75-2.296.802-.984.656-.84c1.932 1.715 3.9 2.553 5.65 2.553.73 0 1.24-.29 1.24-.8 0-.365-4.703-.584-5.396-.912-.437-.22.328-.365.62-.583.583-.4.583-.33.948-.693.62-.62 2.55-.73 2.04-1.167-.4-.328-4.738-.692-4.993-1.13-.402-.62-.584-1.385-.584-2.296 0-1.532.583-2.917 1.604-4.01 1.312-1.422 3.39-2.297 5.978-2.297 2.99 0 5.687 1.02 7.51 2.697l-2.844 4.484c-1.276-1.094-3.463-2.37-5.25-2.37-.728 0-1.202.183-1.202.693 0 .547.328.656 2.66 1.567 1.167.474 2.152.948 2.917 1.53.436.33 3.644.694 3.936 1.13.22.33-1.97.913-2.333 1.168-.62.4-2.698.838-2.698 1.35 0 .29 2.844.545 2.844.837-.184 1.275-.694 2.44-1.57 3.39-1.275 1.348-3.352 2.223-6.013 2.223-3.354 0-6.234-1.276-8.275-3.245zm18.773 0l1.75-2.296.802-.984.656-.84c1.932 1.715 3.9 2.553 5.65 2.553.73 0 1.24-.29 1.24-.8 0-.365-4.703-.584-5.396-.912-.437-.22.328-.365.62-.583.583-.4.583-.33.948-.693.62-.62 2.55-.73 2.04-1.167-.4-.328-4.738-.692-4.993-1.13-.4-.62-.583-1.385-.583-2.296 0-1.532.582-2.917 1.603-4.01 1.312-1.422 3.39-2.297 5.978-2.297 2.99 0 5.687 1.02 7.51 2.697l-2.843 4.484c-1.276-1.094-3.463-2.37-5.25-2.37-.728 0-1.202.183-1.202.693 0 .547.328.656 2.66 1.567 1.167.474 2.15.948 2.917 1.53.437.33 3.645.694 3.937 1.13.217.33-1.97.913-2.334 1.168-.62.4-2.698.838-2.698 1.35 0 .29 2.843.545 2.843.837-.18 1.275-.69 2.44-1.566 3.39-1.276 1.348-3.354 2.223-6.015 2.223-3.354 0-6.234-1.276-8.275-3.245z" fill="#FFF" mask="url(#b)"/></g></svg>
@@ -0,0 +1 @@
1
+ <svg class="logo" width="154" height="21" viewBox="0 0 154 21" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><path id="a" d="M159 26V0H0v26h159z"/></defs><g transform="translate(0 -3)" fill="none" fill-rule="evenodd"><mask id="b" fill="#fff"><use xlink:href="#a"/></mask><path class="logo__cli" d="M91.06 17.6l-2.7-.9 3.276-1.332 3.24-1.188-2.664-1.152 2.124-8.532h6.156c3.348 0 5.472.972 6.768 2.376 1.296 1.404 1.872 3.204 1.872 5.436v.72c-.036.396 2.844.792 2.808 1.152-.072.396-2.88 1.008-3.24 1.188-.576.36-3.204.9-3.42 1.332-.144.288 2.664.612 2.484.9-.396.72-.9 1.404-1.476 2.016-2.052 2.232-5.076 3.42-9.072 3.42h-7.524L91.06 17.6zm8.676-7.704h-.972l-.756 3.132 2.628 1.152-3.24 1.188-3.24 1.332 2.7.936h1.008c1.368 0-.036-.324-.036-.936-.036-.432 2.412-.72 2.7-.828.396-.108 1.44-.252 2.052-.504.36-.144 3.312-.756 3.456-1.188.072-.36-2.628-.792-2.772-1.08-.036-.036 0-.108 0-.144 0-1.008-.288-1.656-.72-2.124-.54-.576-1.404-.936-2.808-.936zm31.732 2.592c0 .144 0 .324-.036.468 0 .396 2.808.756 2.736 1.116-.036.396-2.952.792-3.06 1.152-.108.432-3.096.864-3.24 1.26-.144.324 2.592.612 2.448.9-.468.936-1.08 1.764-1.764 2.52-1.728 1.872-4.176 3.06-6.912 3.06-3.96 0-6.912-2.304-7.92-5.58-.072-.288-2.988-.576-3.06-.9-.072-.396 2.736-.828 2.7-1.26 0-.108 1.152-.468 1.26-.504.324-.216 1.584-.36 1.62-.648 0-.36-2.772-.756-2.7-1.116.36-2.088 1.332-3.996 2.736-5.472 1.728-1.872 4.14-3.06 6.912-3.06 4.896 0 8.28 3.492 8.28 8.064zm-8.064 4.932c.396-.216-2.052-.468-1.728-.828.324-.36 3.456-.792 3.672-1.26.18-.396 3.168-.828 3.24-1.26.072-.324-2.736-.684-2.736-1.044 0-1.872-1.044-3.348-3.06-3.348-1.008 0-1.836.432-2.484 1.116-.54.576-.936 1.332-1.188 2.16-.072.36 2.7.756 2.7 1.116-.036.108-.612.18-1.332.432-.252.108-1.224.54-1.44.72-.576.432-2.592.9-2.34 1.26.252.396 3.42.684 3.852.9.396.216.9.324 1.476.324.504 0 .936-.108 1.368-.288zm12.544-.144c-.072-.288-3.024-.612-3.06-.936-.072-.432 2.052-.864 2.808-1.332.288-.18 2.916-.756 2.988-1.116.036-.396-2.844-.756-2.736-1.152.396-1.944 1.332-3.924 2.844-5.544 1.764-1.872 4.392-3.24 7.848-3.24 3.672 0 6.3 2.088 7.02 5.328l-5.112 2.376c-.36-1.512-1.368-2.232-2.664-2.232-1.152 0-2.088.504-2.808 1.26-.504.576-.9 1.296-1.152 2.052-.144.54 3.276.576 3.276 1.152 0 .216-3.528.972-3.492 1.152.072.504-2.7.936-2.484 1.296.252.396 3.492.72 3.852.936.396.18.828.288 1.296.288 1.296 0 2.376-.684 3.312-1.908l3.924 3.348c-1.692 2.412-4.176 3.996-7.812 3.996-3.996 0-6.948-2.16-7.848-5.724z" fill="#232F42" mask="url(#b)"/><path d="M3.09 17.645l-2.733-.948 3.318-1.312 3.244-1.167-2.662-1.166 2.15-8.53h5.796l-2.15 8.53 2.66 1.166-3.244 1.167-3.28 1.312 2.697.948-1.35 5.43H1.744l1.348-5.43zm13.525-.073l-2.15-.948 2.733-1.312 2.66-1.203-2.077-1.167.84-3.318h-5.176l1.75-5.322h16.585l-2.152 5.322h-5.14l-.838 3.318 2.078 1.166-2.697 1.202-2.697 1.312 2.15.948-1.384 5.504h-5.87l1.385-5.504zM32.112 17.28c-.073-.29-3.062-.62-3.1-.947-.07-.438 2.08-.875 2.845-1.35.29-.18 2.952-.765 3.025-1.13.037-.4-2.88-.765-2.77-1.166.4-1.968 1.35-3.973 2.88-5.613 1.786-1.896 4.447-3.28 7.946-3.28 3.718 0 6.38 2.113 7.108 5.394l-5.176 2.406c-.364-1.53-1.385-2.26-2.697-2.26-1.167 0-2.115.51-2.844 1.276-.51.583-.912 1.312-1.167 2.077-.146.547 3.317.584 3.317 1.167 0 .22-3.572.984-3.536 1.166.073.51-2.734.948-2.515 1.313.254.4 3.535.73 3.9.947.4.183.838.292 1.312.292 1.312 0 2.405-.693 3.353-1.932l3.974 3.39c-1.715 2.442-4.23 4.046-7.912 4.046-4.046 0-7.035-2.187-7.946-5.796zM50.232 19.868l1.75-2.296.802-.984.656-.84c1.932 1.715 3.9 2.553 5.65 2.553.73 0 1.24-.29 1.24-.8 0-.365-4.703-.584-5.396-.912-.437-.22.328-.365.62-.583.583-.4.583-.33.948-.693.62-.62 2.55-.73 2.04-1.167-.4-.328-4.738-.692-4.993-1.13-.402-.62-.584-1.385-.584-2.296 0-1.532.583-2.917 1.604-4.01 1.312-1.422 3.39-2.297 5.978-2.297 2.99 0 5.687 1.02 7.51 2.697l-2.844 4.484c-1.276-1.094-3.463-2.37-5.25-2.37-.728 0-1.202.183-1.202.693 0 .547.328.656 2.66 1.567 1.167.474 2.152.948 2.917 1.53.436.33 3.644.694 3.936 1.13.22.33-1.97.913-2.333 1.168-.62.4-2.698.838-2.698 1.35 0 .29 2.844.545 2.844.837-.184 1.275-.694 2.44-1.57 3.39-1.275 1.348-3.352 2.223-6.013 2.223-3.354 0-6.234-1.276-8.275-3.245zm18.773 0l1.75-2.296.802-.984.656-.84c1.932 1.715 3.9 2.553 5.65 2.553.73 0 1.24-.29 1.24-.8 0-.365-4.703-.584-5.396-.912-.437-.22.328-.365.62-.583.583-.4.583-.33.948-.693.62-.62 2.55-.73 2.04-1.167-.4-.328-4.738-.692-4.993-1.13-.4-.62-.583-1.385-.583-2.296 0-1.532.582-2.917 1.603-4.01 1.312-1.422 3.39-2.297 5.978-2.297 2.99 0 5.687 1.02 7.51 2.697l-2.843 4.484c-1.276-1.094-3.463-2.37-5.25-2.37-.728 0-1.202.183-1.202.693 0 .547.328.656 2.66 1.567 1.167.474 2.15.948 2.917 1.53.437.33 3.645.694 3.937 1.13.217.33-1.97.913-2.334 1.168-.62.4-2.698.838-2.698 1.35 0 .29 2.843.545 2.843.837-.18 1.275-.69 2.44-1.566 3.39-1.276 1.348-3.354 2.223-6.015 2.223-3.354 0-6.234-1.276-8.275-3.245z" fill="#FFF" mask="url(#b)"/></g></svg>
@@ -0,0 +1,157 @@
1
+ def initialize_doc
2
+ puts 'parsing your files...'.yellow
3
+
4
+ @ITCSS_MODULES.each do |current_module|
5
+ itcss_module_files = Dir[ File.join("#{@ITCSS_DIR}/#{current_module}/", '**', '*') ].reject { |p| File.directory? p }
6
+ if itcss_module_files.kind_of?(Array) && itcss_module_files.any?
7
+ module_header = construct_module_header current_module
8
+ @all_files_markup = @all_files_markup.to_s + module_header
9
+ end
10
+ itcss_module_files.each do |current_file|
11
+ map_file current_file
12
+ end
13
+ end
14
+
15
+ construct_navigation
16
+ write_itcss_map_file @all_files_markup, @nav
17
+ end
18
+
19
+ def map_file file
20
+ File.open file do |io|
21
+ get_lines_content io.read
22
+ end
23
+
24
+ selector_indexes = get_selector_indexes @line_type_indexes
25
+ selector_blocks = get_selector_blocks @lines, selector_indexes
26
+ file_markup = construct_file_markup selector_blocks, file
27
+ @all_files_markup = @all_files_markup.to_s + file_markup
28
+ end
29
+
30
+ def get_lines_content content
31
+ @lines, @line_type_indexes = [], []
32
+ content.each_line.with_index do |line, index|
33
+ line_content = get_line_content line
34
+ (@lines ||= []).push line
35
+ (@line_type_indexes ||= []).push line_content
36
+ # puts "#{index}|#{line_content}|#{line}"
37
+ end
38
+ end
39
+
40
+ def get_line_content line
41
+ if line.chars.size <= 1
42
+ "em" # empty
43
+ elsif line.start_with? '/// '
44
+ "sc" # super comment
45
+ elsif line.start_with? '// '
46
+ "rc" # regular comment
47
+ elsif line.start_with? ' '
48
+ "pr" # property
49
+ else
50
+ 'sl' # selector
51
+ end
52
+ end
53
+
54
+ def get_selector_type line
55
+ if line.start_with? '='
56
+ "mixin"
57
+ elsif line.start_with? '$'
58
+ "variable"
59
+ elsif line.start_with? '@import'
60
+ "import"
61
+ elsif line.start_with? '@keyframes'
62
+ "keyframes"
63
+ elsif line.start_with? '%'
64
+ "placeholder selector"
65
+ elsif !line.include? '.'
66
+ "unclassed"
67
+ elsif line.include? '--'
68
+ "modifier"
69
+ elsif line.include? '__'
70
+ "element"
71
+ else
72
+ "block"
73
+ end
74
+ end
75
+
76
+ def get_selector_indexes line_type_indexes
77
+ line_type_indexes.each_index.select{|x| line_type_indexes[x] == "sl"}
78
+ end
79
+
80
+ def get_selector_blocks lines, selector_indexes
81
+ @selector_blocks = []
82
+ selector_indexes.each_with_index do |index, i|
83
+ (@selector_blocks ||= []).push lines[index..(selector_indexes[i+1] ? selector_indexes[i+1]-1 : lines.size)]
84
+ end
85
+
86
+ @selector_blocks
87
+ end
88
+
89
+ def construct_file_markup selector_blocks, file_name
90
+ file_markup = "<div class='file' id='#{excerpt_filename file_name}'><div class='file__content'>"
91
+ if selector_blocks.kind_of?(Array) && selector_blocks.any?
92
+ selector_blocks.each do |selector_block|
93
+ selector_type = get_selector_type selector_block.first
94
+ file_markup += "<h3 data-type='#{selector_type}'>#{line_break_string selector_block.shift}</h3>"
95
+ file_markup += "<pre><code class='language-sass'>#{line_break_array selector_block}</code></pre>"
96
+ end
97
+ else
98
+ file_markup += "<div class='blank_slate'>Empty file :/</div>"
99
+ end
100
+ file_markup += "</div></div>"
101
+
102
+ file_markup
103
+ end
104
+
105
+ def construct_module_header module_name
106
+ "<div id='#{module_name}' class='module'>#{module_name}</div>"
107
+ end
108
+
109
+ def construct_navigation
110
+ @nav = '<div class="nav">'
111
+ @ITCSS_MODULES.each do |current_module|
112
+ itcss_module_files = Dir[ File.join("#{@ITCSS_DIR}/#{current_module}/", '**', '*') ].reject { |p| File.directory? p }
113
+ if itcss_module_files.kind_of?(Array) && itcss_module_files.any?
114
+ @nav += "<a href='##{current_module}' class='nav__item'>#{current_module}</a>"
115
+ itcss_module_files.each do |current_file|
116
+ @nav += "<a href='##{excerpt_filename current_file}' class='nav__item nav__link'>#{excerpt_filename(current_file).split('.')[1]}</a>"
117
+ end
118
+ end
119
+ end
120
+ @nav += '</div>'
121
+ end
122
+
123
+ def write_itcss_map_file content, nav
124
+ File.open @ITCSS_DOC_TEMPLATE do |io|
125
+ template = ERB.new io.read
126
+ logo = line_break_removal File.open(relative_file_path('../assets/logo_doc.svg')).read
127
+ style = line_break_removal File.open(relative_file_path('../assets/itcss.css')).read
128
+ javascript = line_break_removal File.open(relative_file_path('../assets/itcss.js')).read
129
+
130
+ FileUtils.mkdir_p @ITCSS_DOC_DIR
131
+ File.open @ITCSS_DOC_FILE, "w+" do |out|
132
+ out.puts template.result binding
133
+ end
134
+
135
+ puts "The documentation has been successfully generated.".green
136
+ puts "create #{@ITCSS_DOC_FILE}".green
137
+ puts "opening #{@ITCSS_DOC_FILE}...".yellow
138
+ `open #{@ITCSS_DOC_FILE}`
139
+ end
140
+ end
141
+
142
+ # Helper
143
+ def excerpt_filename file
144
+ File.basename(file, ".*").sub('_', '')
145
+ end
146
+
147
+ def line_break_array content
148
+ content.map{ |p| p.sub("\n", '&#10;') }.join
149
+ end
150
+
151
+ def line_break_string content
152
+ content.sub "\n", '&#10;'
153
+ end
154
+
155
+ def line_break_removal content
156
+ content.sub "\n", ''
157
+ end
@@ -1,3 +1,3 @@
1
1
  module Itcsscli
2
- VERSION = "0.1.12"
2
+ VERSION = "0.1.13"
3
3
  end
data/lib/itcsscli.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require "itcsscli/version"
2
+ require "itcss_doc_parser"
2
3
  require "erb"
3
4
  require 'colorize'
4
5
  require 'yaml'
@@ -19,6 +20,9 @@ module Itcsscli
19
20
  @ITCSS_CONFIG_TEMPLATE = relative_file_path "../templates/itcss_config.erb"
20
21
  @ITCSS_MODULE_TEMPLATE = relative_file_path "../templates/itcss_module.erb"
21
22
  @ITCSS_APP_TEMPLATE = relative_file_path "../templates/itcss_application.erb"
23
+ @ITCSS_DOC_TEMPLATE = relative_file_path "../templates/itcss_doc.html.erb"
24
+ @ITCSS_DOC_DIR = 'itcssdoc'
25
+ @ITCSS_DOC_FILE = "#{@ITCSS_DOC_DIR}/index.html"
22
26
  @ITCSS_MODULES = ["requirements", "settings", "tools", "generic", "base", "objects", "components", "trumps"]
23
27
  @ITCSS_FILES = {
24
28
  "requirements" => "Vendor libraries",
@@ -31,7 +35,7 @@ module Itcsscli
31
35
  "trumps" => "Overrides and helper classes."
32
36
  }
33
37
 
34
- @ITCSS_COMMANDS = ['init', 'install', 'new', 'n', 'inuit', 'update', 'u', 'help', 'h', '-h', 'version', 'v', '-v']
38
+ @ITCSS_COMMANDS = ['init', 'install', 'new', 'n', 'inuit', 'update', 'u', 'doc', 'd', '-d', 'help', 'h', '-h', 'version', 'v', '-v']
35
39
 
36
40
  @ITCSS_COMMANDS_DESCRIPTION = [
37
41
  " COMMAND ALIAS FUNCTION ",
@@ -39,7 +43,8 @@ module Itcsscli
39
43
  "itcss install [filenames] | | Creates an example of ITCSS structure in path specified in #{@ITCSS_CONFIG_FILE}.",
40
44
  "itcss new [module] [filename] | n | Creates a new ITCSS module and automatically import it into imports file.",
41
45
  "itcss inuit new [inuit module] |inuit n| Add specified inuit module as an itcss dependency.",
42
- "itcss inuit help |inuit h| Add specified inuit module as an itcss dependency.",
46
+ "itcss inuit help |inuit h| Shows all available itcss inuit commands and it's functions.",
47
+ "itcss doc | d, -d | Generate and open itcssdoc.",
43
48
  "itcss update | u | Updates the imports file using the files inside ITCSS structure.",
44
49
  "itcss help | h, -h | Shows all available itcss commands and it's functions.",
45
50
  "itcss version | v, -v | Shows itcsscli gem version installed."
@@ -56,6 +61,7 @@ module Itcsscli
56
61
  if File.exist?(@ITCSS_CONFIG_FILE) && @ITCSS_CONFIG['package_manager']
57
62
  @ITCSS_PACKAGE_MANAGER ||= @ITCSS_CONFIG['package_manager']
58
63
  @INUIT_MODULES ||= @ITCSS_CONFIG['inuit_modules']
64
+ @INUIT_PREFIX ||= @ITCSS_CONFIG['inuit_prefix']
59
65
  else
60
66
  @ITCSS_PACKAGE_MANAGER = nil
61
67
  end
@@ -99,17 +105,19 @@ module Itcsscli
99
105
  elsif 'inuit' == ARGV[0]
100
106
  inuit_command_parser
101
107
 
102
-
103
108
  # $ itcss help
104
109
  elsif ['help', '-h', 'h'].include? ARGV[0]
105
110
  itcss_help
106
111
 
107
-
108
112
  # $ itcss version
109
113
  elsif ['version', '-v', 'v'].include? ARGV[0]
110
114
  itcss_version
111
- end
112
115
 
116
+ # $ itcss doc
117
+ elsif ['doc', '-d', 'd'].include? ARGV[0]
118
+ itcss_init_checker
119
+ initialize_doc
120
+ end
113
121
 
114
122
  # $ itcss update
115
123
  if ['install', 'new', 'n', 'update', 'u'].include? ARGV[0]
@@ -156,6 +164,7 @@ module Itcsscli
156
164
  end
157
165
 
158
166
  init_config['package_manager'] = user_package_manager
167
+ init_config['inuit_prefix'] = ''
159
168
  end
160
169
 
161
170
  File.open @ITCSS_CONFIG_TEMPLATE do |io|
@@ -193,7 +202,6 @@ module Itcsscli
193
202
 
194
203
  file_path = "#{@ITCSS_DIR}/#{type}/_#{type}.#{file}.sass"
195
204
  unless File.exist?(file_path)
196
- contents = "##{type}.#{file}"
197
205
  File.open file_path, "w+" do |out|
198
206
  out.puts template.result binding
199
207
  end
@@ -216,7 +224,7 @@ module Itcsscli
216
224
  end
217
225
 
218
226
  itcss_module_files = Dir[ File.join("#{@ITCSS_DIR}/#{current_module}/", '**', '*') ].reject { |p| File.directory? p }
219
- itcss_files_to_import[current_module] += itcss_module_files.map{|s| s.gsub("#{@ITCSS_DIR}/", '').gsub(".sass", '')}
227
+ itcss_files_to_import[current_module] += itcss_module_files.map{|s| s.gsub("#{@ITCSS_DIR}/", '').gsub(".sass", '').gsub("_", '')}
220
228
  end
221
229
 
222
230
  file_path = "#{@ITCSS_DIR}/#{@ITCSS_BASE_FILE}.sass"
@@ -372,9 +380,7 @@ module Itcsscli
372
380
  end
373
381
 
374
382
  def inuit_imports_path(filename)
375
- @ITCSS_PACKAGE_MANAGER == 'bower' ? package_manager_prefix = 'bower_components' : package_manager_prefix = 'node_modules'
376
- frags = filename.split(".")
377
- "#{package_manager_prefix}/inuit-#{frags[1]}/#{filename}"
383
+ "#{@INUIT_PREFIX}inuit-#{filename.split(".")[1]}/#{filename}"
378
384
  end
379
385
 
380
386
  end
@@ -0,0 +1 @@
1
+ <!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><title>ITCSSDoc</title></script></head><body><style><%= style %></style><script><%= javascript %></script><div class="container"><%= content %></div><div class="sidebar"><%= logo %><%= nav %></div><header><%= logo %></header></body></html>
@@ -1,3 +1,2 @@
1
- <%= "// " + "=" * 40 %>
2
- <%= "// " + contents %>
3
- <%= "// " + "=" * 40 %>
1
+ <%= "// @group #{type}" %>
2
+ <%= "// @name #{file}" %><%= type == "components" ? "\n\n.#{file}" : '' %>
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.12
4
+ version: 0.1.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kande Bonfim
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-08 00:00:00.000000000 Z
11
+ date: 2017-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -80,15 +80,23 @@ files:
80
80
  - LICENSE.txt
81
81
  - README.md
82
82
  - Rakefile
83
+ - assets/_syntax.sass
84
+ - assets/itcss.css
85
+ - assets/itcss.js
86
+ - assets/itcss.sass
87
+ - assets/logo_cli.svg
88
+ - assets/logo_doc.svg
83
89
  - bin/console
84
90
  - bin/itcss
85
91
  - bin/setup
86
92
  - data/inuit_modules.yml
87
93
  - itcsscli.gemspec
94
+ - lib/itcss_doc_parser.rb
88
95
  - lib/itcsscli.rb
89
96
  - lib/itcsscli/version.rb
90
97
  - templates/itcss_application.erb
91
98
  - templates/itcss_config.erb
99
+ - templates/itcss_doc.html.erb
92
100
  - templates/itcss_module.erb
93
101
  homepage: https://github.com/kandebonfim/itcsscli
94
102
  licenses: