style_guide 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (159) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +8 -0
  3. data/Gemfile +14 -0
  4. data/Gemfile.lock +92 -0
  5. data/MIT-LICENSE +20 -0
  6. data/README.md +91 -0
  7. data/Rakefile +34 -0
  8. data/app/assets/images/style_guide/.keep +0 -0
  9. data/app/assets/javascripts/style_guides.js +97 -0
  10. data/app/assets/javascripts/style_guides_plugins.js +31 -0
  11. data/app/assets/stylesheets/style.css +116 -0
  12. data/app/assets/stylesheets/style_guides.css +405 -0
  13. data/app/controllers/.keep +0 -0
  14. data/app/controllers/style_guide_controller.rb +16 -0
  15. data/app/helpers/.keep +0 -0
  16. data/app/helpers/style_guide_helper.rb +28 -0
  17. data/app/mailers/.keep +0 -0
  18. data/app/models/.keep +0 -0
  19. data/app/views/.keep +0 -0
  20. data/app/views/layouts/style_guide.html.erb +25 -0
  21. data/app/views/style_guide/index.html.erb +105 -0
  22. data/bin/rails +12 -0
  23. data/config/routes.rb +4 -0
  24. data/lib/assets/.keep +0 -0
  25. data/lib/assets/style_guide/doc/base/address.html +1 -0
  26. data/lib/assets/style_guide/doc/base/blockquote.html +1 -0
  27. data/lib/assets/style_guide/doc/base/details.html +1 -0
  28. data/lib/assets/style_guide/doc/base/figure.html +1 -0
  29. data/lib/assets/style_guide/doc/base/form-buttons.html +1 -0
  30. data/lib/assets/style_guide/doc/base/form-fields-default.html +1 -0
  31. data/lib/assets/style_guide/doc/base/form-fields-disabled.html +1 -0
  32. data/lib/assets/style_guide/doc/base/form-fields-readonly.html +1 -0
  33. data/lib/assets/style_guide/doc/base/form-fields-with-datalist.html +1 -0
  34. data/lib/assets/style_guide/doc/base/form-fieldset.html +1 -0
  35. data/lib/assets/style_guide/doc/base/headings-1.html +1 -0
  36. data/lib/assets/style_guide/doc/base/headings-2.html +1 -0
  37. data/lib/assets/style_guide/doc/base/headings-3.html +1 -0
  38. data/lib/assets/style_guide/doc/base/hr.html +1 -0
  39. data/lib/assets/style_guide/doc/base/list-definition.html +1 -0
  40. data/lib/assets/style_guide/doc/base/list-ordered.html +1 -0
  41. data/lib/assets/style_guide/doc/base/list-unordered.html +1 -0
  42. data/lib/assets/style_guide/doc/base/media.html +1 -0
  43. data/lib/assets/style_guide/doc/base/meter-and-progress.html +1 -0
  44. data/lib/assets/style_guide/doc/base/preformated-text.html +1 -0
  45. data/lib/assets/style_guide/doc/base/sample-content-block.html +1 -0
  46. data/lib/assets/style_guide/doc/base/tabular-data.html +1 -0
  47. data/lib/assets/style_guide/doc/base/text-elements.html +1 -0
  48. data/lib/assets/style_guide/doc/base/time.html +1 -0
  49. data/lib/assets/style_guide/doc/patterns/alerts.html +1 -0
  50. data/lib/assets/style_guide/doc/patterns/breadcrumbs.html +1 -0
  51. data/lib/assets/style_guide/markup/base/address.html +6 -0
  52. data/lib/assets/style_guide/markup/base/blockquote.html +5 -0
  53. data/lib/assets/style_guide/markup/base/details.html +30 -0
  54. data/lib/assets/style_guide/markup/base/figure.html +12 -0
  55. data/lib/assets/style_guide/markup/base/form-buttons.html +13 -0
  56. data/lib/assets/style_guide/markup/base/form-fields-default.html +41 -0
  57. data/lib/assets/style_guide/markup/base/form-fields-disabled.html +13 -0
  58. data/lib/assets/style_guide/markup/base/form-fields-readonly.html +9 -0
  59. data/lib/assets/style_guide/markup/base/form-fields-with-datalist.html +94 -0
  60. data/lib/assets/style_guide/markup/base/form-fieldset.html +19 -0
  61. data/lib/assets/style_guide/markup/base/headings-1.html +6 -0
  62. data/lib/assets/style_guide/markup/base/headings-2.html +8 -0
  63. data/lib/assets/style_guide/markup/base/headings-3.html +8 -0
  64. data/lib/assets/style_guide/markup/base/hr.html +1 -0
  65. data/lib/assets/style_guide/markup/base/list-definition.html +10 -0
  66. data/lib/assets/style_guide/markup/base/list-ordered.html +18 -0
  67. data/lib/assets/style_guide/markup/base/list-unordered.html +18 -0
  68. data/lib/assets/style_guide/markup/base/media.html +36 -0
  69. data/lib/assets/style_guide/markup/base/meter-and-progress.html +11 -0
  70. data/lib/assets/style_guide/markup/base/preformated-text.html +18 -0
  71. data/lib/assets/style_guide/markup/base/sample-content-block.html +17 -0
  72. data/lib/assets/style_guide/markup/base/tabular-data.html +68 -0
  73. data/lib/assets/style_guide/markup/base/text-elements.html +23 -0
  74. data/lib/assets/style_guide/markup/base/time.html +1 -0
  75. data/lib/assets/style_guide/markup/patterns/alerts.html +16 -0
  76. data/lib/assets/style_guide/markup/patterns/breadcrumbs.html +6 -0
  77. data/lib/style_guide/engine.rb +11 -0
  78. data/lib/style_guide/version.rb +3 -0
  79. data/lib/style_guide.rb +7 -0
  80. data/lib/tasks/style_guide_tasks.rake +4 -0
  81. data/style_guide.gemspec +26 -0
  82. data/test/controllers/style_guide_controller_test.rb +7 -0
  83. data/test/dummy/README.rdoc +28 -0
  84. data/test/dummy/Rakefile +6 -0
  85. data/test/dummy/app/assets/images/.keep +0 -0
  86. data/test/dummy/app/assets/javascripts/application.js +13 -0
  87. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  88. data/test/dummy/app/controllers/application_controller.rb +5 -0
  89. data/test/dummy/app/controllers/concerns/.keep +0 -0
  90. data/test/dummy/app/helpers/application_helper.rb +2 -0
  91. data/test/dummy/app/mailers/.keep +0 -0
  92. data/test/dummy/app/models/.keep +0 -0
  93. data/test/dummy/app/models/concerns/.keep +0 -0
  94. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  95. data/test/dummy/bin/bundle +3 -0
  96. data/test/dummy/bin/rails +4 -0
  97. data/test/dummy/bin/rake +4 -0
  98. data/test/dummy/config/application.rb +23 -0
  99. data/test/dummy/config/boot.rb +5 -0
  100. data/test/dummy/config/database.yml +25 -0
  101. data/test/dummy/config/environment.rb +5 -0
  102. data/test/dummy/config/environments/development.rb +37 -0
  103. data/test/dummy/config/environments/production.rb +82 -0
  104. data/test/dummy/config/environments/test.rb +39 -0
  105. data/test/dummy/config/initializers/assets.rb +8 -0
  106. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  107. data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
  108. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  109. data/test/dummy/config/initializers/inflections.rb +16 -0
  110. data/test/dummy/config/initializers/mime_types.rb +4 -0
  111. data/test/dummy/config/initializers/session_store.rb +3 -0
  112. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  113. data/test/dummy/config/locales/en.yml +23 -0
  114. data/test/dummy/config/routes.rb +56 -0
  115. data/test/dummy/config/secrets.yml +22 -0
  116. data/test/dummy/config.ru +4 -0
  117. data/test/dummy/db/development.sqlite3 +0 -0
  118. data/test/dummy/lib/assets/.keep +0 -0
  119. data/test/dummy/log/.keep +0 -0
  120. data/test/dummy/log/development.log +3212 -0
  121. data/test/dummy/public/404.html +67 -0
  122. data/test/dummy/public/422.html +67 -0
  123. data/test/dummy/public/500.html +66 -0
  124. data/test/dummy/public/favicon.ico +0 -0
  125. data/test/dummy/tmp/cache/assets/development/sprockets/004eafe024778b45bd76b68aaba4ac15 +0 -0
  126. data/test/dummy/tmp/cache/assets/development/sprockets/02b9d9c6edce2d06f23d37980b4ee800 +0 -0
  127. data/test/dummy/tmp/cache/assets/development/sprockets/077546dcfe9730fd178069bbd08aabcd +0 -0
  128. data/test/dummy/tmp/cache/assets/development/sprockets/12cfd2d3d39780df1fa5a909e8d44377 +0 -0
  129. data/test/dummy/tmp/cache/assets/development/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
  130. data/test/dummy/tmp/cache/assets/development/sprockets/146550a0272c7c23525da1a6bae7129c +0 -0
  131. data/test/dummy/tmp/cache/assets/development/sprockets/1a165ceceb0f8a97466552db5a2e9117 +0 -0
  132. data/test/dummy/tmp/cache/assets/development/sprockets/2cf006db500529f607744ffa0f89471c +0 -0
  133. data/test/dummy/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
  134. data/test/dummy/tmp/cache/assets/development/sprockets/32a1ac63db3780b8a111e5485be56982 +0 -0
  135. data/test/dummy/tmp/cache/assets/development/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
  136. data/test/dummy/tmp/cache/assets/development/sprockets/4e4e3e3a5771df9cae4d26bc6baf46c7 +0 -0
  137. data/test/dummy/tmp/cache/assets/development/sprockets/58173999e48afe09e8884356c79609f3 +0 -0
  138. data/test/dummy/tmp/cache/assets/development/sprockets/68e2d01c68da66c13b0d9e1476d859d6 +0 -0
  139. data/test/dummy/tmp/cache/assets/development/sprockets/7db7b6b32d1463ec5d4d358ad5e016cd +0 -0
  140. data/test/dummy/tmp/cache/assets/development/sprockets/81de5a8f8e9be0339dc42a8d3478ef61 +0 -0
  141. data/test/dummy/tmp/cache/assets/development/sprockets/8b14c1fcb69f343941b217e79224b573 +0 -0
  142. data/test/dummy/tmp/cache/assets/development/sprockets/a74b3d31d1ee9251adb48ec3f6b692db +0 -0
  143. data/test/dummy/tmp/cache/assets/development/sprockets/c080f0d6d4225e1a2e99b5f69ab934f8 +0 -0
  144. data/test/dummy/tmp/cache/assets/development/sprockets/c5ae04ae7418d8ea47212cf5f39ad45c +0 -0
  145. data/test/dummy/tmp/cache/assets/development/sprockets/cb475082e4e87eebe72cca39328e75fc +0 -0
  146. data/test/dummy/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
  147. data/test/dummy/tmp/cache/assets/development/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
  148. data/test/dummy/tmp/cache/assets/development/sprockets/e70c6cc21a053bd60db4b0b2751a3842 +0 -0
  149. data/test/dummy/tmp/cache/assets/development/sprockets/f13b97266d7293a648da96110bd0828d +0 -0
  150. data/test/dummy/tmp/cache/assets/development/sprockets/f39c3d50409be057fc18747ecf424bf0 +0 -0
  151. data/test/dummy/tmp/cache/assets/development/sprockets/f6d4686b27f2d3d964bf69c90a281e75 +0 -0
  152. data/test/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
  153. data/test/dummy/tmp/cache/assets/development/sprockets/faf31f12c745fa3dfaa9180a7f6fb546 +0 -0
  154. data/test/dummy/tmp/cache/assets/development/sprockets/fb37ec5c5023032c53cd43bed0105798 +0 -0
  155. data/test/helpers/style_guide_helper_test.rb +4 -0
  156. data/test/integration/navigation_test.rb +10 -0
  157. data/test/style_guide_test.rb +7 -0
  158. data/test/test_helper.rb +15 -0
  159. metadata +302 -0
