schizm 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/schizm/env.rb +45 -19
- data/lib/schizm/env_colors.rb +113 -10
- data/lib/schizm/match.rb +1 -1
- data/lib/schizm/parse.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 912f268f9ae131e562a6c8924d7f857119e64e7b
|
4
|
+
data.tar.gz: d91c094e8be4531b2ae9073b4aa9e7aa733e63c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 41ee76e1913430f1c24f8bf1d743bb049e581bbf103bd569f3cbb15893e80930c6eb8bcfd19e5d2e671be6911ea71de5cb3d81b7eb9022824813027a74ef2e07
|
7
|
+
data.tar.gz: 9d11357023360994f51dff4345e2cfa9ee608f2404efec88e9891ce29d6700769852c84d63c7311c414d1f5b3547887d8e02974175cd34c50c7d64d27a2f8c44
|
data/lib/schizm/env.rb
CHANGED
@@ -1,18 +1,18 @@
|
|
1
1
|
# Copyright (c) 2017 M. Grady Saunders
|
2
|
-
#
|
2
|
+
#
|
3
3
|
# Redistribution and use in source and binary forms, with or without
|
4
4
|
# modification, are permitted provided that the following conditions
|
5
5
|
# are met:
|
6
|
-
#
|
6
|
+
#
|
7
7
|
# 1. Redistributions of source code must retain the above
|
8
8
|
# copyright notice, this list of conditions and the following
|
9
9
|
# disclaimer.
|
10
|
-
#
|
10
|
+
#
|
11
11
|
# 2. Redistributions in binary form must reproduce the above
|
12
12
|
# copyright notice, this list of conditions and the following
|
13
13
|
# disclaimer in the documentation and/or other materials
|
14
14
|
# provided with the distribution.
|
15
|
-
#
|
15
|
+
#
|
16
16
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
17
17
|
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
18
18
|
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
@@ -46,7 +46,7 @@ module Env
|
|
46
46
|
|
47
47
|
# +true+ if +@@var[key]+ is neither +nil+ nor +false+.
|
48
48
|
def self.var? key
|
49
|
-
return true if @@var.has_key?(key) and
|
49
|
+
return true if @@var.has_key?(key) and
|
50
50
|
@@var[key] != nil and @@var[key] != false
|
51
51
|
return false
|
52
52
|
end
|
@@ -64,8 +64,8 @@ module Env
|
|
64
64
|
# Write +string+ to +target+. If +target+ is an existing file and
|
65
65
|
# +var[:rewrite]+ is not set, prompts the user for permission to rewrite.
|
66
66
|
def self.write target, string
|
67
|
-
if (not File.file? target or
|
68
|
-
var? :rewrite or
|
67
|
+
if (not File.file? target or
|
68
|
+
var? :rewrite or
|
69
69
|
yes? "Rewrite '#{target}'?", "n")
|
70
70
|
puts "Writing '#{target}'" if var? :verbose
|
71
71
|
file = File.open target, "wb"
|
@@ -242,11 +242,11 @@ YAMLCONFIG
|
|
242
242
|
#{resource "scss/mixin.scss"}
|
243
243
|
#{resource "scss/style.scss"}
|
244
244
|
SASS
|
245
|
-
sass_options = {
|
245
|
+
sass_options = {
|
246
246
|
:syntax => :scss,
|
247
247
|
:sourcemap => :none,
|
248
248
|
:style => :nested,
|
249
|
-
:cache => false
|
249
|
+
:cache => false
|
250
250
|
}
|
251
251
|
write "docs/assets/css/schizm.css", Sass::Engine.new(sass_source, sass_options).render
|
252
252
|
end
|
@@ -301,7 +301,7 @@ SASS
|
|
301
301
|
where = path_from zrc_root, path
|
302
302
|
where = File.join doc_root, where.chomp(".zrc").concat(".html")
|
303
303
|
input = File.read path
|
304
|
-
Parse.hash[where] =
|
304
|
+
Parse.hash[where] =
|
305
305
|
Parse.page_elems where, input
|
306
306
|
end
|
307
307
|
unless Env.var? :only_src
|
@@ -364,26 +364,52 @@ PARSE
|
|
364
364
|
]
|
365
365
|
license_help = <<LIC
|
366
366
|
Select license, none by default.
|
367
|
-
|
368
|
-
\
|
369
|
-
\t"
|
370
|
-
\t"
|
371
|
-
\t"
|
372
|
-
\t"
|
373
|
-
\t"
|
374
|
-
\t"
|
367
|
+
|
368
|
+
\tENUM License
|
369
|
+
\t"BSD-2-Clause" .... the 2-clause BSD License
|
370
|
+
\t"BSD-3-Clause" .... the 3-clause BSD License
|
371
|
+
\t"GPL-2.0" ......... the GNU General Public License v2.0
|
372
|
+
\t"GPL-3.0" ......... the GNU General Public License v3.0
|
373
|
+
\t"LGPL-2.1" ........ the GNU Lesser General Public License v2.1
|
374
|
+
\t"LGPL-3.0" ........ the GNU Lesser General Public License v3.0
|
375
|
+
\t"MIT" ............. the MIT License
|
376
|
+
\t"MPL-2.0" ......... the Mozilla Public License v2.0
|
377
|
+
|
375
378
|
LIC
|
376
379
|
optparse.on "-l", "--license ENUM",
|
377
380
|
license_enum,
|
378
381
|
license_help do |str|
|
379
382
|
Env.var[:license] = str
|
380
383
|
end
|
384
|
+
color_help = <<COL
|
385
|
+
|
386
|
+
\tENUM Basic color
|
387
|
+
\t"red" ............. F4 43 36
|
388
|
+
\t"pink" ............ E9 1E 63
|
389
|
+
\t"purple" .......... 9C 27 B0 *** Default primary
|
390
|
+
\t"deep-purple" ..... 67 3A B7
|
391
|
+
\t"indigo" .......... 3F 51 B5
|
392
|
+
\t"blue" ............ 21 96 F3
|
393
|
+
\t"light-blue" ...... 03 A9 F4
|
394
|
+
\t"cyan" ............ 00 BC D4
|
395
|
+
\t"teal" ............ 00 96 88 *** Default secondary
|
396
|
+
\t"green" ........... 4C AF 50
|
397
|
+
\t"light-green" ..... 8B C3 4A
|
398
|
+
\t"lime" ............ CD DC 39
|
399
|
+
\t"yellow" .......... FF EB 3B
|
400
|
+
\t"amber" ........... FF C1 07
|
401
|
+
\t"orange" .......... FF 98 00
|
402
|
+
\t"deep-orange" ..... FF 57 22
|
403
|
+
|
404
|
+
\tRefer to https://material.io/guidelines/style/color.html
|
405
|
+
|
406
|
+
COL
|
381
407
|
optparse.on "-p", "--primary-color ENUM", Env::COLORS.keys,
|
382
408
|
"Specify primary color." do |str|
|
383
409
|
Env.var[:primary_color] = str
|
384
410
|
end
|
385
411
|
optparse.on "-s", "--secondary-color ENUM", Env::COLORS.keys,
|
386
|
-
"Specify secondary color." do |str|
|
412
|
+
"Specify secondary color.", color_help do |str|
|
387
413
|
Env.var[:secondary_color] = str
|
388
414
|
end
|
389
415
|
optparse.on_tail "-h", "--help", "Display this help." do
|
data/lib/schizm/env_colors.rb
CHANGED
@@ -175,18 +175,121 @@ module Env
|
|
175
175
|
'A400' => ['#1DE9B6', '#222222'],
|
176
176
|
'A700' => ['#00BFA5', '#222222']
|
177
177
|
},
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
178
|
+
'green' => {
|
179
|
+
'50' => ['#E8F5E9', '#222222'],
|
180
|
+
'100' => ['#C8E6C9', '#222222'],
|
181
|
+
'200' => ['#A5D6A7', '#222222'],
|
182
|
+
'300' => ['#81C784', '#222222'],
|
183
|
+
'400' => ['#66BB6A', '#222222'],
|
184
|
+
'500' => ['#4CAF50', '#222222'],
|
185
|
+
'600' => ['#43A047', '#EEEEEE'],
|
186
|
+
'700' => ['#388E3C', '#EEEEEE'],
|
187
|
+
'800' => ['#2E7D32', '#EEEEEE'],
|
188
|
+
'900' => ['#1B5E20', '#EEEEEE'],
|
189
|
+
'A100' => ['#B9F6CA', '#222222'],
|
190
|
+
'A200' => ['#69F0AE', '#222222'],
|
191
|
+
'A400' => ['#00E676', '#222222'],
|
192
|
+
'A700' => ['#00C853', '#222222']
|
193
|
+
},
|
194
|
+
'light-green' => {
|
195
|
+
'50' => ['#F1F8E9', '#222222'],
|
196
|
+
'100' => ['#DCEDC8', '#222222'],
|
197
|
+
'200' => ['#C5E1A5', '#222222'],
|
198
|
+
'300' => ['#AED581', '#222222'],
|
199
|
+
'400' => ['#9CCC65', '#222222'],
|
200
|
+
'500' => ['#8BC34A', '#222222'],
|
201
|
+
'600' => ['#7CB342', '#222222'],
|
202
|
+
'700' => ['#689F38', '#222222'],
|
203
|
+
'800' => ['#558B2F', '#EEEEEE'],
|
204
|
+
'900' => ['#33691E', '#EEEEEE'],
|
205
|
+
'A100' => ['#CCFF90', '#222222'],
|
206
|
+
'A200' => ['#B2FF59', '#222222'],
|
207
|
+
'A400' => ['#76FF03', '#222222'],
|
208
|
+
'A700' => ['#64DD17', '#222222']
|
209
|
+
},
|
210
|
+
'lime' => {
|
211
|
+
'50' => ['#F9FBE7', '#222222'],
|
212
|
+
'100' => ['#F0F4C3', '#222222'],
|
213
|
+
'200' => ['#E6EE9C', '#222222'],
|
214
|
+
'300' => ['#DCE775', '#222222'],
|
215
|
+
'400' => ['#D4E157', '#222222'],
|
216
|
+
'500' => ['#CDDC39', '#222222'],
|
217
|
+
'600' => ['#C0CA33', '#222222'],
|
218
|
+
'700' => ['#AFB42B', '#222222'],
|
219
|
+
'800' => ['#9E9D24', '#222222'],
|
220
|
+
'900' => ['#827717', '#EEEEEE'],
|
221
|
+
'A100' => ['#F4FF81', '#222222'],
|
222
|
+
'A200' => ['#EEFF41', '#222222'],
|
223
|
+
'A400' => ['#C6FF00', '#222222'],
|
224
|
+
'A700' => ['#AEEA00', '#222222']
|
225
|
+
},
|
226
|
+
'yellow' => {
|
227
|
+
'50' => ['#FFFDE7', '#222222'],
|
228
|
+
'100' => ['#FFF9C4', '#222222'],
|
229
|
+
'200' => ['#FFF59D', '#222222'],
|
230
|
+
'300' => ['#FFF176', '#222222'],
|
231
|
+
'400' => ['#FFEE58', '#222222'],
|
232
|
+
'500' => ['#FFEB3B', '#222222'],
|
233
|
+
'600' => ['#FDD835', '#222222'],
|
234
|
+
'700' => ['#FBC02D', '#222222'],
|
235
|
+
'800' => ['#F9A825', '#222222'],
|
236
|
+
'900' => ['#F57F17', '#222222'],
|
237
|
+
'A100' => ['#FFFF8D', '#222222'],
|
238
|
+
'A200' => ['#FFFF00', '#222222'],
|
239
|
+
'A400' => ['#FFEA00', '#222222'],
|
240
|
+
'A700' => ['#FFD600', '#222222']
|
241
|
+
},
|
242
|
+
'amber' => {
|
243
|
+
'50' => ['#FFF8E1', '#222222'],
|
244
|
+
'100' => ['#FFECB3', '#222222'],
|
245
|
+
'200' => ['#FFE082', '#222222'],
|
246
|
+
'300' => ['#FFD54F', '#222222'],
|
247
|
+
'400' => ['#FFCA28', '#222222'],
|
248
|
+
'500' => ['#FFC107', '#222222'],
|
249
|
+
'600' => ['#FFB300', '#222222'],
|
250
|
+
'700' => ['#FFA000', '#222222'],
|
251
|
+
'800' => ['#FF8F00', '#222222'],
|
252
|
+
'900' => ['#FF6F00', '#222222'],
|
253
|
+
'A100' => ['#FFE57F', '#222222'],
|
254
|
+
'A200' => ['#FFD740', '#222222'],
|
255
|
+
'A400' => ['#FFC400', '#222222'],
|
256
|
+
'A700' => ['#FFAB00', '#222222']
|
257
|
+
},
|
258
|
+
'orange' => {
|
259
|
+
'50' => ['#FFF3E0', '#222222'],
|
260
|
+
'100' => ['#FFE0B2', '#222222'],
|
261
|
+
'200' => ['#FFCC80', '#222222'],
|
262
|
+
'300' => ['#FFB74D', '#222222'],
|
263
|
+
'400' => ['#FFA726', '#222222'],
|
264
|
+
'500' => ['#FF9800', '#222222'],
|
265
|
+
'600' => ['#FB8C00', '#222222'],
|
266
|
+
'700' => ['#F57C00', '#222222'],
|
267
|
+
'800' => ['#EF6C00', '#222222'],
|
268
|
+
'900' => ['#E65100', '#EEEEEE'],
|
269
|
+
'A100' => ['#FFD180', '#222222'],
|
270
|
+
'A200' => ['#FFAB40', '#222222'],
|
271
|
+
'A400' => ['#FF9100', '#222222'],
|
272
|
+
'A700' => ['#FF6D00', '#222222']
|
273
|
+
},
|
274
|
+
'deep-orange' => {
|
275
|
+
'50' => ['#FBE9E7', '#222222'],
|
276
|
+
'100' => ['#FFCCBC', '#222222'],
|
277
|
+
'200' => ['#FFAB91', '#222222'],
|
278
|
+
'300' => ['#FF8A65', '#222222'],
|
279
|
+
'400' => ['#FF7043', '#222222'],
|
280
|
+
'500' => ['#FF5722', '#222222'],
|
281
|
+
'600' => ['#F4511E', '#EEEEEE'],
|
282
|
+
'700' => ['#E64A19', '#EEEEEE'],
|
283
|
+
'800' => ['#D84315', '#EEEEEE'],
|
284
|
+
'900' => ['#BF360C', '#EEEEEE'],
|
285
|
+
'A100' => ['#FF9E80', '#222222'],
|
286
|
+
'A200' => ['#FF6E40', '#222222'],
|
287
|
+
'A400' => ['#FF3D00', '#EEEEEE'],
|
288
|
+
'A700' => ['#DD2C00', '#EEEEEE']
|
289
|
+
}
|
188
290
|
}
|
189
291
|
|
292
|
+
# Create Sass-syntax color variables from +COLORS+.
|
190
293
|
def self.sass_colors color, var
|
191
294
|
colors = ""
|
192
295
|
COLORS[color].each do |key, val|
|
data/lib/schizm/match.rb
CHANGED
@@ -235,7 +235,7 @@ module Schizm
|
|
235
235
|
[/\|==>/u, 10503] # Right double arrow from bar.
|
236
236
|
]
|
237
237
|
|
238
|
-
|
238
|
+
HIGHLIGHT_CPP = [
|
239
239
|
["hi-comment", /\/\/.*$/u],
|
240
240
|
["hi-comment", /\/\*.*?\*\//um],
|
241
241
|
["hi-preproc", /\#(?:ifn?def|endif|if|else|elif|define|pragma|include)\b.*?(?<=[^\\])(?:\n|\z)/um],
|
data/lib/schizm/parse.rb
CHANGED
@@ -261,7 +261,7 @@ module Parse
|
|
261
261
|
]),
|
262
262
|
Markup.new("div")
|
263
263
|
.add_attrs("class" => "panel-body")
|
264
|
-
.add_elems(Markup.new("pre").add_elems(highlight(where, block,
|
264
|
+
.add_elems(Markup.new("pre").add_elems(highlight(where, block, HIGHLIGHT_CPP)))
|
265
265
|
])
|
266
266
|
end
|
267
267
|
div
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: schizm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- M. Grady Saunders
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-12-23 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: mgradysaunders@gmail.com
|