mint 0.8.0 → 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 (87) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -26
  3. data/README.md +138 -95
  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 +96 -0
  23. data/lib/mint/document.rb +251 -348
  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 +88 -47
  37. data/spec/cli/README.md +13 -13
  38. data/spec/cli/argument_parsing_spec.rb +103 -131
  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 +207 -0
  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 +78 -93
  60. data/bin/mint-epub +0 -20
  61. data/config/templates/default/css/style.css +0 -205
  62. data/config/templates/garden/layout.erb +0 -38
  63. data/config/templates/garden/style.css +0 -303
  64. data/config/templates/newspaper/layout.erb +0 -16
  65. data/config/templates/nord/layout.erb +0 -11
  66. data/config/templates/nord-dark/layout.erb +0 -11
  67. data/config/templates/protocol/layout.erb +0 -9
  68. data/config/templates/protocol/style.css +0 -25
  69. data/config/templates/zen/layout.erb +0 -11
  70. data/config/templates/zen/style.css +0 -114
  71. data/lib/mint/command_line.rb +0 -360
  72. data/lib/mint/css_template.rb +0 -37
  73. data/lib/mint/markdown_template.rb +0 -47
  74. data/lib/mint/mint.rb +0 -313
  75. data/lib/mint/plugin.rb +0 -136
  76. data/lib/mint/plugins/epub.rb +0 -293
  77. data/lib/mint/resource.rb +0 -101
  78. data/plugins/templates/epub/layouts/container.haml +0 -5
  79. data/plugins/templates/epub/layouts/content.haml +0 -35
  80. data/plugins/templates/epub/layouts/layout.haml +0 -6
  81. data/plugins/templates/epub/layouts/title.haml +0 -11
  82. data/plugins/templates/epub/layouts/toc.haml +0 -26
  83. data/spec/cli/configuration_management_spec.rb +0 -363
  84. data/spec/cli/template_management_spec.rb +0 -300
  85. data/spec/helpers_spec.rb +0 -249
  86. data/spec/plugin_spec.rb +0 -449
  87. data/spec/resource_spec.rb +0 -135
