mint 0.8.1 → 0.10.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 (83) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -26
  3. data/README.md +117 -37
  4. data/bin/mint +2 -81
  5. data/config/templates/base/navigation.css +136 -0
  6. data/config/templates/base/print.css +152 -0
  7. data/config/templates/{reset.css → base/reset.css} +1 -1
  8. data/config/templates/base/style.css +117 -137
  9. data/config/templates/base/utilities.css +136 -0
  10. data/config/templates/base/variables.css +124 -0
  11. data/config/templates/basic/style.css +151 -0
  12. data/config/templates/default/layout.erb +33 -3
  13. data/config/templates/default/style.css +95 -164
  14. data/config/templates/magazine/style.css +383 -0
  15. data/config/templates/nord/style.css +105 -220
  16. data/config/templates/nord-dark/style.css +82 -263
  17. data/lib/mint/commandline/parse.rb +144 -0
  18. data/lib/mint/commandline/publish.rb +46 -0
  19. data/lib/mint/commandline/run.rb +30 -0
  20. data/lib/mint/config.rb +162 -0
  21. data/lib/mint/{css.rb → css_dsl.rb} +9 -9
  22. data/lib/mint/css_parser.rb +45 -25
  23. data/lib/mint/document.rb +250 -365
  24. data/lib/mint/document_tree.rb +163 -0
  25. data/lib/mint/exceptions.rb +2 -3
  26. data/lib/mint/helpers.rb +23 -180
  27. data/lib/mint/layout.rb +26 -9
  28. data/lib/mint/renderers/css_renderer.rb +32 -0
  29. data/lib/mint/renderers/erb_renderer.rb +11 -0
  30. data/lib/mint/renderers/markdown_renderer.rb +45 -0
  31. data/lib/mint/style.rb +21 -31
  32. data/lib/mint/template.rb +30 -0
  33. data/lib/mint/version.rb +1 -1
  34. data/lib/mint/workspace.rb +171 -0
  35. data/lib/mint.rb +44 -12
  36. data/man/mint.1 +85 -44
  37. data/spec/cli/README.md +2 -2
  38. data/spec/cli/argument_parsing_spec.rb +89 -147
  39. data/spec/cli/bin_integration_spec.rb +23 -243
  40. data/spec/cli/full_workflow_integration_spec.rb +99 -442
  41. data/spec/cli/original_style_integration_spec.rb +58 -0
  42. data/spec/cli/publish_workflow_spec.rb +72 -70
  43. data/spec/commandline_path_integration_spec.rb +230 -0
  44. data/spec/config_file_integration_spec.rb +362 -0
  45. data/spec/{css_spec.rb → css_dsl_spec.rb} +7 -3
  46. data/spec/css_parser_spec.rb +59 -1
  47. data/spec/document_spec.rb +37 -242
  48. data/spec/flattened_path_spec.rb +150 -0
  49. data/spec/layout_spec.rb +42 -3
  50. data/spec/mint_spec.rb +22 -217
  51. data/spec/path_handling_spec.rb +237 -0
  52. data/spec/run_cli_tests.rb +1 -1
  53. data/spec/spec_helper.rb +3 -10
  54. data/spec/style_spec.rb +31 -56
  55. data/spec/support/cli_helpers.rb +7 -10
  56. data/spec/support/matchers.rb +1 -1
  57. data/spec/template_spec.rb +31 -0
  58. data/spec/workspace_spec.rb +177 -0
  59. metadata +75 -89
  60. data/bin/mint-epub +0 -20
  61. data/config/templates/garden/layout.erb +0 -38
  62. data/config/templates/garden/style.css +0 -303
  63. data/config/templates/nord/layout.erb +0 -11
  64. data/config/templates/nord-dark/layout.erb +0 -11
  65. data/config/templates/zen/layout.erb +0 -11
  66. data/config/templates/zen/style.css +0 -114
  67. data/lib/mint/command_line.rb +0 -360
  68. data/lib/mint/css_template.rb +0 -37
  69. data/lib/mint/markdown_template.rb +0 -47
  70. data/lib/mint/mint.rb +0 -313
  71. data/lib/mint/plugin.rb +0 -136
  72. data/lib/mint/plugins/epub.rb +0 -293
  73. data/lib/mint/resource.rb +0 -101
  74. data/plugins/templates/epub/layouts/container.haml +0 -5
  75. data/plugins/templates/epub/layouts/content.haml +0 -35
  76. data/plugins/templates/epub/layouts/layout.haml +0 -6
  77. data/plugins/templates/epub/layouts/title.haml +0 -11
  78. data/plugins/templates/epub/layouts/toc.haml +0 -26
  79. data/spec/cli/configuration_management_spec.rb +0 -363
  80. data/spec/cli/template_management_spec.rb +0 -300
  81. data/spec/helpers_spec.rb +0 -249
  82. data/spec/plugin_spec.rb +0 -449
  83. data/spec/resource_spec.rb +0 -135
