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
@@ -1,303 +0,0 @@
1
- /* Garden Template - Digital Garden with Navigation */
2
- @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
3
-
4
- * {
5
- margin: 0;
6
- padding: 0;
7
- box-sizing: border-box;
8
- }
9
-
10
- body {
11
- font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
12
- line-height: 1.6;
13
- color: #1a1a1a;
14
- background-color: #fafafa;
15
- font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
16
- -webkit-font-smoothing: antialiased;
17
- -moz-osx-font-smoothing: grayscale;
18
- }
19
-
20
- .garden-container {
21
- display: flex;
22
- min-height: 100vh;
23
- width: 100%;
24
- background: white;
25
- }
26
-
27
- /* Navigation Sidebar */
28
- .garden-nav {
29
- width: 280px;
30
- background: #fafafa;
31
- border-right: 1px solid #e5e7eb;
32
- flex-shrink: 0;
33
- overflow-y: auto;
34
- max-height: 100vh;
35
- position: sticky;
36
- top: 0;
37
- }
38
-
39
- .garden-nav-header {
40
- padding: 1.5rem 1rem 1rem;
41
- border-bottom: 1px solid #e5e7eb;
42
- background: white;
43
- }
44
-
45
- .garden-nav-header h3 {
46
- font-size: 1.1rem;
47
- font-weight: 600;
48
- color: #374151;
49
- letter-spacing: -0.025em;
50
- }
51
-
52
- .garden-nav-content {
53
- padding: 1rem 0;
54
- }
55
-
56
- .garden-toc {
57
- list-style: none;
58
- padding: 0;
59
- }
60
-
61
- .garden-toc li {
62
- margin: 0;
63
- }
64
-
65
- .garden-toc a {
66
- display: block;
67
- padding: 0.5rem 1rem;
68
- color: #6b7280;
69
- text-decoration: none;
70
- border-left: 3px solid transparent;
71
- transition: all 0.15s ease;
72
- font-size: 0.875rem;
73
- font-weight: 400;
74
- }
75
-
76
- .garden-toc a:hover {
77
- color: #374151;
78
- background-color: #f3f4f6;
79
- border-left-color: #d1d5db;
80
- }
81
-
82
- .garden-toc a.current {
83
- color: #2563eb;
84
- background-color: #eff6ff;
85
- border-left-color: #2563eb;
86
- font-weight: 500;
87
- }
88
-
89
- /* Depth-based indentation */
90
- .garden-toc .depth-0 a {
91
- padding-left: 1rem;
92
- font-weight: 500;
93
- }
94
-
95
- .garden-toc .depth-1 a {
96
- padding-left: 1.75rem;
97
- font-size: 0.8125rem;
98
- }
99
-
100
- .garden-toc .depth-2 a {
101
- padding-left: 2.5rem;
102
- font-size: 0.75rem;
103
- }
104
-
105
- .garden-toc .depth-3 a {
106
- padding-left: 3.25rem;
107
- font-size: 0.75rem;
108
- }
109
-
110
- /* Main Content Area */
111
- .garden-main {
112
- flex: 1;
113
- overflow-y: auto;
114
- max-height: 100vh;
115
- }
116
-
117
- .garden-content {
118
- padding: 2rem 3rem;
119
- max-width: none;
120
- }
121
-
122
- /* Typography */
123
- .garden-content h1 {
124
- font-size: 2rem;
125
- font-weight: 700;
126
- margin-bottom: 1.5rem;
127
- color: #111827;
128
- line-height: 1.2;
129
- letter-spacing: -0.025em;
130
- }
131
-
132
- .garden-content h2 {
133
- font-size: 1.5rem;
134
- font-weight: 600;
135
- margin: 2rem 0 1rem;
136
- color: #1f2937;
137
- border-bottom: 1px solid #e5e7eb;
138
- padding-bottom: 0.5rem;
139
- letter-spacing: -0.025em;
140
- }
141
-
142
- .garden-content h3 {
143
- font-size: 1.25rem;
144
- font-weight: 600;
145
- margin: 1.5rem 0 0.75rem;
146
- color: #374151;
147
- letter-spacing: -0.025em;
148
- }
149
-
150
- .garden-content h4 {
151
- font-size: 1.125rem;
152
- font-weight: 600;
153
- margin: 1.25rem 0 0.5rem;
154
- color: #4b5563;
155
- letter-spacing: -0.025em;
156
- }
157
-
158
- .garden-content p {
159
- margin-bottom: 1.25rem;
160
- color: #374151;
161
- line-height: 1.7;
162
- }
163
-
164
- .garden-content a {
165
- color: #2563eb;
166
- text-decoration: none;
167
- border-bottom: 1px solid transparent;
168
- transition: border-bottom 0.15s ease;
169
- }
170
-
171
- .garden-content a:hover {
172
- border-bottom-color: #2563eb;
173
- }
174
-
175
- /* Lists */
176
- .garden-content ul,
177
- .garden-content ol {
178
- margin: 1rem 0;
179
- padding-left: 1.75rem;
180
- }
181
-
182
- .garden-content li {
183
- margin: 0.375rem 0;
184
- color: #374151;
185
- line-height: 1.6;
186
- }
187
-
188
- /* Code */
189
- .garden-content code {
190
- background: #f3f4f6;
191
- padding: 0.125rem 0.375rem;
192
- border-radius: 4px;
193
- font-family: 'SF Mono', 'Fira Code', 'Monaco', 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
194
- font-size: 0.875em;
195
- color: #dc2626;
196
- font-weight: 500;
197
- }
198
-
199
- .garden-content pre {
200
- background: #f9fafb;
201
- padding: 1.5rem;
202
- border-radius: 8px;
203
- overflow-x: auto;
204
- margin: 1.5rem 0;
205
- border: 1px solid #e5e7eb;
206
- border-left: 4px solid #2563eb;
207
- }
208
-
209
- .garden-content pre code {
210
- background: none;
211
- padding: 0;
212
- color: #374151;
213
- font-weight: 400;
214
- }
215
-
216
- /* Tables */
217
- .garden-content table {
218
- width: 100%;
219
- border-collapse: collapse;
220
- margin: 1.5rem 0;
221
- border-radius: 6px;
222
- overflow: hidden;
223
- border: 1px solid #e5e7eb;
224
- }
225
-
226
- .garden-content th,
227
- .garden-content td {
228
- padding: 0.75rem 1rem;
229
- text-align: left;
230
- border-bottom: 1px solid #e5e7eb;
231
- }
232
-
233
- .garden-content th {
234
- background: #f9fafb;
235
- font-weight: 600;
236
- color: #374151;
237
- font-size: 0.875rem;
238
- }
239
-
240
- /* Blockquotes */
241
- .garden-content blockquote {
242
- margin: 1.5rem 0;
243
- padding: 1rem 1.5rem;
244
- background: #f9fafb;
245
- border-left: 4px solid #6b7280;
246
- border-radius: 0 6px 6px 0;
247
- }
248
-
249
- .garden-content blockquote p {
250
- margin: 0;
251
- color: #4b5563;
252
- font-style: italic;
253
- line-height: 1.6;
254
- }
255
-
256
- /* Responsive Design */
257
- @media (max-width: 768px) {
258
- .garden-container {
259
- flex-direction: column;
260
- }
261
-
262
- .garden-nav {
263
- width: 100%;
264
- position: static;
265
- max-height: none;
266
- order: 2;
267
- }
268
-
269
- .garden-main {
270
- order: 1;
271
- max-height: none;
272
- }
273
-
274
- .garden-content {
275
- padding: 1.5rem;
276
- }
277
-
278
- .garden-content h1 {
279
- font-size: 1.75rem;
280
- }
281
-
282
- .garden-content h2 {
283
- font-size: 1.375rem;
284
- }
285
- }
286
-
287
- @media (max-width: 480px) {
288
- .garden-content {
289
- padding: 1rem;
290
- }
291
-
292
- .garden-content h1 {
293
- font-size: 1.5rem;
294
- }
295
-
296
- .garden-content h2 {
297
- font-size: 1.25rem;
298
- }
299
-
300
- .garden-nav-content {
301
- padding: 0.5rem 0;
302
- }
303
- }
@@ -1,11 +0,0 @@
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>
@@ -1,11 +0,0 @@
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>
@@ -1,11 +0,0 @@
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>
@@ -1,114 +0,0 @@
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
- }