mint 0.7.3 → 0.8.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 (71) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +23 -14
  3. data/LICENSE +22 -0
  4. data/README.md +82 -56
  5. data/bin/mint +47 -10
  6. data/bin/mint-epub +1 -4
  7. data/config/templates/base/style.css +187 -0
  8. data/config/templates/default/css/style.css +126 -79
  9. data/config/templates/default/layout.erb +10 -0
  10. data/config/templates/default/style.css +237 -0
  11. data/config/templates/garden/layout.erb +38 -0
  12. data/config/templates/garden/style.css +303 -0
  13. data/config/templates/newspaper/layout.erb +16 -0
  14. data/config/templates/nord/layout.erb +11 -0
  15. data/config/templates/nord/style.css +339 -0
  16. data/config/templates/nord-dark/layout.erb +11 -0
  17. data/config/templates/nord-dark/style.css +339 -0
  18. data/config/templates/protocol/layout.erb +9 -0
  19. data/config/templates/protocol/style.css +25 -0
  20. data/config/templates/zen/layout.erb +11 -0
  21. data/config/templates/zen/style.css +114 -0
  22. data/lib/mint/command_line.rb +253 -111
  23. data/lib/mint/css.rb +11 -4
  24. data/lib/mint/css_template.rb +37 -0
  25. data/lib/mint/document.rb +193 -43
  26. data/lib/mint/helpers.rb +50 -10
  27. data/lib/mint/layout.rb +2 -3
  28. data/lib/mint/markdown_template.rb +47 -0
  29. data/lib/mint/mint.rb +181 -114
  30. data/lib/mint/plugin.rb +3 -3
  31. data/lib/mint/plugins/epub.rb +1 -2
  32. data/lib/mint/resource.rb +19 -9
  33. data/lib/mint/style.rb +10 -14
  34. data/lib/mint/version.rb +1 -1
  35. data/lib/mint.rb +1 -0
  36. data/man/mint.1 +135 -0
  37. data/spec/cli/README.md +99 -0
  38. data/spec/cli/argument_parsing_spec.rb +207 -0
  39. data/spec/cli/bin_integration_spec.rb +348 -0
  40. data/spec/cli/configuration_management_spec.rb +363 -0
  41. data/spec/cli/full_workflow_integration_spec.rb +527 -0
  42. data/spec/cli/publish_workflow_spec.rb +368 -0
  43. data/spec/cli/template_management_spec.rb +300 -0
  44. data/spec/css_spec.rb +1 -1
  45. data/spec/document_spec.rb +105 -68
  46. data/spec/helpers_spec.rb +42 -42
  47. data/spec/mint_spec.rb +104 -80
  48. data/spec/plugin_spec.rb +86 -88
  49. data/spec/run_cli_tests.rb +95 -0
  50. data/spec/spec_helper.rb +8 -1
  51. data/spec/style_spec.rb +18 -16
  52. data/spec/support/cli_helpers.rb +169 -0
  53. data/spec/support/fixtures/content-2.md +16 -0
  54. data/spec/support/matchers.rb +1 -1
  55. metadata +145 -167
  56. data/config/syntax.yaml +0 -71
  57. data/config/templates/base/style.sass +0 -144
  58. data/config/templates/default/layout.haml +0 -8
  59. data/config/templates/default/style.sass +0 -36
  60. data/config/templates/protocol/layout.haml +0 -7
  61. data/config/templates/protocol/style.sass +0 -20
  62. data/config/templates/zen/css/style.css +0 -145
  63. data/config/templates/zen/layout.haml +0 -7
  64. data/config/templates/zen/style.sass +0 -24
  65. data/features/config.feature +0 -21
  66. data/features/plugins/epub.feature +0 -23
  67. data/features/publish.feature +0 -73
  68. data/features/support/env.rb +0 -15
  69. data/features/templates.feature +0 -79
  70. data/spec/command_line_spec.rb +0 -87
  71. data/spec/plugins/epub_spec.rb +0 -242