@@ -1,205 +0,0 @@
1
- @import '../reset.css';
2
- body {
3
- font-family: Ubuntu, "Hoefler Text", "Grandesign Neue Serif", Ubuntu, Georgia, FreeSerif, serif, Georgia, serif;
4
- }
5
-
6
- h1, h2 {
7
- line-height: 1.3;
8
- }
9
-
10
- h2, h3, h4, h5, h6 {
11
- line-height: 22.5px;
12
- }
13
-
14
- h1, h2, h3, h4, h5, h6 {
15
- font-family: "Hoefler Text", Garamond, Georgia;
16
- font-weight: normal;
17
- }
18
-
19
- h1 {
20
- font-size: 22.5px;
21
- margin-top: 22.5px;
22
- margin-bottom: 22.5px;
23
- }
24
-
25
- h2 {
26
- font-size: 18px;
27
- margin-top: 33.75px;
28
- margin-bottom: 11.25px;
29
- }
30
-
31
- h3 {
32
- font-size: 16.5px;
33
- margin-top: 39.375px;
34
- margin-bottom: 5.625px;
35
- }
36
-
37
- h4 {
38
- font-size: 15.75px;
39
- margin-top: 19.6875px;
40
- margin-bottom: 2.8125px;
41
- }
42
-
43
- h5, h6 {
44
- font-size: 15px;
45
- margin-top: 19.6875px;
46
- margin-bottom: 2.8125px;
47
- }
48
-
49
- ul {
50
- list-style-type: square;
51
- }
52
- ul ul {
53
- list-style-type: circle;
54
- }
55
-
56
- ul, ol {
57
- margin: 5.625px 0 0 11.25px;
58
- padding-left: 27px;
59
- }
60
- ul li p, ol li p {
61
- text-indent: 0 !important;
62
- }
63
- ul li + li, ol li + li {
64
- margin-top: 5.625px;
65
- }
66
-
67
- p {
68
- margin: 11.25px 0;
69
- }
70
-
71
- ul + p, ol + p, blockquote + p, pre + p {
72
- text-indent: 0;
73
- }
74
-
75
- a:link, a:visited, a:active {
76
- color: #cb0018;
77
- text-decoration: none;
78
- }
79
- a:hover {
80
- text-decoration: underline;
81
- }
82
-
83
- code {
84
- font-family: Monaco, Menlo, Mensch, Consolas, Monotype, mono;
85
- font-style: normal;
86
- }
87
-
88
- pre, blockquote {
89
- display: block;
90
- margin-left: 22.5px;
91
- margin-right: 45px;
92
- padding: 7.5px 22.5px;
93
- padding-left: 16.875px;
94
- white-space: pre;
95
- }
96
- pre p, blockquote p {
97
- margin: 0;
98
- line-height: 1.35;
99
- }
100
-
101
- img {
102
- display: block;
103
- }
104
-
105
- @media screen {
106
- body {
107
- font-size: 15px;
108
- line-height: 22.5px;
109
- background-color: #666;
110
- color: #333;
111
- }
112
- #container {
113
- display: block;
114
- border: solid 1px #999;
115
- width: 780px;
116
- padding: 40px 60px;
117
- margin: 11.25px auto;
118
- background-color: #fff;
119
- box-sizing: border-box;
120
- -moz-box-sizing: border-box;
121
- -webkit-box-sizing: border-box;
122
- }
123
- code {
124
- font-size: 13.125px;
125
- }
126
- pre {
127
- white-space: pre-wrap;
128
- white-space: -moz-pre-wrap;
129
- white-space: -o-pre-wrap;
130
- word-wrap: break-word;
131
- }
132
- pre code {
133
- font-size: 11.25px;
134
- }
135
- }
136
- @media print {
137
- @page {
138
- margin-left: 1in;
139
- margin-right: 1in;
140
- margin-top: 1in;
141
- margin-bottom: 1in;
142
- }
143
- body {
144
- font-size: 12pt;
145
- line-height: 15.6pt;
146
- width: auto;
147
- margin: 0;
148
- padding: 0;
149
- }
150
- code {
151
- font-size: 10.5pt;
152
- }
153
- pre code {
154
- font-size: 9pt;
155
- }
156
- h1, h2, h3, h4, h5, h6, li, blockquote {
157
- page-break-inside: avoid;
158
- }
159
- p {
160
- widows: 3;
161
- orphans: 3;
162
- }
163
- }
164
- body {
165
- text-rendering: optimizeLegibility;
166
- }
167
-
168
- h1 {
169
- font-size: 25.5px;
170
- border-bottom: solid 2px #666;
171
- }
172
-
173
- h2 {
174
- font-size: 19.5px;
175
- }
176
-
177
- h3 {
178
- font-size: 18px;
179
- font-style: italic;
180
- }
181
-
182
- h4 {
183
- font-variant: small-caps;
184
- }
185
-
186
- h5, h6 {
187
- font-weight: bold;
188
- }
189
-
190
- p + p {
191
- text-indent: 22.5px;
192
- }
193
-
194
- pre, blockquote {
195
- border-left: solid 2px #ddd;
196
- background-color: #fdffe8;
197
- }
198
-
199
- blockquote {
200
- font-style: italic;
201
- }
202
-
203
- code {
204
- font-family: "Ubuntu Mono";
205
- }
@@ -1,38 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1">
6
- <title><%= (metadata.is_a?(Hash) && metadata['title']) || File.basename(source_file, '.*').tr('_-', ' ').split.map(&:capitalize).join(' ') %></title>
7
- <%= stylesheet_tag %>
8
- <style type="text/css"><%= inline_styles %></style>
9
- </head>
10
- <body>
11
- <div class="garden-container">
12
- <nav class="garden-nav">
13
- <div class="garden-nav-header">
14
- <h3>Garden</h3>
15
- </div>
16
- <div class="garden-nav-content">
17
- <% if files.any? %>
18
- <ul class="garden-toc">
19
- <% files.each do |file| %>
20
- <li class="depth-<%= file[:depth] %>">
21
- <a href="<%= file[:html_path] %>"
22
- class="<%= file[:source_path] == Pathname.new(source_file).relative_path_from(Pathname.new(root_directory)).to_s ? 'current' : '' %>">
23
- <%= file[:title] %>
24
- </a>
25
- </li>
26
- <% end %>
27
- </ul>
28
- <% end %>
29
- </div>
30
- </nav>
31
- <main class="garden-main">
32
- <div class="garden-content">
33
- <%= content %>
34
- </div>
35
- </main>
36
- </div>
37
- </body>
38
- </html>
@@ -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,16 +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
- <link rel="preconnect" href="https://fonts.googleapis.com">
7
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
8
- <link href="https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=Old+Standard+TT:ital,wght@0,400;0,700;1,400&display=swap" rel="stylesheet">
9
- <%= stylesheet_tag %>
10
- </head>
11
- <body>
12
- <main id="container">
13
- <div class="newspaper-columns"><%= content %></div>
14
- </main>
15
- </body>
16
- </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,9 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <%= stylesheet_tag %>
5
- </head>
6
- <body>
7
- <div id="container"><%= content %></div>
8
- </body>
9
- </html>
@@ -1,25 +0,0 @@
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
- }
@@ -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>