@@ -0,0 +1,383 @@
1
+ @import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;0,900;1,400;1,600;1,700&family=Lora:ital,wght@0,400;0,500;0,600;1,400;1,500;1,600&display=swap');
2
+
3
+ /* Import base system */
4
+ @import "../base/style.css";
5
+ @import "../base/navigation.css";
6
+ @import "../base/utilities.css";
7
+
8
+ /* Magazine Template Theme Variables */
9
+ :root {
10
+ /* Typography settings - elegant magazine style */
11
+ --base-font-size: 18px;
12
+ --base-line-height: 1.7;
13
+ --scale-ratio: 1.414; /* Square root of 2 for elegant progression */
14
+
15
+ /* Print settings */
16
+ --print-font-size: 11pt;
17
+ --print-line-height: 1.6;
18
+
19
+ /* Magazine color palette */
20
+ --color-text: #1a1a1a;
21
+ --color-text-subtle: #555555;
22
+ --color-text-muted: #777777;
23
+ --color-background: #ffffff;
24
+ --color-surface: #ffffff;
25
+ --color-surface-subtle: #fafafa;
26
+ --color-border: #e8e8e8;
27
+ --color-accent: #dc2626; /* Bright red accent */
28
+ --color-accent-hover: #b91c1c;
29
+ --color-accent-subtle: rgba(220, 38, 38, 0.08);
30
+ --color-red-bar: #dc2626; /* Bright red for the signature bar */
31
+
32
+ /* Component colors */
33
+ --color-code-bg: #f5f5f5;
34
+ --color-code-text: #333333;
35
+ --color-pre-bg: #f8f8f8;
36
+ --color-pre-text: var(--color-text);
37
+ --color-quote-bg: #fafafa;
38
+ --color-quote-text: var(--color-text-muted);
39
+ --color-quote-border: var(--color-accent);
40
+
41
+ /* Navigation colors */
42
+ --color-nav-bg: var(--color-red-bar);
43
+ --color-nav-text: #ffffff;
44
+ --color-nav-text-hover: rgba(255, 255, 255, 0.9);
45
+ --color-nav-text-active: #ffffff;
46
+ --color-nav-bg-hover: rgba(255, 255, 255, 0.1);
47
+ --color-nav-bg-active: rgba(255, 255, 255, 0.15);
48
+ --color-nav-border: var(--color-red-bar);
49
+ --color-nav-border-active: #ffffff;
50
+
51
+ /* Table colors */
52
+ --color-table-bg: var(--color-surface);
53
+ --color-table-header-bg: #fafafa;
54
+ --color-table-border: var(--color-border);
55
+ --color-table-stripe: rgba(0, 0, 0, 0.02);
56
+ --color-table-hover: rgba(0, 0, 0, 0.04);
57
+
58
+ /* Layout */
59
+ --container-max-width: 60rem;
60
+ --red-bar-width: 8px;
61
+ --red-bar-wide-width: 32px;
62
+ }
63
+
64
+ /* Typography */
65
+ body {
66
+ font-family: "Lora", Georgia, "Times New Roman", serif;
67
+ background-color: var(--color-background);
68
+ color: var(--color-text);
69
+ font-weight: 400;
70
+ text-rendering: optimizeLegibility;
71
+ -webkit-font-smoothing: antialiased;
72
+ position: relative;
73
+ }
74
+
75
+ /* Red vertical bar for wide screens (when no navigation) */
76
+ body::before {
77
+ content: '';
78
+ position: fixed;
79
+ left: 0;
80
+ top: 0;
81
+ width: var(--red-bar-wide-width);
82
+ height: 100vh;
83
+ background-color: var(--color-red-bar);
84
+ z-index: 10;
85
+ }
86
+
87
+ /* Hide red bar when navigation is present */
88
+ body:has(#navigation)::before,
89
+ body.has-navigation::before {
90
+ display: none;
91
+ }
92
+
93
+ h1, h2, h3, h4, h5, h6 {
94
+ font-family: "Playfair Display", Georgia, serif;
95
+ font-weight: 700;
96
+ color: var(--color-text);
97
+ text-rendering: optimizeLegibility;
98
+ line-height: 1.2;
99
+ }
100
+
101
+ /* Dramatic magazine-style H1 */
102
+ h1 {
103
+ font-size: calc(var(--font-size-2xl) * 1.5);
104
+ font-weight: 900;
105
+ margin-bottom: var(--space-lg);
106
+ line-height: 1.1;
107
+ letter-spacing: -0.02em;
108
+ }
109
+
110
+ /* Hero image styling - first image after H1 */
111
+ h1 + p img,
112
+ h1 + img {
113
+ width: 100%;
114
+ height: auto;
115
+ margin: var(--space-xl) 0;
116
+ border-radius: var(--radius-base);
117
+ box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
118
+ }
119
+
120
+ h2 {
121
+ font-size: var(--font-size-xl);
122
+ margin-top: var(--space-2xl);
123
+ margin-bottom: var(--space-base);
124
+ border-bottom: 2px solid var(--color-accent);
125
+ padding-bottom: var(--space-xs);
126
+ display: inline-block;
127
+ }
128
+
129
+ h3 {
130
+ font-size: var(--font-size-lg);
131
+ margin-top: var(--space-xl);
132
+ color: var(--color-accent);
133
+ }
134
+
135
+ h4 {
136
+ font-size: calc(var(--font-size-base) * 1.1);
137
+ font-weight: 600;
138
+ margin-top: var(--space-lg);
139
+ text-transform: uppercase;
140
+ letter-spacing: 0.05em;
141
+ color: var(--color-text-subtle);
142
+ }
143
+
144
+ h5, h6 {
145
+ font-size: var(--font-size-base);
146
+ font-weight: 600;
147
+ color: var(--color-text-subtle);
148
+ margin-top: var(--space-base);
149
+ }
150
+
151
+ /* Enhanced typography */
152
+ p {
153
+ text-align: justify;
154
+ hyphens: auto;
155
+ text-rendering: optimizeLegibility;
156
+ margin-bottom: var(--space-xs);
157
+ text-indent: 1.5em;
158
+ }
159
+
160
+ /* First paragraph after headings shouldn't be indented */
161
+ h1 + p,
162
+ h2 + p,
163
+ h3 + p,
164
+ h4 + p,
165
+ h5 + p,
166
+ h6 + p,
167
+ blockquote p {
168
+ text-indent: 0;
169
+ }
170
+
171
+ /* Drop cap for first paragraph after H1 */
172
+ h1 + p::first-letter {
173
+ float: left;
174
+ font-family: "Playfair Display", Georgia, serif;
175
+ font-size: 4.5em;
176
+ line-height: 0.8;
177
+ font-weight: 900;
178
+ color: var(--color-accent);
179
+ margin: 0.1em 0.1em 0.05em 0;
180
+ text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
181
+ }
182
+
183
+ /* Container layouts */
184
+ #container {
185
+ max-width: var(--container-max-width);
186
+ margin: var(--space-2xl) auto;
187
+ padding: 0 var(--space-xl);
188
+ margin-left: calc(var(--red-bar-wide-width) + var(--space-2xl));
189
+ }
190
+
191
+ /* Container adjustments when navigation is present */
192
+ body:has(#navigation) #container,
193
+ body.has-navigation #container {
194
+ margin-left: calc(var(--navigation-width) + var(--space-xl));
195
+ max-width: calc(var(--container-max-width) - var(--navigation-width));
196
+ margin-right: auto;
197
+ }
198
+
199
+ /* Enhanced blockquotes */
200
+ blockquote {
201
+ font-family: "Playfair Display", Georgia, serif;
202
+ font-size: calc(var(--font-size-base) * 1.1);
203
+ font-style: italic;
204
+ border-left: 4px solid var(--color-accent);
205
+ margin: var(--space-xl) 0;
206
+ padding: var(--space-base) var(--space-xl);
207
+ position: relative;
208
+ }
209
+
210
+ blockquote::before {
211
+ content: '"';
212
+ font-family: "Playfair Display", Georgia, serif;
213
+ font-size: 4em;
214
+ color: var(--color-accent);
215
+ position: absolute;
216
+ left: -0.2em;
217
+ top: -0.3em;
218
+ opacity: 0.3;
219
+ line-height: 1;
220
+ }
221
+
222
+ /* Enhanced links */
223
+ a {
224
+ color: var(--color-accent);
225
+ text-decoration: none;
226
+ border-bottom: 1px solid transparent;
227
+ transition: var(--transition-base);
228
+ font-weight: 500;
229
+ }
230
+
231
+ a:hover {
232
+ border-bottom-color: var(--color-accent);
233
+ }
234
+
235
+ /* Enhanced code styling */
236
+ code {
237
+ font-family: "SF Mono", "JetBrains Mono", Monaco, "Cascadia Code", monospace;
238
+ font-size: calc(var(--font-size-base) * 0.9);
239
+ font-weight: 500;
240
+ }
241
+
242
+ /* Lists */
243
+ ul, ol {
244
+ margin: var(--space-base) 0;
245
+ padding-left: var(--space-xl);
246
+ }
247
+
248
+ li {
249
+ margin-bottom: var(--space-xs);
250
+ line-height: var(--base-line-height);
251
+ }
252
+
253
+ /* Images */
254
+ img {
255
+ max-width: 100%;
256
+ height: auto;
257
+ border-radius: var(--radius-sm);
258
+ margin: var(--space-base) 0;
259
+ }
260
+
261
+ /* Tables */
262
+ table {
263
+ margin: var(--space-xl) 0;
264
+ font-size: calc(var(--font-size-base) * 0.95);
265
+ }
266
+
267
+ th {
268
+ font-family: "Playfair Display", Georgia, serif;
269
+ font-weight: 600;
270
+ text-transform: uppercase;
271
+ letter-spacing: 0.05em;
272
+ font-size: calc(var(--font-size-base) * 0.85);
273
+ color: var(--color-accent);
274
+ }
275
+
276
+ /* Horizontal rules */
277
+ hr {
278
+ border: none;
279
+ height: 2px;
280
+ background: linear-gradient(to right, var(--color-accent), transparent);
281
+ margin: var(--space-2xl) 0;
282
+ }
283
+
284
+ /* Responsive design */
285
+ @media (max-width: 1024px) {
286
+ /* Switch to right border for medium screens */
287
+ body::before {
288
+ left: auto;
289
+ right: 0;
290
+ width: var(--red-bar-width);
291
+ }
292
+
293
+ #container {
294
+ margin-left: var(--space-xl);
295
+ margin-right: calc(var(--red-bar-width) + var(--space-xl));
296
+ }
297
+
298
+ body:has(#navigation) #container,
299
+ body.has-navigation #container {
300
+ margin-left: calc(var(--navigation-width) + var(--space-base));
301
+ margin-right: var(--space-base);
302
+ }
303
+ }
304
+
305
+ @media (max-width: 960px) {
306
+ /* Mobile adjustments */
307
+ :root {
308
+ --base-font-size: 17px;
309
+ }
310
+
311
+ body::before {
312
+ width: var(--red-bar-width);
313
+ right: 0;
314
+ left: auto;
315
+ }
316
+
317
+ #container {
318
+ margin: var(--space-base) var(--space-base);
319
+ margin-right: calc(var(--red-bar-width) + var(--space-base));
320
+ max-width: none;
321
+ padding: 0;
322
+ }
323
+
324
+ body:has(#navigation) #container,
325
+ body.has-navigation #container {
326
+ margin: var(--space-base);
327
+ margin-right: var(--space-base);
328
+ }
329
+
330
+ #navigation {
331
+ border-bottom: 2px solid var(--color-red-bar);
332
+ }
333
+
334
+ h1 {
335
+ font-size: var(--font-size-2xl);
336
+ }
337
+
338
+ /* Remove drop cap on mobile */
339
+ h1 + p::first-letter {
340
+ float: none;
341
+ font-size: inherit;
342
+ line-height: inherit;
343
+ font-weight: inherit;
344
+ color: inherit;
345
+ margin: 0;
346
+ text-shadow: none;
347
+ }
348
+ }
349
+
350
+ /* Print styles */
351
+ @media print {
352
+ body::before {
353
+ display: none !important;
354
+ }
355
+
356
+ #container {
357
+ margin: 0 !important;
358
+ max-width: none !important;
359
+ }
360
+
361
+ h1 + p::first-letter {
362
+ float: none;
363
+ font-size: inherit;
364
+ line-height: inherit;
365
+ font-weight: inherit;
366
+ color: #000 !important;
367
+ margin: 0;
368
+ text-shadow: none;
369
+ }
370
+
371
+ blockquote::before {
372
+ display: none;
373
+ }
374
+
375
+ h2 {
376
+ border-bottom-color: #000 !important;
377
+ }
378
+
379
+ a {
380
+ color: #000 !important;
381
+ border-bottom-color: #000 !important;
382
+ }
383
+ }