@@ -0,0 +1,405 @@
1
+ // Place all the styles related to the StyleGuides controller here.
2
+ // They will automatically be included in application.css.
3
+ // You can use Sass (SCSS) here: http://sass-lang.com/
4
+
5
+ /* -------------------------------------------------------------------------
6
+
7
+ Style Guide Boilerplate v2.0.1
8
+ Repo: https://github.com/bjankord/Style-Guide-Boilerplate
9
+ Author: Brett Jankord
10
+ License: MIT
11
+
12
+ ---------------------------------------------------------------------------- */
13
+
14
+ /* -------------------------------------------------------------------------
15
+ Layout
16
+ ---------------------------------------------------------------------------- */
17
+ /* http:/paulirish.com/2012/box-sizing-border-box-ftw/ */
18
+ *, *:before, *:after {
19
+ -webkit-box-sizing: border-box;
20
+ -moz-box-sizing: border-box;
21
+ box-sizing: border-box;
22
+ }
23
+
24
+ body {margin: 0;}
25
+
26
+ .sg-header {
27
+ background: #000;
28
+ color: #fff;
29
+ zoom: 1; /* IE6 Fix */
30
+ }
31
+
32
+ @media screen and (max-width: 650px) {
33
+ .sg-header {
34
+ text-align: center;
35
+ }
36
+ }
37
+
38
+
39
+ .sg-info, .sg-base-styles {
40
+ padding-bottom: 24px; /* For older browsers */
41
+ padding-bottom: 2rem;
42
+ }
43
+
44
+
45
+ /* -------------------------------------------------------------------------
46
+ Utility Classes
47
+ ---------------------------------------------------------------------------- */
48
+ .sg-container {
49
+ overflow: hidden;
50
+ padding: 16px 24px; /* For older browsers */
51
+ padding: 1rem 1.5rem;
52
+ }
53
+
54
+ .sg-animated {
55
+ -webkit-transition: all 0.6s ease-out;
56
+ -moz-transition: all 0.6s ease-out;
57
+ -ms-transition: all 0.6s ease-out;
58
+ -o-transition: all 0.6s ease-out;
59
+ transition: all 0.6s ease-out;
60
+ }
61
+
62
+
63
+ /* -------------------------------------------------------------------------
64
+ Modules
65
+ ---------------------------------------------------------------------------- */
66
+
67
+ /* Branding
68
+ ---------------------------------------------------------------------------- */
69
+ .sg-logo {
70
+ float: left;
71
+ font-size: 1.5em;
72
+ font-weight: normal;
73
+ margin: 0;
74
+ padding: 0;
75
+ }
76
+
77
+ .sg-logo span {
78
+ font-weight: bold;
79
+ }
80
+
81
+ @media screen and (max-width: 650px) {
82
+ .sg-logo {
83
+ float: none;
84
+ padding-bottom: .5em;
85
+ text-align: center;
86
+ }
87
+ }
88
+
89
+ /* Navigation
90
+ ---------------------------------------------------------------------------- */
91
+ .sg-nav{
92
+ float: right;
93
+ }
94
+
95
+ .js .sg-submit-btn {
96
+ display: none;
97
+ }
98
+
99
+ .operamini .sg-nav {
100
+ display: none;
101
+ }
102
+
103
+ @media screen and (max-width: 650px) {
104
+ .sg-nav{
105
+ display: inline;
106
+ float: none;
107
+ }
108
+ }
109
+
110
+ /* Headings
111
+ ---------------------------------------------------------------------------- */
112
+ .sg-h1,
113
+ .sg-h2,
114
+ .sg-h3 {
115
+ font-family: sans-serif;
116
+ font-weight: normal;
117
+ margin-bottom: 1em;
118
+ margin-top: 0;
119
+ }
120
+
121
+ .sg-h1 {
122
+ font-size: 1.75em;
123
+ font-weight: bold;
124
+ padding-bottom: .2em;
125
+ }
126
+
127
+ .sg-h2 {
128
+ border-bottom: 2px solid #ddd;
129
+ font-size: 1.5em;
130
+ margin-bottom: .5em;
131
+ text-transform: capitalize;
132
+ }
133
+
134
+ .sg-h3 {
135
+ font-size: 1.2em;
136
+ }
137
+
138
+
139
+ /* Buttons
140
+ ---------------------------------------------------------------------------- */
141
+ .sg-btn {
142
+ background: #cbcbcb;
143
+ color: #222;
144
+ float: left;
145
+ padding: .5em .9em;
146
+ text-decoration: none;
147
+ }
148
+
149
+ .sg-btn--top {
150
+ float: right;
151
+ }
152
+
153
+ .sg-btn--select {
154
+ border-radius: 0 0.3em;
155
+ position: absolute;
156
+ right: 1px;
157
+ top: 14px;
158
+ }
159
+
160
+ .sg-btn--select.is-active:hover:after{
161
+ background:#111;
162
+ background:rgba(0,0,0,.8);
163
+ border-radius:5px;
164
+ top:45px;
165
+ color:#fff;
166
+ content:"Selected code ready to be copied";
167
+ font-size: .8em;
168
+ display:block;
169
+ right:5px;
170
+ padding:5px 15px;
171
+ position:absolute;
172
+ white-space:nowrap;
173
+ z-index:98
174
+ }
175
+
176
+ .sg-btn--select.is-active:hover:before{
177
+ border:solid;
178
+ border-color:#111 transparent;
179
+ border-width:0 6px 6px 6px;
180
+ top:40px;
181
+ content:"";
182
+ display:block;
183
+ left:75%;
184
+ position:absolute;
185
+ z-index:99
186
+ }
187
+
188
+ /* Hide specific buttons for use with JS */
189
+ .sg-btn--source,
190
+ .sg-btn--select {
191
+ display: none;
192
+ }
193
+
194
+ /* Show specific buttons if JS enabled */
195
+ .js .sg-btn--source,
196
+ .js .sg-btn--select {
197
+ display: block;
198
+ }
199
+
200
+ /* Hide specific buttons conditionally */
201
+ .operamini .sg-btn--source,
202
+ .legacy .sg-btn--source {
203
+ display: none;
204
+ }
205
+
206
+
207
+ /* Sections
208
+ ---------------------------------------------------------------------------- */
209
+ .sg-section {
210
+ margin-bottom: 32px; /* For older browsers */
211
+ margin-bottom: 3rem;
212
+ overflow: hidden;
213
+ }
214
+
215
+ .sg-anchor {
216
+ display: block;
217
+ padding-top: 1em;
218
+ }
219
+
220
+
221
+ /* Colors
222
+ ---------------------------------------------------------------------------- */
223
+ .sg-color {
224
+ background: #fff;
225
+ border: 1px solid #bbb;
226
+ display: inline-block;
227
+ height: 89px;
228
+ margin: 0 .5em .5em 0;
229
+ padding: 5px;
230
+ position: relative;
231
+ width: 89px;
232
+ }
233
+
234
+ .sg-color-swatch {
235
+ display: block;
236
+ height: 100%;
237
+ position: relative;
238
+ width: 100%;
239
+ }
240
+
241
+ .sg-color-swatch span {
242
+ background: #000;
243
+ background: rgba(0,0,0,.7);
244
+ bottom: 0;
245
+ color: #fff;
246
+ font-size: .8em;
247
+ margin: 0;
248
+ opacity: 0;
249
+ padding: 5px 0;
250
+ position: absolute;
251
+ text-align: center;
252
+ text-transform: uppercase;
253
+ width: 100%;
254
+ }
255
+
256
+ .sg-color-swatch:hover span {
257
+ opacity: 1;
258
+ }
259
+
260
+
261
+ /* Fonts
262
+ ---------------------------------------------------------------------------- */
263
+ .sg-font {
264
+ font-size: 1.4em;
265
+ padding: 0 0 .2em 0;
266
+ }
267
+
268
+
269
+ /* Markup
270
+ ---------------------------------------------------------------------------- */
271
+ .sg-markup {}
272
+
273
+ .sg-doc {
274
+ border-bottom: 1px solid #ddd;
275
+ margin-bottom: 1em;
276
+ }
277
+
278
+ .sg-markup-controls {
279
+ overflow: hidden;
280
+ padding-top: 1.5em;
281
+ }
282
+
283
+ .sg-source {
284
+ position: relative;
285
+ }
286
+
287
+ .sg-source pre {
288
+ background: #333;
289
+ border-radius: .5em;
290
+ border: 1px solid #ddd;
291
+ color: #fff;
292
+ overflow-x: scroll;
293
+ padding: .5em .3em;
294
+ }
295
+
296
+ .sg-source pre code {
297
+ background: transparent;
298
+ }
299
+
300
+ .js .sg-source {
301
+ max-height: 0;
302
+ overflow: hidden;
303
+ }
304
+
305
+ .js .sg-source.is-active,
306
+ .operamini .sg-source,
307
+ .legacy .sg-source {
308
+ max-height: 2400px;
309
+ }
310
+
311
+
312
+ /* -------------------------------------------------------------------------
313
+ Prettyprint
314
+ ---------------------------------------------------------------------------- */
315
+ .pln {color: #fff} /* plain text */
316
+
317
+ @media screen {
318
+ .str,
319
+ .string {color: #E6DB74;} /* string content */
320
+
321
+ .kwd,
322
+ .keyword {color: #66D9EF;} /* a keyword */
323
+
324
+ .com,
325
+ .comment {color: #75715E;} /* a comment */
326
+
327
+ .typ {color: #A6E22E;} /* a type name */
328
+
329
+ .lit,
330
+ .number {color: #AE81FF;} /* a literal value */
331
+
332
+ /* punctuation, lisp open bracket, lisp close bracket */
333
+ /* .pun, .opn, .clo { color: #660 } */
334
+
335
+ .tag {color: #F92672;} /* a markup tag name */
336
+
337
+ .atn {color: #A6E22E;} /* a markup attribute name */
338
+
339
+ .atv {color: #E6DB74;} /* a markup attribute value */
340
+
341
+ /*.dec, .var { color: #606 }*/ /* a declaration; a variable name */
342
+
343
+ .fun {color: #FF0000;} /* a function name */
344
+ }
345
+
346
+ /* Use higher contrast and text-weight for printable form. */
347
+ @media print, projection {
348
+ .str {color: #060}
349
+
350
+ .kwd {color: #006; font-weight: bold }
351
+
352
+ .com {color: #600; font-style: italic }
353
+
354
+ .typ {color: #404; font-weight: bold }
355
+
356
+ .lit {color: #044}
357
+
358
+ .pun,
359
+ .opn,
360
+
361
+ .clo {color: #440}
362
+
363
+ .tag {color: #006; font-weight: bold }
364
+
365
+ .atn {color: #404}
366
+
367
+ .atv {color: #060}
368
+ }
369
+
370
+ /* Specify class=linenums on a pre to get line numbering */
371
+ ol.linenums {
372
+ border-left:1px solid #444;
373
+ margin: 0 0 0 3.3em; /* IE indents via margin-left */
374
+ padding: 0;
375
+ }
376
+
377
+ ol.linenums li {
378
+ color: #bebec5;
379
+ line-height: 1.5;
380
+ padding-left: .8em;
381
+ }
382
+
383
+
384
+ /* -------------------------------------------------------------------------
385
+ Legacy IE
386
+ ---------------------------------------------------------------------------- */
387
+ /**
388
+ * IE 7 Fixes
389
+ */
390
+ .sg-color {
391
+ *display: inline;
392
+ zoom: 1;
393
+ }
394
+ /* End IE 7 Fixes */
395
+
396
+
397
+ /**
398
+ * IE 6 Fixes
399
+ */
400
+ pre{
401
+ _white-space: pre;
402
+ _white-space: pre-wrap;
403
+ _word-wrap: break-word;
404
+ }
405
+ /* End IE 6 Fixes */
File without changes
@@ -0,0 +1,16 @@
1
+ class StyleGuideController < ApplicationController
2
+ layout 'style_guide.html.erb'
3
+ include StyleGuideHelper
4
+
5
+ def index
6
+ @basefiles = []
7
+ @patternfiles = []
8
+ Dir.foreach(StyleGuide::Engine.instance.root.join("lib/assets/style_guide/markup/base")) do |file|
9
+ @basefiles << file if File.extname("#{file}") == ".html"
10
+ end
11
+ Dir.foreach(StyleGuide::Engine.instance.root.join("lib/assets/style_guide/markup/patterns")) do |file|
12
+ @patternfiles << file if File.extname("#{file}") == ".html"
13
+ end
14
+ end
15
+ end
16
+
data/app/helpers/.keep ADDED
File without changes
@@ -0,0 +1,28 @@
1
+ module StyleGuideHelper
2
+ def filename file
3
+ filename = file.sub(".html","")
4
+ filename
5
+ end
6
+
7
+ def title file
8
+ filename = file.sub(".html","")
9
+ title = filename.gsub(/\-/i, " ")
10
+ title
11
+ end
12
+
13
+ def base_docs file
14
+ File.read(StyleGuide::Engine.instance.root.join("lib/assets/style_guide/doc/base/#{file}"))
15
+ end
16
+
17
+ def base_markup file
18
+ File.read(StyleGuide::Engine.instance.root.join("lib/assets/style_guide/markup/base/#{file}"))
19
+ end
20
+
21
+ def pattern_docs file
22
+ File.read(StyleGuide::Engine.instance.root.join("lib/assets/style_guide/doc/patterns/#{file}"))
23
+ end
24
+
25
+ def pattern_markup file
26
+ File.read(StyleGuide::Engine.instance.root.join("lib/assets/style_guide/markup/patterns/#{file}"))
27
+ end
28
+ end
data/app/mailers/.keep ADDED
File without changes
data/app/models/.keep ADDED
File without changes
data/app/views/.keep ADDED
File without changes
@@ -0,0 +1,25 @@
1
+ <!DOCTYPE html>
2
+ <head>
3
+ <meta charset="utf-8">
4
+ <title>Style Guide Boilerplate</title>
5
+ <meta name="viewport" content="width=device-width">
6
+
7
+
8
+ <!-- Style Guide Boilerplate Styles And Scripts -->
9
+ <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
10
+ <%= stylesheet_link_tag 'style_guides', media: 'all', 'data-turbolinks-track' => true %>
11
+
12
+ <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
13
+
14
+ <!-- Replace below stylesheet with your own stylesheet -->
15
+ <%= stylesheet_link_tag 'style', media: 'all', 'data-turbolinks-track' => true %>
16
+ </head>
17
+ <body>
18
+
19
+ <%= yield %>
20
+
21
+ </body>
22
+ <%= javascript_include_tag 'style_guides_plugins', 'data-turbolinks-track' => true %>
23
+ <%= javascript_include_tag 'style_guides', 'data-turbolinks-track' => true %>
24
+ </html>
25
+
@@ -0,0 +1,105 @@
1
+ <div id="top" class="sg-header sg-container">
2
+ <h1 class="sg-logo">STYLE GUIDE <span>BOILERPLATE</span></h1>
3
+ <!-- <form id="js-sg-nav" action="" method="post" class="sg-nav">
4
+ <select id="js-sg-section-switcher" class="sg-section-switcher" name="sg_section_switcher">
5
+ <option value="">Jump To Section:</option>
6
+ <optgroup label="Intro">
7
+ <option value="#sg-about">About</option>
8
+ <option value="#sg-colors">Colors</option>
9
+ <option value="#sg-fontStacks">Font-Stacks</option>
10
+ </optgroup>
11
+ <optgroup label="Base Styles">
12
+ <%= @basefiles.each do |file| %>
13
+ <option value="#<%=filename(file) %>"><%= filename(file)%></option>
14
+ <% end %>
15
+ </optgroup>
16
+ <optgroup label="Pattern Styles">
17
+ <%= @patternfiles.each do |file| %>
18
+ <option value="#<%=filename(file) %>"><%=filename(file) %></option>
19
+ <% end %>
20
+ </optgroup>
21
+ </select>
22
+ <input type="hidden" name="sg_uri" value= "">
23
+ <button type="submit" class="sg-submit-btn">Go</button>
24
+ </form><!--/.sg-nav--> -->
25
+ </div><!--/.sg-header-->
26
+
27
+ <div class="sg-body sg-container">
28
+ <div class="sg-info">
29
+ <div class="sg-about sg-section">
30
+ <h2 class="sg-h2"><a id="sg-about" class="sg-anchor">About</a></h2>
31
+ <p>Comments and documentation about your style guide. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Necessitatibus nobis enim labore facilis consequuntur! Veritatis neque est suscipit tenetur temporibus enim consequatur deserunt perferendis. Neque nemo iusto minima deserunt amet.</p>
32
+ </div><!--/.sg-about-->
33
+
34
+ <div class="sg-colors sg-section">
35
+ <h2 class="sg-h2"><a id="sg-colors" class="sg-anchor">Colors</a></h2>
36
+ <div class="sg-color sg-color--a"><span class="sg-color-swatch"><span class="sg-animated">#88ffda</span></span></div>
37
+ <div class="sg-color sg-color--b"><span class="sg-color-swatch"><span class="sg-animated">#4dd3c9</span></span></div>
38
+ <div class="sg-color sg-color--c"><span class="sg-color-swatch"><span class="sg-animated">#339db0</span></span></div>
39
+ <div class="sg-color sg-color--d"><span class="sg-color-swatch"><span class="sg-animated">#2078aa</span></span></div>
40
+ <div class="sg-color sg-color--e"><span class="sg-color-swatch"><span class="sg-animated">#3a517a</span></span></div>
41
+ <div class="sg-color sg-color--f"><span class="sg-color-swatch"><span class="sg-animated">#384355</span></span></div>
42
+ <div class="sg-markup-controls"><a class="sg-btn--top" href="#top">Back to Top</a></div>
43
+ </div><!--/.sg-colors-->
44
+
45
+ <div class="sg-font-stacks sg-section">
46
+ <h2 class="sg-h2"><a id="sg-fontStacks" class="sg-anchor">Font Stacks</a></h2>
47
+ <p class="sg-font sg-font-primary">"HelveticaNeue", "Helvetica", Arial, sans-serif;</p>
48
+ <p class="sg-font sg-font-secondary">Georgia, Times, "Times New Roman", serif;</p>
49
+ <div class="sg-markup-controls"><a class="sg-btn--top" href="#top">Back to Top</a></div>
50
+ </div><!--/.sg-font-stacks-->
51
+ </div><!--/.sg-info-->
52
+
53
+ <div class="sg-base-styles">
54
+ <h1 class="sg-h1">Base Styles</h1>
55
+ <% @basefiles.each do |element| %>
56
+ <div class="sg-markup sg-section">
57
+ <div class="sg-display">
58
+ <h2 class="sg-h2"><a id="sg-<%= filename(element) %>." class="sg-anchor"><%= title(element) %></a></h2>
59
+ <% unless base_docs(element).empty?%>
60
+ <div class="sg-doc">
61
+ <h3 class="sg-h3">Usage</h3>
62
+ <%= base_docs(element).html_safe%>
63
+ </div>
64
+ <% end %>
65
+ <h3 class="sg-h3">Example</h3>
66
+ <%= base_markup(element).html_safe%>
67
+ </div>
68
+ <div class="sg-markup-controls"><a class="sg-btn sg-btn--source" href="#">View Source</a> <a class="sg-btn--top" href="#top">Back to Top</a> </div>
69
+ <div class="sg-source sg-animated">
70
+ <a class="sg-btn sg-btn--select" href="#">Copy Source</a>
71
+ <pre class="prettyprint linenums"><code>
72
+ <%= base_markup(element) %>
73
+ </code></pre>
74
+ </div>
75
+ </div>
76
+ <% end %>
77
+ </div><!--/.sg-base-styles-->
78
+
79
+ <div class="sg-pattern-styles">
80
+ <h1 class="sg-h1">Pattern Styles<small> - Design and mark-up patterns unique to your site.</small></h1>
81
+ <% @patternfiles.each do |element| %>
82
+ <div class="sg-markup sg-section">
83
+ <div class="sg-display">
84
+ <h2 class="sg-h2"><a id="sg-<%= filename(element) %>." class="sg-anchor"><%= title(element) %></a></h2>
85
+ <% unless pattern_docs(element).empty?%>
86
+ <div class="sg-doc">
87
+ <h3 class="sg-h3">Usage</h3>
88
+ <%= pattern_docs(element).html_safe%>
89
+ </div>
90
+ <% end %>
91
+ <h3 class="sg-h3">Example</h3>
92
+ <%= pattern_markup(element).html_safe%>
93
+ </div>
94
+ <div class="sg-markup-controls"><a class="sg-btn sg-btn--source" href="#">View Source</a> <a class="sg-btn--top" href="#top">Back to Top</a> </div>
95
+ <div class="sg-source sg-animated">
96
+ <a class="sg-btn sg-btn--select" href="#">Copy Source</a>
97
+ <pre class="prettyprint linenums"><code>
98
+ <%= pattern_markup(element) %>
99
+ </code></pre>
100
+ </div>
101
+ </div>
102
+ <% end %>
103
+ </div><!--/.sg-pattern-styles-->
104
+ </div><!--/.sg-body-->
105
+
data/bin/rails ADDED
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env ruby
2
+ # This command will automatically be run when you run "rails" with Rails 4 gems installed from the root of your application.
3
+
4
+ ENGINE_ROOT = File.expand_path('../..', __FILE__)
5
+ ENGINE_PATH = File.expand_path('../../lib/style_guide/engine', __FILE__)
6
+
7
+ # Set up gems listed in the Gemfile.
8
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
9
+ require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
10
+
11
+ require 'rails/all'
12
+ require 'rails/engine/commands'
data/config/routes.rb ADDED
@@ -0,0 +1,4 @@
1
+ Rails.application.routes.draw do
2
+ get '/style_guide', to: 'style_guide#index'
3
+
4
+ end
data/lib/assets/.keep ADDED
File without changes
@@ -0,0 +1 @@
1
+ <p>Add your personalized documentation here.</p>
@@ -0,0 +1 @@
1
+ <p>Add your personalized documentation here.</p>
@@ -0,0 +1 @@
1
+ <p>Add your personalized documentation here.</p>
@@ -0,0 +1 @@
1
+ <p>Add your personalized documentation here.</p>
@@ -0,0 +1 @@
1
+ <p>Add your personalized documentation here.</p>
@@ -0,0 +1 @@
1
+ <p>Add your personalized documentation here.</p>
@@ -0,0 +1 @@
1
+ <p>Add your personalized documentation here.</p>
@@ -0,0 +1 @@
1
+ <p>Add your personalized documentation here.</p>
@@ -0,0 +1 @@
1
+ <p>Add your personalized documentation here.</p>
@@ -0,0 +1 @@
1
+ <p>Add your personalized documentation here.</p>
@@ -0,0 +1 @@
1
+ <p>Add your personalized documentation here.</p>
@@ -0,0 +1 @@
1
+ <p>Add your personalized documentation here.</p>
@@ -0,0 +1 @@
1
+ <p>Add your personalized documentation here.</p>
@@ -0,0 +1 @@
1
+ <p>Add your personalized documentation here.</p>
@@ -0,0 +1 @@
1
+ <p>Add your personalized documentation here.</p>
@@ -0,0 +1 @@
1
+ <p>Add your personalized documentation here.</p>
@@ -0,0 +1 @@
1
+ <p>Add your personalized documentation here.</p>
@@ -0,0 +1 @@
1
+ <p>Add your personalized documentation here.</p>
@@ -0,0 +1 @@
1
+ <p>Add your personalized documentation here.</p>
@@ -0,0 +1 @@
1
+ <p>Add your personalized documentation here.</p>
@@ -0,0 +1 @@
1
+ <p>Add your personalized documentation here.</p>