markdown-pdf-export 0.0.0-stage → 2.0.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.
@@ -0,0 +1,497 @@
1
+ /* Studio. A dark, warm workspace; the only bright things are sheets of paper:
2
+ the style thumbnails, the page diagram and the PDF itself. */
3
+ :root {
4
+ color-scheme: dark;
5
+ --bg: #262624;
6
+ --desk: #1f1e1d;
7
+ --surface: #30302e;
8
+ --raised: #3b3a37;
9
+ --rule: #45443f;
10
+ --text: #f0eee6;
11
+ --quiet: #a8a69d;
12
+ --accent: #d97757;
13
+ --accent-ink: #1f1e1d;
14
+ --ok: #8fcf9f;
15
+ --error: #f08a7e;
16
+ /* paper */
17
+ --paper: #ffffff;
18
+ --sheet-ink: #18212b;
19
+ --guide: #7cc4e0;
20
+ --guide-wash: #eaf6fb;
21
+ --ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
22
+ --display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
23
+ --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
24
+ }
25
+
26
+ * { box-sizing: border-box; }
27
+
28
+ html, body {
29
+ height: 100%;
30
+ margin: 0;
31
+ }
32
+
33
+ body {
34
+ font: 14px/1.45 var(--ui);
35
+ color: var(--text);
36
+ background: var(--desk);
37
+ }
38
+
39
+ .app {
40
+ display: grid;
41
+ grid-template-columns: minmax(380px, 440px) 1fr;
42
+ height: 100vh;
43
+ }
44
+
45
+ /* ── rail ───────────────────────────────────────────────────────────────── */
46
+ .rail {
47
+ display: grid;
48
+ grid-template-rows: auto 1fr auto;
49
+ min-height: 0;
50
+ background: var(--bg);
51
+ border-right: 1px solid var(--rule);
52
+ }
53
+
54
+ .rail-head {
55
+ padding: 18px 26px 12px;
56
+ border-bottom: 1px solid var(--rule);
57
+ }
58
+
59
+ h1 {
60
+ margin: 0;
61
+ font: 500 24px/1.15 var(--display);
62
+ letter-spacing: -0.01em;
63
+ }
64
+
65
+ .lede {
66
+ margin: 5px 0 0;
67
+ color: var(--quiet);
68
+ }
69
+
70
+ .rail-body {
71
+ min-height: 0;
72
+ overflow-y: auto;
73
+ padding: 0 26px 24px;
74
+ }
75
+
76
+ .group { padding: 16px 0 2px; }
77
+ .group + .group { border-top: 1px solid var(--rule); margin-top: 16px; }
78
+
79
+ h2 {
80
+ margin: 0 0 10px;
81
+ font: 500 17px/1.2 var(--display);
82
+ }
83
+
84
+ .hint {
85
+ margin: -4px 0 12px;
86
+ color: var(--quiet);
87
+ }
88
+
89
+ /* label on the left, control filling the rest */
90
+ .fields {
91
+ display: grid;
92
+ grid-template-columns: max-content 1fr;
93
+ align-items: center;
94
+ gap: 10px 14px;
95
+ }
96
+ .fields .pair { display: flex; gap: 8px; min-width: 0; }
97
+ .fields .pair > * { flex: 1; min-width: 0; }
98
+ .fields .pair > .fixed { flex: 0 0 auto; }
99
+ .fields .pair > select { flex: 0 0 104px; }
100
+ .fields.spaced { margin-top: 14px; }
101
+
102
+ .label { color: var(--quiet); }
103
+
104
+ .row {
105
+ display: flex;
106
+ flex-wrap: wrap;
107
+ align-items: center;
108
+ gap: 10px 18px;
109
+ margin-top: 12px;
110
+ }
111
+
112
+ /* ── controls ───────────────────────────────────────────────────────────── */
113
+ button, select, input { font: inherit; color: inherit; }
114
+
115
+ :focus-visible {
116
+ outline: 2px solid var(--accent);
117
+ outline-offset: 2px;
118
+ }
119
+
120
+ .seg {
121
+ display: flex;
122
+ border: 1px solid var(--rule);
123
+ border-radius: 8px;
124
+ background: var(--surface);
125
+ padding: 2px;
126
+ gap: 2px;
127
+ }
128
+ .seg.wrap { flex-wrap: wrap; }
129
+
130
+ .seg button {
131
+ flex: 1 1 auto;
132
+ border: 0;
133
+ border-radius: 6px;
134
+ background: transparent;
135
+ padding: 5px 10px;
136
+ cursor: pointer;
137
+ white-space: nowrap;
138
+ }
139
+ .seg.wrap button { padding-inline: 6px; font-size: 13px; }
140
+ .seg button:hover { background: var(--raised); }
141
+ .seg button[aria-checked="true"],
142
+ .seg button[aria-pressed="true"] {
143
+ background: var(--text);
144
+ color: var(--accent-ink);
145
+ }
146
+
147
+ select {
148
+ border: 1px solid var(--rule);
149
+ border-radius: 8px;
150
+ background: var(--surface);
151
+ padding: 7px 8px;
152
+ }
153
+
154
+ .check {
155
+ display: inline-flex;
156
+ align-items: center;
157
+ gap: 7px;
158
+ cursor: pointer;
159
+ }
160
+ .check input { accent-color: var(--accent); margin: 0; }
161
+
162
+ .color {
163
+ width: 34px;
164
+ height: 36px;
165
+ padding: 2px;
166
+ border: 1px solid var(--rule);
167
+ border-radius: 8px;
168
+ background: var(--surface);
169
+ cursor: pointer;
170
+ }
171
+
172
+ input[type="range"] { accent-color: var(--accent); }
173
+
174
+ .btn {
175
+ border: 1px solid var(--rule);
176
+ border-radius: 8px;
177
+ background: var(--surface);
178
+ padding: 8px 14px;
179
+ cursor: pointer;
180
+ }
181
+ .btn:hover { border-color: var(--quiet); background: var(--raised); }
182
+ .btn.primary {
183
+ border-color: var(--accent);
184
+ background: var(--accent);
185
+ color: var(--accent-ink);
186
+ font-weight: 600;
187
+ min-width: 96px;
188
+ }
189
+ .btn.primary:hover { filter: brightness(1.08); }
190
+ .btn.primary:disabled { opacity: 0.45; cursor: default; filter: none; }
191
+ .btn.quiet { border-color: transparent; background: transparent; padding: 6px 10px; }
192
+ .btn.quiet:hover { background: var(--raised); }
193
+ .btn.small { padding: 4px 10px; }
194
+
195
+ /* ── page style gallery ─────────────────────────────────────────────────── */
196
+ .looks {
197
+ display: grid;
198
+ grid-template-columns: repeat(5, 1fr);
199
+ gap: 10px;
200
+ }
201
+
202
+ .look {
203
+ display: grid;
204
+ gap: 6px;
205
+ justify-items: center;
206
+ border: 0;
207
+ background: transparent;
208
+ padding: 0;
209
+ cursor: pointer;
210
+ font-size: 12.5px;
211
+ color: var(--quiet);
212
+ }
213
+ .look[aria-checked="true"] { color: var(--text); }
214
+
215
+ .thumb {
216
+ display: grid;
217
+ align-content: start;
218
+ gap: 3px;
219
+ width: 100%;
220
+ aspect-ratio: 210 / 270;
221
+ padding: 16% 14% 0;
222
+ background: var(--paper);
223
+ border-radius: 2px;
224
+ overflow: hidden;
225
+ outline: 2px solid transparent;
226
+ outline-offset: 2px;
227
+ }
228
+ .look:hover .thumb { outline-color: var(--rule); }
229
+ .look[aria-checked="true"] .thumb { outline-color: var(--accent); }
230
+
231
+ .thumb i { display: block; height: 2px; background: #b9c2cb; }
232
+ .thumb .h { height: 4px; width: 62%; background: var(--sheet-ink); margin-bottom: 2px; }
233
+ .thumb .w80 { width: 80%; }
234
+ .thumb .w55 { width: 55%; }
235
+ .thumb .code { height: 13px; margin-top: 2px; background: #e7ebef; border-radius: 1px; }
236
+
237
+ .thumb.report .h { width: 100%; height: 5px; box-shadow: 0 3px 0 -1px var(--paper), 0 4px 0 -1px var(--sheet-ink); margin-bottom: 5px; }
238
+ .thumb.academic { padding-left: 22%; padding-right: 22%; }
239
+ .thumb.academic .h { margin-inline: auto; width: 70%; }
240
+ .thumb.academic .w80, .thumb.academic .w55 { width: 100%; }
241
+ .thumb.compact { gap: 2px; padding: 9% 9% 0; }
242
+ .thumb.compact i { height: 1.5px; }
243
+ .thumb.compact .h { height: 3px; }
244
+ .thumb.technical .h { width: 100%; height: 3px; box-shadow: 0 4px 0 #0969da; margin-bottom: 6px; }
245
+ .thumb.technical .code { background: #f1f5f9; border-left: 3px solid #0969da; }
246
+
247
+ /* ── the page diagram: edit the page by touching it ─────────────────────── */
248
+ .sheet {
249
+ color-scheme: light;
250
+ margin-top: 14px;
251
+ background: var(--paper);
252
+ color: var(--sheet-ink);
253
+ border-radius: 2px;
254
+ padding: 8px 0;
255
+ box-shadow: 0 14px 28px -16px rgba(0, 0, 0, 0.9);
256
+ }
257
+
258
+ /* side padding follows the chosen margins (set from the page logic) */
259
+ .band-box { padding: 0 var(--side, 14px); }
260
+ .band {
261
+ display: grid;
262
+ grid-template-columns: 1fr 1fr 1fr;
263
+ gap: 6px;
264
+ padding: 6px 0;
265
+ }
266
+ .band.lined-below { border-bottom: 1px solid #9aa5b1; }
267
+ .band.lined-above { border-top: 1px solid #9aa5b1; }
268
+
269
+ .slot {
270
+ min-height: 34px;
271
+ min-width: 0;
272
+ border: 1px dashed var(--guide);
273
+ border-radius: 3px;
274
+ background: transparent;
275
+ padding: 4px 6px;
276
+ font-size: 11.5px;
277
+ line-height: 1.25;
278
+ color: var(--sheet-ink);
279
+ cursor: pointer;
280
+ overflow: hidden;
281
+ text-overflow: ellipsis;
282
+ white-space: nowrap;
283
+ }
284
+ .slot img { display: block; max-height: 22px; max-width: 100%; }
285
+ .slot.center img { margin-inline: auto; }
286
+ .slot.right img { margin-left: auto; }
287
+ .slot.left { text-align: left; }
288
+ .slot.center { text-align: center; }
289
+ .slot.right { text-align: right; }
290
+ .slot.empty { color: #8fb9cb; }
291
+ .slot.filled { border-style: solid; border-color: transparent; background: var(--guide-wash); }
292
+ .slot:hover { border-style: solid; border-color: var(--sheet-ink); }
293
+ .slot[aria-pressed="true"] {
294
+ border-style: solid;
295
+ border-color: var(--accent);
296
+ box-shadow: 0 0 0 2px var(--accent);
297
+ background: var(--paper);
298
+ }
299
+ .slot.drop { border-style: solid; border-color: var(--accent); background: var(--guide-wash); }
300
+ .slot.locked { cursor: default; border-style: dotted; color: #5b6773; grid-column: 1 / -1; text-align: center; white-space: normal; }
301
+
302
+ .sheet-body {
303
+ display: grid;
304
+ gap: 6px;
305
+ padding: 12px var(--side, 14px);
306
+ }
307
+ .ln { display: block; height: 3px; border-radius: 2px; background: #e3e8ed; }
308
+ .ln.t { height: 6px; width: 46%; background: #c5cdd6; margin-bottom: 3px; }
309
+ .ln.s { width: 64%; }
310
+ .fold {
311
+ display: block;
312
+ height: 0;
313
+ margin: 5px calc(-1 * var(--side, 14px));
314
+ border-top: 1px dashed #b9c2cb;
315
+ }
316
+
317
+ .slot-editor {
318
+ margin-top: 12px;
319
+ min-height: 96px;
320
+ }
321
+ .slot-editor .title { margin-bottom: 6px; font-weight: 600; }
322
+ .slot-editor input[type="text"] {
323
+ width: 100%;
324
+ border: 1px solid var(--rule);
325
+ border-radius: 8px;
326
+ background: var(--surface);
327
+ padding: 8px 10px;
328
+ }
329
+ .slot-editor input[type="text"]:focus { border-color: var(--accent); outline: 1px solid var(--accent); outline-offset: 0; }
330
+ .slot-editor input::placeholder { color: var(--quiet); }
331
+ .slot-editor .empty-note { color: var(--quiet); padding-top: 8px; }
332
+
333
+ .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
334
+ .chip {
335
+ border: 1px solid var(--rule);
336
+ border-radius: 999px;
337
+ background: var(--surface);
338
+ padding: 2px 10px;
339
+ font-size: 12.5px;
340
+ cursor: pointer;
341
+ }
342
+ .chip:hover { border-color: var(--text); background: var(--raised); }
343
+ .chip.logo { border-style: dashed; background: transparent; }
344
+
345
+ .logo-row { display: flex; align-items: center; gap: 10px; }
346
+ .logo-row img { max-height: 34px; max-width: 120px; background: var(--paper); border-radius: 3px; padding: 3px; }
347
+ .logo-row .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 12px; color: var(--quiet); }
348
+ .size-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
349
+ .size-row input { flex: 1; min-width: 0; }
350
+ .size-row output { width: 4ch; text-align: right; font-variant-numeric: tabular-nums; }
351
+
352
+ /* ── notices ────────────────────────────────────────────────────────────── */
353
+ .notice {
354
+ margin-top: 14px;
355
+ border-left: 3px solid var(--accent);
356
+ background: var(--surface);
357
+ padding: 9px 12px;
358
+ }
359
+ .notice.bad { border-color: var(--error); }
360
+ .notice .btn { margin-top: 8px; }
361
+
362
+ /* ── save bar ───────────────────────────────────────────────────────────── */
363
+ .rail-foot {
364
+ display: grid;
365
+ gap: 9px;
366
+ padding: 11px 26px 14px;
367
+ border-top: 1px solid var(--rule);
368
+ background: var(--surface);
369
+ }
370
+ .where {
371
+ display: flex;
372
+ align-items: baseline;
373
+ justify-content: space-between;
374
+ gap: 12px;
375
+ min-width: 0;
376
+ }
377
+ .where span { flex-shrink: 0; }
378
+ .where code {
379
+ min-width: 0;
380
+ font: 11.5px var(--mono);
381
+ color: var(--quiet);
382
+ overflow: hidden;
383
+ text-overflow: ellipsis;
384
+ white-space: nowrap;
385
+ direction: rtl; /* long paths lose their start, not the file name */
386
+ }
387
+ #save-state.saved { color: var(--ok); font-weight: 600; }
388
+ #save-state.dirty { font-weight: 600; }
389
+ .actions { display: flex; gap: 8px; }
390
+ .rail-foot .actions .btn { flex: 1; background: var(--bg); }
391
+ .rail-foot .actions .btn.primary { flex: 1.4; background: var(--accent); }
392
+
393
+ /* ── desk ───────────────────────────────────────────────────────────────── */
394
+ .desk {
395
+ position: relative;
396
+ min-width: 0;
397
+ display: grid;
398
+ grid-template-rows: 1fr auto;
399
+ }
400
+ .frames { position: relative; }
401
+ .frames iframe {
402
+ position: absolute;
403
+ inset: 0;
404
+ width: 100%;
405
+ height: 100%;
406
+ border: 0;
407
+ background: var(--desk);
408
+ }
409
+ /* The next page loads underneath, then the two swap: no blank flash. */
410
+ .frames iframe.back {
411
+ opacity: 0;
412
+ pointer-events: none;
413
+ }
414
+ .status {
415
+ margin: 0;
416
+ padding: 7px 16px;
417
+ color: var(--quiet);
418
+ font-size: 12.5px;
419
+ background: #191817;
420
+ }
421
+ .status.busy::before {
422
+ content: "";
423
+ display: inline-block;
424
+ width: 7px;
425
+ height: 7px;
426
+ margin-right: 8px;
427
+ border-radius: 50%;
428
+ background: var(--accent);
429
+ animation: pulse 0.9s ease-in-out infinite alternate;
430
+ }
431
+ @keyframes pulse { from { opacity: 0.25; } to { opacity: 1; } }
432
+
433
+ .problem {
434
+ position: absolute;
435
+ left: 50%;
436
+ top: 28px;
437
+ transform: translateX(-50%);
438
+ width: min(520px, calc(100% - 48px));
439
+ background: var(--surface);
440
+ border: 1px solid var(--rule);
441
+ border-left: 4px solid var(--error);
442
+ border-radius: 4px;
443
+ padding: 14px 16px;
444
+ box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.8);
445
+ white-space: pre-wrap;
446
+ overflow-wrap: anywhere;
447
+ }
448
+ .problem strong { display: block; margin-bottom: 4px; }
449
+
450
+ /* ── editors dialog ─────────────────────────────────────────────────────── */
451
+ dialog {
452
+ width: min(680px, calc(100vw - 40px));
453
+ max-height: calc(100vh - 60px);
454
+ border: 1px solid var(--rule);
455
+ border-radius: 10px;
456
+ padding: 22px 24px;
457
+ color: var(--text);
458
+ background: var(--bg);
459
+ }
460
+ dialog::backdrop { background: rgba(0, 0, 0, 0.6); }
461
+ .dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
462
+ .dialog-head h2 { margin: 0; font-size: 21px; }
463
+ dialog .hint { margin: 0 0 6px; }
464
+
465
+ .editor { border-top: 1px solid var(--rule); padding: 14px 0 4px; }
466
+ .editor h3 { margin: 0 0 8px; font: 600 15px var(--ui); }
467
+ .editor h3 small { font-weight: 400; color: var(--quiet); margin-left: 6px; }
468
+ .step { margin-bottom: 12px; }
469
+ .step-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
470
+ .step-file { font: 11.5px var(--mono); color: var(--quiet); overflow-wrap: anywhere; margin: 2px 0 5px; }
471
+ .step pre {
472
+ margin: 0;
473
+ max-height: 150px;
474
+ overflow: auto;
475
+ background: var(--desk);
476
+ border: 1px solid var(--rule);
477
+ border-radius: 6px;
478
+ padding: 9px 11px;
479
+ font: 12px/1.45 var(--mono);
480
+ }
481
+ .step .result { margin-top: 5px; color: var(--ok); }
482
+ .step .result.bad { color: var(--error); }
483
+ details.others summary { cursor: pointer; padding: 12px 0; color: var(--quiet); border-top: 1px solid var(--rule); }
484
+
485
+ /* ── small screens: form first, preview below ───────────────────────────── */
486
+ @media (max-width: 860px) {
487
+ .app { grid-template-columns: 1fr; height: auto; }
488
+ .rail { grid-template-rows: auto auto auto; border-right: 0; }
489
+ .rail-body { overflow: visible; }
490
+ .rail-foot { position: sticky; bottom: 0; }
491
+ .desk { height: 80vh; }
492
+ .looks { grid-template-columns: repeat(5, minmax(56px, 1fr)); overflow-x: auto; }
493
+ }
494
+
495
+ @media (prefers-reduced-motion: reduce) {
496
+ .status.busy::before { animation: none; }
497
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "$schema": "https://matinfo.github.io/markdown-pdf-export/schema/settings.schema.json",
3
+ "font_family": "Times New Roman, Georgia, serif",
4
+ "margin": {
5
+ "top": "25mm",
6
+ "right": "25mm",
7
+ "bottom": "25mm",
8
+ "left": "25mm"
9
+ },
10
+ "header": {
11
+ "height": "12mm",
12
+ "padding": "0 20mm",
13
+ "font_size": "10px",
14
+ "font_style": "italic",
15
+ "color": "#555",
16
+ "border_bottom": "0.5px solid #ccc",
17
+ "left_text": "{author}",
18
+ "right_text": "{title}"
19
+ },
20
+ "footer": {
21
+ "height": "12mm",
22
+ "padding": "0 20mm",
23
+ "font_size": "10px",
24
+ "center_text": "{page}"
25
+ }
26
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "$schema": "https://matinfo.github.io/markdown-pdf-export/schema/settings.schema.json",
3
+ "assets_directory": "assets",
4
+ "margin": {
5
+ "top": "25mm",
6
+ "bottom": "20mm"
7
+ },
8
+ "header": {
9
+ "height": "18mm",
10
+ "padding": "0 15mm",
11
+ "border_bottom": "2px solid #0066cc",
12
+ "left_image": "@/company-logo.svg",
13
+ "left_image_height": "14mm",
14
+ "center_text": "{title}",
15
+ "right_text": "{date:MMMM d, yyyy}"
16
+ },
17
+ "footer": {
18
+ "height": "10mm",
19
+ "padding": "0 15mm",
20
+ "font_size": "8px",
21
+ "color": "#666",
22
+ "center_text": "Page {page} of {pages}"
23
+ }
24
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "$schema": "https://matinfo.github.io/markdown-pdf-export/schema/settings.schema.json",
3
+ "footer": {
4
+ "center_text": "Page {page} of {pages}"
5
+ }
6
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "$schema": "https://matinfo.github.io/markdown-pdf-export/schema/settings.schema.json",
3
+ "header": {
4
+ "height": "15mm",
5
+ "left_text": "{title}",
6
+ "right_text": "{date:yyyy-MM-dd}"
7
+ },
8
+ "footer": {
9
+ "height": "10mm",
10
+ "center_text": "Page {page} of {pages}"
11
+ }
12
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "$schema": "https://matinfo.github.io/markdown-pdf-export/schema/settings.schema.json",
3
+ "assets_directory": "assets",
4
+ "margin": {
5
+ "top": "28mm",
6
+ "bottom": "22mm"
7
+ },
8
+ "header": {
9
+ "height": "22mm",
10
+ "padding": "0 15mm",
11
+ "border_bottom": "1px solid #ddd",
12
+ "left_image": "@/our-logo.svg",
13
+ "left_image_height": "18mm",
14
+ "center_text": "{title}",
15
+ "right_image": "@/partner-logo.svg",
16
+ "right_image_height": "18mm"
17
+ },
18
+ "footer": {
19
+ "height": "12mm",
20
+ "padding": "0 15mm",
21
+ "font_size": "8px",
22
+ "color": "#666",
23
+ "left_text": "© {date:yyyy} Company Name",
24
+ "center_text": "Page {page} of {pages}",
25
+ "right_text": "Confidential"
26
+ }
27
+ }