k_builder 0.0.70 → 0.0.71
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 +4 -4
- data/lib/k_builder/version.rb +1 -1
- metadata +1 -6
- data/assets/a.html +0 -235
- data/assets/b.html +0 -109
- data/assets/highlight.min.js +0 -1120
- data/assets/highlight_css +0 -1
- data/assets/ruby.min.js +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 608a406238f03125011e9fcf3e09eda00ec82f973ae2a2cafe99119e712b0693
|
4
|
+
data.tar.gz: 563cc5eb0c7e5aa0cadbbba6b9ad2008339ac4e758bb842b6b17a059e7d46bbd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f10c8c559770b885062ac07fa321bfffec918cf09765c1febf287221e3252edbc21e7837d6a9547b57571cc47a5f4cdd487a2c68944e7a1b02d43a7e7d30e109
|
7
|
+
data.tar.gz: 76d9c0bbcdb2d6163f4258e138c724489cab7b313c9bd0ce5ba7792ef47a6049f345b5118c5e6d397c460c3f21f8250dd625a884bab835ebf611655721d496fb
|
data/lib/k_builder/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: k_builder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.71
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Cruwys
|
@@ -103,11 +103,6 @@ files:
|
|
103
103
|
- Sample.drawio
|
104
104
|
- Sample.xml
|
105
105
|
- USAGE.md
|
106
|
-
- assets/a.html
|
107
|
-
- assets/b.html
|
108
|
-
- assets/highlight.min.js
|
109
|
-
- assets/highlight_css
|
110
|
-
- assets/ruby.min.js
|
111
106
|
- bin/console
|
112
107
|
- bin/k
|
113
108
|
- bin/kgitsync
|
data/assets/a.html
DELETED
@@ -1,235 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html lang="en">
|
3
|
-
<head>
|
4
|
-
<meta charset="UTF-8">
|
5
|
-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
7
|
-
<title>David</title>
|
8
|
-
<script src="highlight.min.js"></script>
|
9
|
-
<!-- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.0.1/styles/default.min.css"> -->
|
10
|
-
<script src="https://cdn.jsdelivr.net/npm/html2canvas@1.0.0-rc.5/dist/html2canvas.min.js"></script>
|
11
|
-
<script src="//cdn.jsdelivr.net/gh/TRSasasusu/highlightjs-highlight-lines.js@1.1.6/highlightjs-highlight-lines.min.js"></script>
|
12
|
-
<script src="//cdn.jsdelivr.net/npm/highlightjs-line-numbers.js@2.8.0/dist/highlightjs-line-numbers.min.js"></script>
|
13
|
-
|
14
|
-
<link rel="stylesheet" href="highlight_css/a11y-light.css">
|
15
|
-
|
16
|
-
<style>
|
17
|
-
pre > code {
|
18
|
-
font-family: "Sans Mono", "Consolas", "Courier", monospace;
|
19
|
-
}
|
20
|
-
|
21
|
-
|
22
|
-
/*
|
23
|
-
color: white; */
|
24
|
-
|
25
|
-
.animated-box {
|
26
|
-
font-family: 'Lato';
|
27
|
-
color: #ffffff;
|
28
|
-
padding: 30px;
|
29
|
-
text-align: center;
|
30
|
-
border-radius: 4px;
|
31
|
-
}
|
32
|
-
|
33
|
-
.animated-box {
|
34
|
-
position: relative;
|
35
|
-
}
|
36
|
-
|
37
|
-
.animated-box:after {
|
38
|
-
content: '';
|
39
|
-
position: absolute;
|
40
|
-
top: 0;
|
41
|
-
left: 0;
|
42
|
-
right: 0;
|
43
|
-
bottom: 0;
|
44
|
-
border-radius: 4px;
|
45
|
-
background: linear-gradient(120deg, #00F260, #0575E6, #00F260);
|
46
|
-
background-size: 300% 300%;
|
47
|
-
clip-path: polygon(0% 100%, 3px 100%, 3px 3px, calc(100% - 3px) 3px, calc(100% - 3px) calc(100% - 3px), 3px calc(100% - 3px), 3px 100%, 100% 100%, 100% 0%, 0% 0%);
|
48
|
-
}
|
49
|
-
|
50
|
-
.animated-box.in:after {
|
51
|
-
animation: frame-enter 1s forwards ease-in-out reverse, gradient-animation 4s ease-in-out infinite;
|
52
|
-
}
|
53
|
-
|
54
|
-
#box {
|
55
|
-
position: absolute;
|
56
|
-
top: 170px;
|
57
|
-
left: 70px;
|
58
|
-
width: 600px;
|
59
|
-
height: 465px;
|
60
|
-
display: flex;
|
61
|
-
align-items: center;
|
62
|
-
justify-content: center;
|
63
|
-
color: white;
|
64
|
-
font-family: 'Raleway';
|
65
|
-
font-size: 2.5rem;
|
66
|
-
/* background-color: rgba(255,255,225,0); */
|
67
|
-
}
|
68
|
-
|
69
|
-
.with-linear-gradient {
|
70
|
-
--borderWidth: 13px;
|
71
|
-
background: transparent;
|
72
|
-
position: relative;
|
73
|
-
border-radius: var(--borderWidth);
|
74
|
-
}
|
75
|
-
.with-linear-gradient:after {
|
76
|
-
content: '';
|
77
|
-
position: absolute;
|
78
|
-
top: calc(-1 * var(--borderWidth));
|
79
|
-
left: calc(-1 * var(--borderWidth));
|
80
|
-
height: calc(100% + var(--borderWidth) * 2);
|
81
|
-
width: calc(100% + var(--borderWidth) * 2);
|
82
|
-
border-radius: calc(2 * var(--borderWidth));
|
83
|
-
background: linear-gradient(60deg, #f79533, #f37055, #ef4e7b, #a166ab, #5073b8);
|
84
|
-
z-index: -1;
|
85
|
-
animation: animatedgradient 3s ease alternate infinite;
|
86
|
-
background-size: 300% 300%;
|
87
|
-
}
|
88
|
-
.animated-box {
|
89
|
-
position: relative;
|
90
|
-
}
|
91
|
-
|
92
|
-
.animated-box:after {
|
93
|
-
content: '';
|
94
|
-
position: absolute;
|
95
|
-
top: 0;
|
96
|
-
left: 0;
|
97
|
-
right: 0;
|
98
|
-
bottom: 0;
|
99
|
-
border-radius: 4px;
|
100
|
-
background: linear-gradient(120deg, #00F260, #0575E6, #00F260);
|
101
|
-
background-size: 300% 300%;
|
102
|
-
clip-path: polygon(0% 100%, 3px 100%, 3px 3px, calc(100% - 3px) 3px, calc(100% - 3px) calc(100% - 3px), 3px calc(100% - 3px), 3px 100%, 100% 100%, 100% 0%, 0% 0%);
|
103
|
-
}
|
104
|
-
|
105
|
-
.animated-box.in:after {
|
106
|
-
animation: frame-enter 1s forwards ease-in-out reverse, gradient-animation 4s ease-in-out infinite;
|
107
|
-
}
|
108
|
-
|
109
|
-
|
110
|
-
@keyframes animatedgradient {
|
111
|
-
0% {
|
112
|
-
background-position: 0% 50%;
|
113
|
-
}
|
114
|
-
50% {
|
115
|
-
background-position: 100% 50%;
|
116
|
-
}
|
117
|
-
100% {
|
118
|
-
background-position: 0% 50%;
|
119
|
-
}
|
120
|
-
}
|
121
|
-
|
122
|
-
*/
|
123
|
-
/* for block of numbers */
|
124
|
-
.hljs-ln-numbers {
|
125
|
-
-webkit-touch-callout: none;
|
126
|
-
-webkit-user-select: none;
|
127
|
-
-khtml-user-select: none;
|
128
|
-
-moz-user-select: none;
|
129
|
-
-ms-user-select: none;
|
130
|
-
user-select: none;
|
131
|
-
|
132
|
-
text-align: center;
|
133
|
-
color: #ccc;
|
134
|
-
border-right: 1px solid #CCC;
|
135
|
-
vertical-align: top;
|
136
|
-
padding-right: 5px;
|
137
|
-
|
138
|
-
/* your custom style here */
|
139
|
-
}
|
140
|
-
|
141
|
-
/* for block of code */
|
142
|
-
.hljs-ln-code {
|
143
|
-
padding-left: 100px;
|
144
|
-
}
|
145
|
-
|
146
|
-
.borderexample {
|
147
|
-
border-style:solid;
|
148
|
-
border-color:#287EC7;
|
149
|
-
}
|
150
|
-
</style>
|
151
|
-
</head>
|
152
|
-
<body>
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
<div id="myBlock">
|
157
|
-
<pre><code class="ruby">
|
158
|
-
# frozen_string_literal: true
|
159
|
-
|
160
|
-
module KBuilder
|
161
|
-
module Commands
|
162
|
-
# Base command for single responsibility actions that can be fired
|
163
|
-
# from methods in the builder.
|
164
|
-
#
|
165
|
-
# Uses the command pattern
|
166
|
-
class BaseCommand
|
167
|
-
include KLog::Logging
|
168
|
-
|
169
|
-
attr_accessor :builder
|
170
|
-
attr_accessor :valid
|
171
|
-
|
172
|
-
def initialize(**opts)
|
173
|
-
@builder = opts[:builder]
|
174
|
-
@valid = true
|
175
|
-
end
|
176
|
-
|
177
|
-
def guard(message)
|
178
|
-
# THIS SHOULD ONLY LOG IF DEBUGGING IS TURNED ON
|
179
|
-
log.error(message)
|
180
|
-
@valid = false
|
181
|
-
end
|
182
|
-
|
183
|
-
def valid?
|
184
|
-
@valid
|
185
|
-
end
|
186
|
-
|
187
|
-
def debug(title: nil)
|
188
|
-
log.section_heading(title) if title
|
189
|
-
debug_values if respond_to?(:debug_values)
|
190
|
-
end
|
191
|
-
end
|
192
|
-
end
|
193
|
-
end
|
194
|
-
</code></pre>
|
195
|
-
are go
|
196
|
-
<a id='x' href="" download="name.jpg"></a>
|
197
|
-
|
198
|
-
<div id='box' class='animated-box in' xclass="with-linear-gradient">
|
199
|
-
|
200
|
-
</div>
|
201
|
-
</body>
|
202
|
-
<script>hljs.highlightAll();</script>
|
203
|
-
|
204
|
-
<button onclick="takeshot()">
|
205
|
-
Take Screenshot
|
206
|
-
</button>
|
207
|
-
|
208
|
-
<div id="output"></div>
|
209
|
-
|
210
|
-
<script>
|
211
|
-
|
212
|
-
const screenshotTarget = document.getElementById('myBlock');
|
213
|
-
|
214
|
-
let div = document.getElementById('myBlock');
|
215
|
-
|
216
|
-
setTimeout(function(){
|
217
|
-
|
218
|
-
html2canvas(div).then(
|
219
|
-
function (canvas) {
|
220
|
-
document
|
221
|
-
.getElementById('output')
|
222
|
-
.appendChild(canvas);
|
223
|
-
});
|
224
|
-
|
225
|
-
}, 1000);
|
226
|
-
|
227
|
-
hljs.initHighlightingOnLoad();
|
228
|
-
hljs.initLineNumbersOnLoad();
|
229
|
-
hljs.initHighlightLinesOnLoad([
|
230
|
-
[{start: 1, end: 3, color: '#555'}, {start: 6, end: 6, color: 'yellow'},], // Highlight some lines in the first code block.
|
231
|
-
[{start: 2, end: 3, color: 'rgba(255, 255, 255, 0.2)'},], // Highlight some lines in the second code block.
|
232
|
-
]);
|
233
|
-
|
234
|
-
</script>
|
235
|
-
</html>
|
data/assets/b.html
DELETED
@@ -1,109 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>
|
5
|
-
How to take screenshot of
|
6
|
-
a div using JavaScript?
|
7
|
-
</title>
|
8
|
-
<script src="highlight.min.js"></script>
|
9
|
-
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.0.1/styles/default.min.css">
|
10
|
-
<script src="https://cdn.jsdelivr.net/npm/html2canvas@1.0.0-rc.5/dist/html2canvas.min.js"></script>
|
11
|
-
|
12
|
-
<!-- Include from the CDN -->
|
13
|
-
<script src=
|
14
|
-
"https://cdn.jsdelivr.net/npm/html2canvas@1.0.0-rc.5/dist/html2canvas.min.js">
|
15
|
-
</script>
|
16
|
-
|
17
|
-
<!-- Include locally otherwise -->
|
18
|
-
<!-- <script src='html2canvas.js'></script> -->
|
19
|
-
|
20
|
-
<style>
|
21
|
-
#photo {
|
22
|
-
border: 4px solid green;
|
23
|
-
padding: 4px;
|
24
|
-
}
|
25
|
-
</style>
|
26
|
-
</head>
|
27
|
-
|
28
|
-
<body>
|
29
|
-
<div id="photo">
|
30
|
-
<h1>GeeksforGeeks</h1>
|
31
|
-
Hello everyone! This is a
|
32
|
-
trial page for taking a
|
33
|
-
screenshot.
|
34
|
-
<br><br>
|
35
|
-
This is a dummy button!
|
36
|
-
<button> Dummy</button>
|
37
|
-
<br><br>
|
38
|
-
Click the button below to
|
39
|
-
take a screenshot of the div.
|
40
|
-
<br><br>
|
41
|
-
|
42
|
-
<!-- Define the button
|
43
|
-
that will be used to
|
44
|
-
take the screenshot -->
|
45
|
-
<button onclick="takeshot()">
|
46
|
-
Take Screenshot
|
47
|
-
</button>
|
48
|
-
</div>
|
49
|
-
<h1>Screenshot:</h1>
|
50
|
-
<div id="myBlock">
|
51
|
-
<pre><code class="ruby">
|
52
|
-
# frozen_string_literal: true
|
53
|
-
|
54
|
-
module KBuilder
|
55
|
-
module Commands
|
56
|
-
# Base command for single responsibility actions that can be fired
|
57
|
-
# from methods in the builder.
|
58
|
-
#
|
59
|
-
# Uses the command pattern
|
60
|
-
class BaseCommand
|
61
|
-
include KLog::Logging
|
62
|
-
|
63
|
-
attr_accessor :builder
|
64
|
-
attr_accessor :valid
|
65
|
-
|
66
|
-
def initialize(**opts)
|
67
|
-
@builder = opts[:builder]
|
68
|
-
@valid = true
|
69
|
-
end
|
70
|
-
|
71
|
-
def guard(message)
|
72
|
-
# THIS SHOULD ONLY LOG IF DEBUGGING IS TURNED ON
|
73
|
-
log.error(message)
|
74
|
-
@valid = false
|
75
|
-
end
|
76
|
-
|
77
|
-
def valid?
|
78
|
-
@valid
|
79
|
-
end
|
80
|
-
|
81
|
-
def debug(title: nil)
|
82
|
-
log.section_heading(title) if title
|
83
|
-
debug_values if respond_to?(:debug_values)
|
84
|
-
end
|
85
|
-
end
|
86
|
-
end
|
87
|
-
end
|
88
|
-
</code></pre>
|
89
|
-
|
90
|
-
<div id="output"></div>
|
91
|
-
|
92
|
-
<script type="text/javascript">
|
93
|
-
|
94
|
-
// Define the function
|
95
|
-
// to screenshot the div
|
96
|
-
function takeshot() {
|
97
|
-
let div = document.getElementById('myBlock');
|
98
|
-
html2canvas(div).then(
|
99
|
-
function (canvas) {
|
100
|
-
document
|
101
|
-
.getElementById('output')
|
102
|
-
.appendChild(canvas);
|
103
|
-
})
|
104
|
-
}
|
105
|
-
</script>
|
106
|
-
</body>
|
107
|
-
<script>hljs.highlightAll();</script>
|
108
|
-
|
109
|
-
</html>
|