temml 0.31.0

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.
Files changed (30) hide show
  1. checksums.yaml +7 -0
  2. data/COPYING.txt +121 -0
  3. data/README.md +123 -0
  4. data/lib/temml/engine.rb +24 -0
  5. data/lib/temml/version.rb +8 -0
  6. data/lib/temml.rb +90 -0
  7. data/license/KaTeX/LICENSE +21 -0
  8. data/license/Temml/LICENSE +21 -0
  9. data/license/katex-ruby/LICENSE.txt +21 -0
  10. data/vendor/temml/fonts/Temml.woff2 +0 -0
  11. data/vendor/temml/javascripts/temml.js +1 -0
  12. data/vendor/temml/sprockets/stylesheets/Temml-Asana.css.erb +361 -0
  13. data/vendor/temml/sprockets/stylesheets/Temml-Latin-Modern.css.erb +379 -0
  14. data/vendor/temml/sprockets/stylesheets/Temml-Libertinus.css.erb +376 -0
  15. data/vendor/temml/sprockets/stylesheets/Temml-Local.css.erb +372 -0
  16. data/vendor/temml/sprockets/stylesheets/Temml-NotoSans.css.erb +376 -0
  17. data/vendor/temml/sprockets/stylesheets/Temml-STIX2.css.erb +367 -0
  18. data/vendor/temml/sprockets/stylesheets/_Temml-Asana.scss +361 -0
  19. data/vendor/temml/sprockets/stylesheets/_Temml-Latin-Modern.scss +379 -0
  20. data/vendor/temml/sprockets/stylesheets/_Temml-Libertinus.scss +376 -0
  21. data/vendor/temml/sprockets/stylesheets/_Temml-Local.scss +372 -0
  22. data/vendor/temml/sprockets/stylesheets/_Temml-NotoSans.scss +376 -0
  23. data/vendor/temml/sprockets/stylesheets/_Temml-STIX2.scss +367 -0
  24. data/vendor/temml/stylesheets/Temml-Asana.css +361 -0
  25. data/vendor/temml/stylesheets/Temml-Latin-Modern.css +379 -0
  26. data/vendor/temml/stylesheets/Temml-Libertinus.css +376 -0
  27. data/vendor/temml/stylesheets/Temml-Local.css +372 -0
  28. data/vendor/temml/stylesheets/Temml-NotoSans.css +376 -0
  29. data/vendor/temml/stylesheets/Temml-STIX2.css +367 -0
  30. metadata +84 -0