@@ -0,0 +1,339 @@
1
+ @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');
2
+
3
+ :root {
4
+ --screen-font-size: 16px;
5
+ --screen-line-height: calc(var(--screen-font-size) * 1.5);
6
+ --screen-unit: var(--screen-line-height);
7
+
8
+ --print-font-size: 11pt;
9
+ --print-line-height: 16pt;
10
+ --print-unit: var(--print-line-height);
11
+
12
+ /* Nord color scheme - dark theme */
13
+ --nord0: #2e3440; /* Polar Night - darkest */
14
+ --nord1: #3b4252; /* Polar Night */
15
+ --nord2: #434c5e; /* Polar Night */
16
+ --nord3: #4c566a; /* Polar Night - lightest */
17
+ --nord4: #d8dee9; /* Snow Storm - darkest */
18
+ --nord5: #e5e9f0; /* Snow Storm */
19
+ --nord6: #eceff4; /* Snow Storm - lightest */
20
+ --nord7: #8fbcbb; /* Frost - teal */
21
+ --nord8: #88c0d0; /* Frost - light blue */
22
+ --nord9: #81a1c1; /* Frost - blue */
23
+ --nord10: #5e81ac; /* Frost - dark blue */
24
+ --nord11: #bf616a; /* Aurora - red */
25
+ --nord12: #d08770; /* Aurora - orange */
26
+ --nord13: #ebcb8b; /* Aurora - yellow */
27
+ --nord14: #a3be8c; /* Aurora - green */
28
+ --nord15: #b48ead; /* Aurora - purple */
29
+
30
+ --nord-text: var(--nord6);
31
+ --nord-text-subtle: var(--nord4);
32
+ --nord-background: var(--nord0);
33
+ --nord-surface: var(--nord1);
34
+ --nord-border: var(--nord3);
35
+ --nord-accent: var(--nord8);
36
+ --nord-secondary: var(--nord7);
37
+ }
38
+
39
+ @import "../base/style.css";
40
+
41
+ body {
42
+ font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
43
+ color: var(--nord-text);
44
+ line-height: 1.5;
45
+ background-color: var(--nord-background);
46
+ font-weight: 400;
47
+ letter-spacing: -0.005em;
48
+ font-feature-settings: "liga" 1, "kern" 1;
49
+ }
50
+
51
+ h1, h2, h3, h4, h5, h6 {
52
+ font-weight: 600;
53
+ color: var(--nord-text);
54
+ letter-spacing: -0.02em;
55
+ }
56
+
57
+ h1 {
58
+ font-size: calc(var(--screen-font-size) * 1.8);
59
+ margin-top: calc(var(--screen-unit) * 2);
60
+ margin-bottom: calc(var(--screen-unit) * 1.5);
61
+ line-height: 1.3;
62
+ color: var(--nord6);
63
+ }
64
+
65
+ h2 {
66
+ font-size: calc(var(--screen-font-size) * 1.4);
67
+ margin-top: calc(var(--screen-unit) * 1.5);
68
+ margin-bottom: calc(var(--screen-unit) * 0.75);
69
+ line-height: 1.4;
70
+ color: var(--nord5);
71
+ }
72
+
73
+ h3 {
74
+ font-size: calc(var(--screen-font-size) * 1.2);
75
+ margin-top: calc(var(--screen-unit) * 1.25);
76
+ margin-bottom: calc(var(--screen-unit) * 0.5);
77
+ line-height: 1.4;
78
+ color: var(--nord4);
79
+ }
80
+
81
+ h4, h5, h6 {
82
+ font-size: calc(var(--screen-font-size) * 1.05);
83
+ margin-top: calc(var(--screen-unit) * 1);
84
+ margin-bottom: calc(var(--screen-unit) * 0.25);
85
+ line-height: 1.4;
86
+ color: var(--nord4);
87
+ }
88
+
89
+ p {
90
+ margin: calc(var(--screen-unit) * 0.75) 0;
91
+ }
92
+
93
+ blockquote {
94
+ border-left: 3px solid var(--nord8);
95
+ padding-left: calc(var(--screen-unit) * 1);
96
+ margin-left: 0;
97
+ font-style: italic;
98
+ color: var(--nord-text-subtle);
99
+ background-color: rgba(59, 66, 82, 0.3);
100
+ padding: calc(var(--screen-unit) * 0.75) calc(var(--screen-unit) * 1);
101
+ border-radius: 0 4px 4px 0;
102
+ }
103
+
104
+ code {
105
+ font-family: "SF Mono", "JetBrains Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, monospace;
106
+ font-size: calc(var(--screen-font-size) * 0.9);
107
+ background-color: var(--nord2);
108
+ color: var(--nord6);
109
+ padding: 0.15em 0.4em;
110
+ border-radius: 4px;
111
+ font-weight: 500;
112
+ letter-spacing: 0;
113
+ }
114
+
115
+ pre {
116
+ background-color: var(--nord1);
117
+ border: 1px solid var(--nord-border);
118
+ border-radius: 8px;
119
+ padding: calc(var(--screen-unit) * 1);
120
+ overflow-x: auto;
121
+ margin: calc(var(--screen-unit) * 1) 0;
122
+ }
123
+
124
+ pre code {
125
+ background-color: transparent;
126
+ padding: 0;
127
+ border-radius: 0;
128
+ font-size: calc(var(--screen-font-size) * 0.85);
129
+ color: var(--nord6);
130
+ }
131
+
132
+ a:link, a:visited {
133
+ color: var(--nord-accent);
134
+ text-decoration: none;
135
+ border-bottom: 1px solid transparent;
136
+ transition: all 0.2s ease;
137
+ }
138
+
139
+ a:hover {
140
+ color: var(--nord7);
141
+ border-bottom-color: var(--nord7);
142
+ }
143
+
144
+ strong {
145
+ font-weight: 600;
146
+ color: var(--nord6);
147
+ }
148
+
149
+ em {
150
+ font-style: italic;
151
+ color: var(--nord5);
152
+ }
153
+
154
+ ul, ol {
155
+ margin: calc(var(--screen-unit) * 0.75) 0;
156
+ padding-left: calc(var(--screen-unit) * 1.5);
157
+ }
158
+
159
+ li {
160
+ margin: calc(var(--screen-unit) * 0.25) 0;
161
+ }
162
+
163
+ table {
164
+ border-collapse: collapse;
165
+ margin: calc(var(--screen-unit) * 1) 0;
166
+ width: 100%;
167
+ background-color: var(--nord-surface);
168
+ border-radius: 6px;
169
+ overflow: hidden;
170
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
171
+ }
172
+
173
+ th, td {
174
+ padding: calc(var(--screen-unit) * 0.5) calc(var(--screen-unit) * 0.75);
175
+ text-align: left;
176
+ border-bottom: 1px solid var(--nord-border);
177
+ }
178
+
179
+ th {
180
+ background-color: var(--nord2);
181
+ font-weight: 600;
182
+ color: var(--nord6);
183
+ font-size: calc(var(--screen-font-size) * 0.9);
184
+ text-transform: uppercase;
185
+ letter-spacing: 0.05em;
186
+ }
187
+
188
+ tr:last-child td {
189
+ border-bottom: none;
190
+ }
191
+
192
+ tr:hover {
193
+ background-color: rgba(76, 86, 106, 0.2);
194
+ }
195
+
196
+ hr {
197
+ border: none;
198
+ height: 1px;
199
+ background-color: var(--nord-border);
200
+ margin: calc(var(--screen-unit) * 2) 0;
201
+ }
202
+
203
+ #container {
204
+ max-width: 90ch;
205
+ margin: calc(var(--screen-unit) * 3) auto;
206
+ padding: calc(var(--screen-unit) * 3) calc(var(--screen-unit) * 4);
207
+ border: 1px solid var(--nord-border);
208
+ background-color: var(--nord-surface);
209
+ box-shadow:
210
+ 0 4px 6px rgba(0, 0, 0, 0.2),
211
+ 0 10px 20px rgba(0, 0, 0, 0.3);
212
+ border-radius: 8px;
213
+ }
214
+
215
+ @media (max-width: 768px) {
216
+ #container {
217
+ margin: calc(var(--screen-unit) * 1) calc(var(--screen-unit) * 0.5);
218
+ padding: calc(var(--screen-unit) * 2) calc(var(--screen-unit) * 2);
219
+ border-radius: 0;
220
+ box-shadow: none;
221
+ border: none;
222
+ }
223
+ }
224
+
225
+ @media print {
226
+ @page {
227
+ margin: 1in;
228
+ size: letter;
229
+ }
230
+
231
+ :root {
232
+ --print-font-size: 11pt;
233
+ --print-line-height: 16pt;
234
+ --screen-font-size: var(--print-font-size);
235
+ --screen-line-height: var(--print-line-height);
236
+ --screen-unit: var(--print-line-height);
237
+ }
238
+
239
+ body {
240
+ background-color: white !important;
241
+ color: #000 !important;
242
+ font-size: var(--print-font-size) !important;
243
+ line-height: var(--print-line-height) !important;
244
+ }
245
+
246
+ #container {
247
+ box-shadow: none !important;
248
+ border: none !important;
249
+ border-radius: 0 !important;
250
+ margin: 0 !important;
251
+ padding: 0 !important;
252
+ max-width: none !important;
253
+ background-color: white !important;
254
+ }
255
+
256
+ h1, h2, h3, h4, h5, h6 {
257
+ color: #000 !important;
258
+ page-break-after: avoid;
259
+ }
260
+
261
+ h1 {
262
+ font-size: 18pt !important;
263
+ line-height: 22pt !important;
264
+ }
265
+
266
+ h2 {
267
+ font-size: 14pt !important;
268
+ line-height: 18pt !important;
269
+ }
270
+
271
+ h3 {
272
+ font-size: 12pt !important;
273
+ line-height: 16pt !important;
274
+ }
275
+
276
+ h4, h5, h6 {
277
+ font-size: 11pt !important;
278
+ line-height: 16pt !important;
279
+ }
280
+
281
+ p, li {
282
+ orphans: 3;
283
+ widows: 3;
284
+ }
285
+
286
+ blockquote, pre {
287
+ page-break-inside: avoid;
288
+ }
289
+
290
+ a {
291
+ color: #000 !important;
292
+ text-decoration: underline !important;
293
+ }
294
+
295
+ code {
296
+ background-color: #f5f5f5 !important;
297
+ border-radius: 0 !important;
298
+ color: #000 !important;
299
+ font-size: 9pt !important;
300
+ }
301
+
302
+ pre {
303
+ background-color: #f8f8f8 !important;
304
+ border: 1px solid #ddd !important;
305
+ border-radius: 0 !important;
306
+ color: #000 !important;
307
+ }
308
+
309
+ pre code {
310
+ background-color: transparent !important;
311
+ font-size: 9pt !important;
312
+ }
313
+
314
+ table {
315
+ border-collapse: collapse !important;
316
+ border-radius: 0 !important;
317
+ background-color: white !important;
318
+ box-shadow: none !important;
319
+ }
320
+
321
+ th, td {
322
+ border: 1px solid #000 !important;
323
+ color: #000 !important;
324
+ }
325
+
326
+ th {
327
+ background-color: #f0f0f0 !important;
328
+ }
329
+
330
+ table, table tr td, table tr th {
331
+ page-break-inside: avoid;
332
+ }
333
+
334
+
335
+ img {
336
+ max-width: 100% !important;
337
+ page-break-inside: avoid;
338
+ }
339
+ }
@@ -0,0 +1,9 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <%= stylesheet_tag %>
5
+ </head>
6
+ <body>
7
+ <div id="container"><%= content %></div>
8
+ </body>
9
+ </html>
@@ -0,0 +1,25 @@
1
+ :root {
2
+ --screen-font-size: 16px;
3
+ --screen-line-height: calc(var(--screen-font-size) * 1.3);
4
+ --screen-unit: var(--screen-line-height);
5
+
6
+ --print-font-size: 12pt;
7
+ --print-line-height: calc(var(--print-font-size) * 1.3);
8
+ --print-unit: var(--print-line-height);
9
+
10
+ --link-color: #cb0018;
11
+ }
12
+
13
+ @import "../base/style.css";
14
+
15
+ body {
16
+ font-family: ScalaSansPro, "Helvetica Neue";
17
+ }
18
+
19
+ p + h2, p + h3, p + h4, p + h5, p + h6 {
20
+ margin-top: calc(var(--screen-unit) * 1.5);
21
+ }
22
+
23
+ p {
24
+ line-height: 1.25;
25
+ }
@@ -0,0 +1,11 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <%= stylesheet_tag %>
7
+ </head>
8
+ <body>
9
+ <main id="container"><%= content %></main>
10
+ </body>
11
+ </html>
@@ -0,0 +1,114 @@
1
+ :root {
2
+ --screen-font-size: 16px;
3
+ --screen-line-height: calc(var(--screen-font-size) * 1.4);
4
+ --screen-unit: var(--screen-line-height);
5
+
6
+ --print-font-size: 10pt;
7
+ --print-line-height: calc(var(--print-font-size) * 1.618);
8
+ --print-unit: var(--print-line-height);
9
+
10
+ --zen-text: #2c2c2c;
11
+ --zen-subtle: #8a8a8a;
12
+ --zen-accent: #007acc;
13
+ --zen-background: #fefefe;
14
+ --zen-border: #e8e8e8;
15
+ --link-color: var(--zen-accent);
16
+ }
17
+
18
+ @import "../base/style.css";
19
+
20
+ body {
21
+ font-family: "Times New Roman", Times, Georgia, serif;
22
+ color: var(--zen-text);
23
+ line-height: 1.4;
24
+ background-color: var(--zen-background);
25
+ font-weight: 350;
26
+ letter-spacing: 0.01em;
27
+ }
28
+
29
+ h1, h2, h3, h4, h5, h6 {
30
+ font-weight: 300;
31
+ color: var(--zen-text);
32
+ letter-spacing: -0.02em;
33
+ }
34
+
35
+ h1 {
36
+ font-size: calc(var(--screen-font-size) * 2.618);
37
+ margin-top: calc(var(--screen-unit) * 2);
38
+ margin-bottom: calc(var(--screen-unit) * 1.5);
39
+ line-height: 1.2;
40
+ }
41
+
42
+ h2 {
43
+ font-size: calc(var(--screen-font-size) * 1.618);
44
+ margin-top: calc(var(--screen-unit) * 1.618);
45
+ margin-bottom: calc(var(--screen-unit) * 0.618);
46
+ }
47
+
48
+ p {
49
+ margin: calc(var(--screen-unit) * 0.618) 0;
50
+ text-align: justify;
51
+ hyphens: auto;
52
+ }
53
+
54
+ blockquote {
55
+ border-left: 2px solid var(--zen-border);
56
+ padding-left: calc(var(--screen-unit) * 0.618);
57
+ margin-left: 0;
58
+ font-style: italic;
59
+ color: var(--zen-subtle);
60
+ }
61
+
62
+ code {
63
+ font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;
64
+ font-size: calc(var(--screen-font-size) * 0.9);
65
+ background-color: rgba(0, 0, 0, 0.04);
66
+ padding: 0.1em 0.3em;
67
+ border-radius: 3px;
68
+ font-weight: 400;
69
+ }
70
+
71
+ pre {
72
+ background-color: rgba(0, 0, 0, 0.02);
73
+ border: 1px solid var(--zen-border);
74
+ border-radius: 6px;
75
+ padding: calc(var(--screen-unit) * 0.618);
76
+ overflow-x: auto;
77
+ }
78
+
79
+ pre code {
80
+ background-color: transparent;
81
+ padding: 0;
82
+ border-radius: 0;
83
+ font-size: calc(var(--screen-font-size) * 0.85);
84
+ }
85
+
86
+ a:link, a:visited {
87
+ color: var(--zen-accent);
88
+ text-decoration: none;
89
+ border-bottom: 1px solid transparent;
90
+ transition: border-bottom-color 0.2s ease;
91
+ }
92
+
93
+ a:hover {
94
+ border-bottom-color: var(--zen-accent);
95
+ text-decoration: none;
96
+ }
97
+
98
+ ul, ol {
99
+ margin: calc(var(--screen-unit) * 0.5) 0;
100
+ padding-left: calc(var(--screen-unit) * 1.2);
101
+ }
102
+
103
+ li {
104
+ margin: calc(var(--screen-unit) * 0.25) 0;
105
+ }
106
+
107
+ #container {
108
+ max-width: 120ch;
109
+ margin: calc(var(--screen-unit) * 2) auto;
110
+ padding: calc(var(--screen-unit) * 4) calc(var(--screen-unit) * 6);
111
+ border: 1px solid #999999;
112
+ background-color: var(--zen-background);
113
+ box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
114
+ }