jekyll-mahjong 1.0.0 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/assets/tiles/1x.svg +40 -0
- data/lib/jekyll-mahjong-generator.rb +7 -6
- data/lib/jekyll-mahjong.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 104189463306d13dbd84878aa22eb2ee1aa954b4b8a6ea7cc39bba077a6f0f3b
|
4
|
+
data.tar.gz: 26325fbfdac24add2c5d5abd3f98fbc3f8f7f0a71444652a287bdaca98e699bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 80cceb7e7bf7f36d76b4f2b10eb65afe991010ee5ae6b75154f5ec01e29328d981b63410b13728bebea2f71500a961d47a50f096e53b87384f05a8554376185e
|
7
|
+
data.tar.gz: 1372517693431665aeefb214085aabcf1d411195e3502111be4ee654206e2a356181f14292126ee356d6245924c9a4204214d2c234a508fa612842072b4150e4
|
data/assets/tiles/1x.svg
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
2
|
+
<svg
|
3
|
+
id="glyph4"
|
4
|
+
version="1.1"
|
5
|
+
sodipodi:docname="1x.svg"
|
6
|
+
width="71.625771"
|
7
|
+
height="100.00001"
|
8
|
+
inkscape:version="1.3 (0e150ed6c4, 2023-07-21)"
|
9
|
+
xml:space="preserve"
|
10
|
+
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
11
|
+
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
12
|
+
xmlns="http://www.w3.org/2000/svg"
|
13
|
+
xmlns:svg="http://www.w3.org/2000/svg"><defs
|
14
|
+
id="defs3" /><sodipodi:namedview
|
15
|
+
id="namedview3"
|
16
|
+
pagecolor="#ffffff"
|
17
|
+
bordercolor="#000000"
|
18
|
+
borderopacity="0.25"
|
19
|
+
inkscape:showpageshadow="2"
|
20
|
+
inkscape:pageopacity="0.0"
|
21
|
+
inkscape:pagecheckerboard="0"
|
22
|
+
inkscape:deskcolor="#d1d1d1"
|
23
|
+
inkscape:zoom="2.7933333"
|
24
|
+
inkscape:cx="57.279237"
|
25
|
+
inkscape:cy="27.02864"
|
26
|
+
inkscape:window-width="1920"
|
27
|
+
inkscape:window-height="1009"
|
28
|
+
inkscape:window-x="-8"
|
29
|
+
inkscape:window-y="-8"
|
30
|
+
inkscape:window-maximized="1"
|
31
|
+
inkscape:current-layer="g3" /><g
|
32
|
+
transform="matrix(0,0.07668712,0.07668712,0,21.625768,0)"
|
33
|
+
id="g3"><path
|
34
|
+
fill="#ffffff"
|
35
|
+
d="M 1220,-234 H 1209 84 c -30,0 -36,17 -36,37 v 765 c 0,30 16,36 36,36 h 1135 c 30,0 37,-15 37,-35 v -767 c 0,-30 -16,-36 -36,-36 z"
|
36
|
+
id="path1"
|
37
|
+
style="fill:#f8a006;fill-opacity:1"
|
38
|
+
inkscape:label="path2" /><path
|
39
|
+
d="m 84,-282 c -55,0 -84,35 -84,85 v 765 c 0,55 34,84 84,84 h 1135 c 55,0 85,-35 85,-85 v -765 c 0,-55 -34,-84 -84,-84 z m 1136,48 c 20,0 36,6 36,36 v 767 c 0,20 -7,35 -37,35 H 84 c -20,0 -36,-6 -36,-36 v -765 c 0,-20 6,-37 36,-37 h 1125 z"
|
40
|
+
id="path3" /></g></svg>
|
@@ -17,14 +17,15 @@ module JekyllMahjong
|
|
17
17
|
svg_files.each do |svg_file|
|
18
18
|
file_basename = File.basename(svg_file)
|
19
19
|
file_source_path = File.join(target_source_directory, file_basename)
|
20
|
-
|
20
|
+
|
21
|
+
# only copy and mark for including if the files don't exist yet.
|
22
|
+
if !File.exist?(file_source_path)
|
21
23
|
FileUtils.cp(svg_file, file_source_path)
|
24
|
+
# IMPORTANT: mark to be included in the built _site
|
25
|
+
# lifesaver: https://stackoverflow.com/a/19890768/21452015
|
26
|
+
# documentation: https://www.rubydoc.info/gems/jekyll/Jekyll%2FStaticFile:initialize
|
27
|
+
site.static_files << Jekyll::StaticFile.new(site, site.source, relative_path, file_basename)
|
22
28
|
end
|
23
|
-
|
24
|
-
# ... and mark them to be included in the built _site
|
25
|
-
# lifesaver: https://stackoverflow.com/a/19890768/21452015
|
26
|
-
# documentation: https://www.rubydoc.info/gems/jekyll/Jekyll%2FStaticFile:initialize
|
27
|
-
site.static_files << Jekyll::StaticFile.new(site, site.source, relative_path, file_basename)
|
28
29
|
end
|
29
30
|
end
|
30
31
|
end
|
data/lib/jekyll-mahjong.rb
CHANGED
@@ -53,7 +53,7 @@ module JekyllMahjong
|
|
53
53
|
private
|
54
54
|
def svg_for_tile_group(tile_group)
|
55
55
|
# get the tile suit blocks: "12p78s45p" => ["12p", "78s", "45p"]
|
56
|
-
tile_suit_blocks = tile_group.scan(/\d+[
|
56
|
+
tile_suit_blocks = tile_group.scan(/\d+[mspzxMSPZX]/)
|
57
57
|
# ["123p", "789s"] => ["<img />", "<img />" ...]
|
58
58
|
svg_tiles = tile_suit_blocks.flat_map { |tile_suit_block| svg_for_tile_suit_block(tile_suit_block) }
|
59
59
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-mahjong
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Gao
|
@@ -12,7 +12,7 @@ date: 2023-08-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
13
13
|
description: '"jekyll-mahjong" is a Jekyll plugin that offers a "mahjong" tag that
|
14
14
|
will translate the text notation like "123p444s" into vector graphics of mahjong
|
15
|
-
tiles.'
|
15
|
+
tiles. For detailed documentation, please see here: https://peterish.com/riichi-docs/jekyll-mahjong-plugin/.'
|
16
16
|
email: peter1357908@hotmail.com
|
17
17
|
executables: []
|
18
18
|
extensions: []
|
@@ -24,6 +24,7 @@ files:
|
|
24
24
|
- assets/tiles/1m.svg
|
25
25
|
- assets/tiles/1p.svg
|
26
26
|
- assets/tiles/1s.svg
|
27
|
+
- assets/tiles/1x.svg
|
27
28
|
- assets/tiles/1z.svg
|
28
29
|
- assets/tiles/2m.svg
|
29
30
|
- assets/tiles/2p.svg
|
@@ -94,7 +95,7 @@ files:
|
|
94
95
|
- assets/tiles/c9s.svg
|
95
96
|
- lib/jekyll-mahjong-generator.rb
|
96
97
|
- lib/jekyll-mahjong.rb
|
97
|
-
homepage: https://peterish.com/
|
98
|
+
homepage: https://peterish.com/riichi-docs/jekyll-mahjong-plugin/
|
98
99
|
licenses:
|
99
100
|
- MIT
|
100
101
|
metadata:
|