@@ -0,0 +1,367 @@
1
+ /*
2
+ XITS is released under the SIL Open Font License.
3
+ See https://github.com/stipub/stixfonts/blob/master/OFL.txt details.
4
+
5
+ The STIX2 WOFF font has been obtained from
6
+ https://github.com/stipub/stixfonts
7
+ */
8
+
9
+ @font-face {
10
+ font-family: STIX2;
11
+ src: local('STIXTwoMath'),
12
+ url('./STIXTwoMath.woff2');
13
+ }
14
+
15
+ math {
16
+ font-style: normal;
17
+ font-weight: normal;
18
+ line-height: normal;
19
+ font-size-adjust: none;
20
+ text-indent: 0;
21
+ text-transform: none;
22
+ letter-spacing: normal;
23
+ word-wrap: normal;
24
+ direction: ltr;
25
+ /* Prevent Firefox from omitting the dot on i or j. */
26
+ font-feature-settings: "dtls" off;
27
+ }
28
+
29
+ math * {
30
+ border-color: currentColor;
31
+ }
32
+
33
+ /* display: block is necessary in Firefox and Safari.
34
+ * Not in Chromium, which recognizes display: "block math" written inline. */
35
+ math.tml-display {
36
+ display: block;
37
+ width: 100%;
38
+ }
39
+
40
+ math {
41
+ font-family: STIX2, math;
42
+ }
43
+
44
+ *.mathscr {
45
+ font-feature-settings: 'ss01';
46
+ }
47
+
48
+ mo.tml-prime {
49
+ font-feature-settings: 'ss04';
50
+ }
51
+
52
+ /* Cramped superscripts in WebKit */
53
+ mfrac > :nth-child(2),
54
+ msqrt,
55
+ mover > :first-child {
56
+ math-shift: compact
57
+ }
58
+
59
+ .menclose {
60
+ display: inline-block;
61
+ position: relative;
62
+ padding: 0.5ex 0ex;
63
+ }
64
+ .tml-cancelto {
65
+ display: inline-block;
66
+ position: absolute;
67
+ top: 0;
68
+ left: 0;
69
+ padding: 0.5ex 0ex;
70
+ background-color: currentColor;
71
+ /* Use the SVG as an alpha mask (painted by background-color) */
72
+ -webkit-mask-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'><defs><marker id='a' markerHeight='5' markerUnits='strokeWidth' markerWidth='7' orient='auto' refX='7' refY='2.5'><path fill='black' d='m0 0 7 2.5L0 5z'/></marker></defs><line x2='100%25' y1='100%25' stroke='black' stroke-width='.06em' marker-end='url(%23a)' vector-effect='non-scaling-stroke'/></svg>");
73
+ mask-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'><defs><marker id='a' markerHeight='5' markerUnits='strokeWidth' markerWidth='7' orient='auto' refX='7' refY='2.5'><path fill='black' d='m0 0 7 2.5L0 5z'/></marker></defs><line x2='100%25' y1='100%25' stroke='black' stroke-width='.06em' marker-end='url(%23a)' vector-effect='non-scaling-stroke'/></svg>");
74
+ -webkit-mask-repeat: no-repeat;
75
+ mask-repeat: no-repeat;
76
+ -webkit-mask-size: 100% 100%;
77
+ mask-size: 100% 100%;
78
+ -webkit-mask-position: 0 0;
79
+ mask-position: 0 0;
80
+ }
81
+
82
+ @supports (-moz-appearance: none) {
83
+ /* \vec w/o italic correction for Firefox */
84
+ .tml-vec {
85
+ transform: scale(0.75)
86
+ }
87
+ /* Fix \cancelto in Firefox */
88
+ .ff-narrow {
89
+ width: 0em;
90
+ }
91
+ .ff-nudge-left {
92
+ margin-left: -0.2em;
93
+ }
94
+ /* Squash hidden mrows in \bordermatrix. Messes with centering, but necessary to squash. */
95
+ .ff-squash mtd {
96
+ display: block;
97
+ height: 0;
98
+ }
99
+ }
100
+
101
+ @supports (not (-moz-appearance: none)) {
102
+ /* Chromium and WebKit */
103
+ /* prime vertical alignment */
104
+ mo.tml-prime {
105
+ font-feature-settings: 'ss04';
106
+ }
107
+ /* Italic correction on superscripts */
108
+ .tml-sml-pad {
109
+ padding-left: 0.05em;
110
+ }
111
+ .tml-med-pad {
112
+ padding-left: 0.10em;
113
+ }
114
+ .tml-lrg-pad {
115
+ padding-left: 0.15em;
116
+ }
117
+ }
118
+
119
+ @supports (-webkit-backdrop-filter: blur(1px)) {
120
+ /* WebKit vertical & italic correction on accents */
121
+ .wbk-acc {
122
+ /* lower by x-height distance */
123
+ transform: translate(0em, 0.431em);
124
+ }
125
+ .wbk-sml {
126
+ transform: translate(0.07em, 0);
127
+ }
128
+ .wbk-sml-acc {
129
+ transform: translate(0.07em, 0.431em);
130
+ }
131
+ .wbk-sml-vec {
132
+ transform: scale(0.75) translate(0.07em, 0);
133
+ }
134
+ .wbk-med {
135
+ transform: translate(0.14em, 0);
136
+ }
137
+ .wbk-med-acc {
138
+ transform: translate(0.14em, 0.431em);
139
+ }
140
+ .wbk-med-vec {
141
+ transform: scale(0.75) translate(0.14em, 0);
142
+ }
143
+ .wbk-lrg {
144
+ transform: translate(0.21em, 0);
145
+ }
146
+ .wbk-lrg-acc {
147
+ transform: translate(0.21em, 0.431em);
148
+ }
149
+ .wbk-lrg-vec {
150
+ transform: scale(0.75) translate(0.21em, 0);
151
+ }
152
+ }
153
+
154
+ /* \cancel & \phase use background images. Get them to print. */
155
+ menclose {
156
+ -webkit-print-color-adjust: exact; /* Chrome & Edge */
157
+ print-color-adjust: exact;
158
+ }
159
+
160
+ /* Array cell justification in Firefox & WebKit */
161
+ .tml-right {
162
+ text-align: right;
163
+ }
164
+ .tml-left {
165
+ text-align: left;
166
+ }
167
+
168
+ /* For CD labels that grow to the left in Firefox and WebKit */
169
+ .tml-shift-left { margin-left:-200% }
170
+
171
+ /* Styles for Chromium only */
172
+ @supports (not (-webkit-backdrop-filter: blur(1px))) and (not (-moz-appearance: none)) {
173
+ /* Italic correction on accents */
174
+ .chr-sml {
175
+ transform: translate(0.07em, 0)
176
+ }
177
+ .chr-sml-vec {
178
+ transform: scale(0.75) translate(0.07em, 0)
179
+ }
180
+ .chr-med {
181
+ transform: translate(0.14em, 0)
182
+ }
183
+ .chr-med-vec {
184
+ transform: scale(0.75) translate(0.14em, 0)
185
+ }
186
+ .chr-lrg {
187
+ transform: translate(0.21em, 0)
188
+ }
189
+ .chr-lrg-vec {
190
+ transform: scale(0.75) translate(0.21em, 0)
191
+ }
192
+
193
+ /* For CD labels that grow to the left */
194
+ .tml-shift-left { margin-left:-100% }
195
+
196
+ /* MathML Core & Chromium do not support the MathML 3.0 element <menclose> attributes. */
197
+ /* So use styles. */
198
+ menclose {
199
+ position: relative;
200
+ padding: 0.5ex 0ex;
201
+ }
202
+
203
+ .tml-overline {
204
+ padding: 0.1em 0 0 0;
205
+ border-top: 0.065em solid;
206
+ }
207
+
208
+ .tml-underline {
209
+ padding: 0 0 0.1em 0;
210
+ border-bottom: 0.065em solid;
211
+ }
212
+
213
+ .tml-cancel {
214
+ display: inline-block;
215
+ position: absolute;
216
+ left: 0.5px;
217
+ bottom: 0;
218
+ width: 100%;
219
+ height: 100%;
220
+ background-color: currentColor;
221
+ }
222
+ .upstrike {
223
+ clip-path: polygon(0.05em 100%, 0em calc(100% - 0.05em), calc(100% - 0.05em) 0em, 100% 0.05em);
224
+ }
225
+ .downstrike {
226
+ clip-path: polygon(0em 0.05em, 0.05em 0em, 100% calc(100% - 0.05em), calc(100% - 0.05em) 100%);
227
+ }
228
+ .sout {
229
+ clip-path: polygon(0em calc(55% + 0.0333em), 0em calc(55% - 0.0333em), 100% calc(55% - 0.0333em), 100% calc(55% + 0.0333em));
230
+ }
231
+ .tml-xcancel {
232
+ clip-path: polygon(0.05em 0em, 0em 0.05em, calc(50% - 0.05em) 50%, 0em calc(100% - 0.05em), 0.05em 100%, 50% calc(50% + 0.05em), calc(100% - 0.05em) 100%, 100% calc(100% - 0.05em), calc(50% + 0.05em) 50%, 100% 0.05em, calc(100% - 0.05em) 0%, 50% calc(50% - 0.05em));
233
+ }
234
+
235
+ .longdiv-top {
236
+ border-top: 0.067em solid;
237
+ padding: 0.1em 0.2em 0.2em 0.433em;
238
+ }
239
+ .longdiv-arc {
240
+ position: absolute;
241
+ top: 0;
242
+ bottom: 0.1em;
243
+ left: -0.4em;
244
+ width: 0.7em;
245
+ border: 0.067em solid;
246
+ transform: translateY(-0.067em);
247
+ border-radius: 70%;
248
+ clip-path: inset(0 0 0 0.4em);
249
+ box-sizing: border-box;}
250
+ .menclose {display: inline-block;
251
+ text-align: left;
252
+ position: relative;
253
+ }
254
+
255
+ .phasor-bottom {
256
+ border-bottom: 0.067em solid;
257
+ padding: 0.2em 0.2em 0.1em 0.6em;
258
+ }
259
+ .phasor-angle {
260
+ display: inline-block;
261
+ position: absolute;
262
+ left: 0.5px;
263
+ bottom: -0.04em;
264
+ height: 100%;
265
+ aspect-ratio: 0.5;
266
+ background-color: currentColor;
267
+ clip-path: polygon(0.05em 100%, 0em calc(100% - 0.05em), calc(100% - 0.05em) 0em, 100% 0.05em);
268
+ }
269
+
270
+ .tml-fbox {
271
+ padding: 3pt;
272
+ border: 1px solid;
273
+ }
274
+
275
+ .circle-pad {
276
+ padding: 0.267em;
277
+ }
278
+ .textcircle {
279
+ position: absolute;
280
+ top: 0;
281
+ bottom: 0;
282
+ right: 0;
283
+ left: 0;
284
+ border: 0.067em solid;
285
+ border-radius: 50%;
286
+ }
287
+
288
+ .actuarial {
289
+ padding: 0.03889em 0.03889em 0 0.03889em;
290
+ border-width: 0.08em 0.08em 0em 0em;
291
+ border-style: solid;
292
+ margin-right: 0.03889em;
293
+ }
294
+
295
+ /* Stretch \widetilde */
296
+ .tml-tilde-2 {
297
+ transform: scale(2.0, 1.1)
298
+ }
299
+ .tml-tilde-3 {
300
+ transform: scale(3.0, 1.1)
301
+ }
302
+ .tml-tilde-4 {
303
+ transform: scale(4.0, 1.1)
304
+ }
305
+ /* Stretch \widehat */
306
+ .tml-hat-1 {
307
+ transform: scale(1.9, 1.0)
308
+ }
309
+ .tml-hat-2 {
310
+ transform: scale(3.9, 1.0)
311
+ }
312
+ .tml-hat-3 {
313
+ transform: scale(5.8, 1.1)
314
+ }
315
+ .tml-hat-4 {
316
+ transform: scale(7.8, 1.1)
317
+ }
318
+
319
+ /* set array cell justification */
320
+ .tml-right {
321
+ text-align: -webkit-right;
322
+ }
323
+ .tml-left {
324
+ text-align: -webkit-left;
325
+ }
326
+ }
327
+
328
+ /* flex-wrap for line-breaking in Chromium */
329
+ math {
330
+ display: inline-flex;
331
+ flex-wrap: wrap;
332
+ align-items: baseline;
333
+ }
334
+ math > mrow {
335
+ padding: 0.5ex 0ex;
336
+ }
337
+
338
+ /* Default mtd top padding is 0.5ex per MathML-Core and user-agent CSS */
339
+ /* We adjust for jot and small */
340
+ mtable.tml-jot > mtr > mtd {
341
+ padding-top: 0.7ex;
342
+ padding-bottom: 0.7ex;
343
+ }
344
+ mtable.tml-small mtd {
345
+ padding-top: 0.35ex;
346
+ padding-bottom: 0.35ex;
347
+ }
348
+
349
+ /* Firefox */
350
+ @-moz-document url-prefix() {
351
+ /* Avoid flex-wrap */
352
+ math { display: inline; }
353
+ math > mrow { padding: 0 }
354
+ /* Adjust Firefox spacing between array rows */
355
+ mtd, mtable.tml-small mtd { padding-top: 0; padding-bottom: 0; }
356
+ mtable.tml-jot > mtr > mtd { padding-top: 0.2ex; padding-bottom: 0.2ex; }
357
+ }
358
+
359
+ /* AMS environment auto-numbering via CSS counter. */
360
+ .tml-eqn::before {
361
+ counter-increment: tmlEqnNo;
362
+ content: "(" counter(tmlEqnNo) ")";
363
+ }
364
+
365
+ body {
366
+ counter-reset: tmlEqnNo;
367
+ }
metadata ADDED
@@ -0,0 +1,84 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: temml
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.31.0
5
+ platform: ruby
6
+ authors:
7
+ - sudotac
8
+ bindir: exe
9
+ cert_chain: []
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
+ dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: execjs
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - "~>"
17
+ - !ruby/object:Gem::Version
18
+ version: '2.7'
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - "~>"
24
+ - !ruby/object:Gem::Version
25
+ version: '2.7'
26
+ description: Exposes Temml server-side renderer to Ruby.
27
+ email:
28
+ - sudo@tofuyard.net
29
+ executables: []
30
+ extensions: []
31
+ extra_rdoc_files: []
32
+ files:
33
+ - COPYING.txt
34
+ - README.md
35
+ - lib/temml.rb
36
+ - lib/temml/engine.rb
37
+ - lib/temml/version.rb
38
+ - license/KaTeX/LICENSE
39
+ - license/Temml/LICENSE
40
+ - license/katex-ruby/LICENSE.txt
41
+ - vendor/temml/fonts/Temml.woff2
42
+ - vendor/temml/javascripts/temml.js
43
+ - vendor/temml/sprockets/stylesheets/Temml-Asana.css.erb
44
+ - vendor/temml/sprockets/stylesheets/Temml-Latin-Modern.css.erb
45
+ - vendor/temml/sprockets/stylesheets/Temml-Libertinus.css.erb
46
+ - vendor/temml/sprockets/stylesheets/Temml-Local.css.erb
47
+ - vendor/temml/sprockets/stylesheets/Temml-NotoSans.css.erb
48
+ - vendor/temml/sprockets/stylesheets/Temml-STIX2.css.erb
49
+ - vendor/temml/sprockets/stylesheets/_Temml-Asana.scss
50
+ - vendor/temml/sprockets/stylesheets/_Temml-Latin-Modern.scss
51
+ - vendor/temml/sprockets/stylesheets/_Temml-Libertinus.scss
52
+ - vendor/temml/sprockets/stylesheets/_Temml-Local.scss
53
+ - vendor/temml/sprockets/stylesheets/_Temml-NotoSans.scss
54
+ - vendor/temml/sprockets/stylesheets/_Temml-STIX2.scss
55
+ - vendor/temml/stylesheets/Temml-Asana.css
56
+ - vendor/temml/stylesheets/Temml-Latin-Modern.css
57
+ - vendor/temml/stylesheets/Temml-Libertinus.css
58
+ - vendor/temml/stylesheets/Temml-Local.css
59
+ - vendor/temml/stylesheets/Temml-NotoSans.css
60
+ - vendor/temml/stylesheets/Temml-STIX2.css
61
+ homepage: https://github.com/sudotac/temml-ruby
62
+ licenses:
63
+ - CC0-1.0
64
+ - MIT
65
+ metadata:
66
+ rubygems_mfa_required: 'true'
67
+ rdoc_options: []
68
+ require_paths:
69
+ - lib
70
+ required_ruby_version: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '3.3'
75
+ required_rubygems_version: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - ">="
78
+ - !ruby/object:Gem::Version
79
+ version: '0'
80
+ requirements: []
81
+ rubygems_version: 3.6.9
82
+ specification_version: 4
83
+ summary: Renders Temml from Ruby.
84
+ test_files: []