-
Notifications
You must be signed in to change notification settings - Fork 1
/
framework.html
697 lines (624 loc) · 20.6 KB
/
framework.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
<!DOCTYPE html>
<html>
<head>
<meta content="MarkDown Monolith Assembler version 1.03" name=
"generator">
<title>
Default Framework
</title>
<meta content="text/html; charset=utf-8" http-equiv=
"content-type">
<meta content="width=device-width, initial-scale=1" name=
"viewport">
<style>
:root {
--MDMA-AGENDA-TARGET-COLOR: green;
--smallest-width: 320px;
--content-padding: 10dvmin;
--content-width: max(
min(100dvh - var(--content-padding), 100dvw), 72dvw
);
--content-height: min(
max(
100dvh - var(--content-padding),
200dvh - var(--content-padding) - 100dvw
), 100dvh
);
--menu-width: 12rem;
--menu-burger-width: 2rem;
--menu-burger-height: 1.5rem;
--menu-header-height: var(--menu-burger-height);
--menu-footer-height: var(--menu-header-height);
--menu-agenda-max-height: calc(
100dvh - var(--menu-header-height) - var(--menu-footer-height)
);
--menu-transition-speed: 0.2s;
--md-page-max-width: 980px;
--border-radius: 1rem;
}
*, ::before, ::after {
box-sizing: border-box;
margin: 0;
padding: 0;
}
html, body, .container {
height:100%;
width:100%;
overflow: hidden;
white-space: nowrap;
}
.container {
background: linear-gradient(to right, silver, gray);
background-repeat: no-repeat;
background-size: cover;
background-position: center center;
text-align: right;
display: grid;
place-items: center end;
}
#MDMA-LOADER {
position: absolute;
top: 0;
left: 0;
width: var(--MDMA-PAGE-LOADED);
height: max(0.5dvh, 2px);
background-color: rgba(20,109,148,0.5);
opacity: var(--MDMA-LOADER-OPACITY);
pointer-events: none;
transition: opacity 0.5s ease, width 0.25s ease;
z-index: 1;
}
.content {
position: relative;
display: inline-block;
overflow: visible;
width: 100%;
height: var(--content-height);
vertical-align: middle;
}
#width-guard {
position: absolute;
display: inline-block;
top: 0;
left: 0;
width: calc(
(
var(--smallest-width) + var(--menu-width) - var(--content-width)
) * 10000
);
min-width: 0px;
max-width: 1px;
container-type: inline-size;
}
#width-guard > div {
position: absolute;
display: inline-block;
top: 0;
left: 0;
width: 100dvw;
height: 100dvh;
}
.md-page {
position: absolute;
top: 0;
left: calc(100% - var(--content-width));
width: var(--content-width);
height: 100%;
max-width: var(--md-page-max-width);
border-radius: var(--border-radius);
pointer-events: none;
box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;
overflow: hidden;
background-color: silver;
}
.md-page > div:first-child {
position: absolute;
top: var(--border-radius);
left: 0;
right: 0;
bottom: var(--border-radius);
box-shadow: rgba(99, 99, 99, 0.1) 0px 0px 1px 1px;
}
.md-page > div:nth-child(2) {
position: absolute;
left: 0;
right: 0;
bottom: 0;
height: var(--border-radius);
line-height: var(--border-radius);
text-align: center;
font-size: x-small;
color: rgba(99, 99, 99, 0.5);
}
#MDMA-CONTENT {
position: absolute;
top: var(--border-radius);
left: 0;
right: 0;
bottom: var(--border-radius);
width: 100%;
text-align: left;
overflow-y: scroll;
overflow-x: hidden;
z-index: 0;
background-color: transparent;
padding-left: calc(100% - var(--content-width));
}
#burger {
position: absolute;
top: 0;
left: 0;
display: none;
}
.menu {
position: absolute;
top: 0;
right: 0;
bottom: 0;
width: clamp(
min(var(--menu-burger-width), var(--menu-width)),
100%,
min(var(--menu-width), 100%)
);
z-index: 1;
pointer-events: none;
overflow: visible;
transition: width var(--menu-transition-speed) linear;
}
.options {
position: absolute;
top: 0;
right: 0;
width: 100%;
text-align: left;
pointer-events: auto;
overflow: hidden;
max-height: 100%;
background-color: transparent;
box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;
backdrop-filter: blur(8px);
border-top-left-radius: var(--border-radius);
border-bottom-left-radius: var(--border-radius);
}
.options-bg {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: white;
z-index: -1;
opacity: 0.25;
}
.menu-header, .menu-footer {
height: var(--menu-header-height);
line-height: var(--menu-header-height);
}
.menu-footer {
height: var(--menu-footer-height);
line-height: var(--menu-footer-height);
font-size: x-small;
text-align: center;
width: var(--menu-width);
color: rgba(99, 99, 99, 0.3);
}
.menu-footer a {
opacity: 0.3;
}
.menu-header, .menu-footer {
overflow: hidden;
box-shadow: rgba(99, 99, 99, 0.1) 0px 0.5px 1px 0px;
}
#MDMA-AGENDA {
padding: 0.5rem;
padding-right: 0;
overflow-x: hidden;
overflow-y: auto;
max-height: var(--menu-agenda-max-height);
box-shadow: rgba(99, 99, 99, 0.1) 0px 0.5px 1px 0px;
}
#MDMA-AGENDA a {
display: block;
text-overflow: ellipsis;
overflow: hidden;
}
#MDMA-AGENDA div > div {
padding-left: 0.5rem;
transition: padding-left var(--menu-transition-speed) ease;
}
.MDMA-VIDEO-CONTAINER {
position: relative;
}
.MDMA-VIDEO-CONTAINER iframe {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
width: 100%;
height: 100%;
border: none;
}
.tab {
position: relative;
display: block;
width: max(var(--content-width) - var(--menu-width), 0%);
overflow: visible;
padding: 1rem;
padding-right: var(--menu-burger-width);
white-space: normal;
max-width: var(--md-page-max-width);
}
.tab img {
max-width: 100%;
max-height: 100%;
height: auto;
}
.tab:not(:has(a:target)) {
display: none;
}
#MDMA-CONTENT:not(:has(a:target)) > :first-child {
display: block;
}
#MDMA-AGENDA a + div {
font-size: inherit;
transition: font-size 0.3s ease-in;
overflow: hidden;
}
label[for="burger"] {
display: block;
text-align: right;
pointer-events: none;
padding-right: 0.5rem;
}
label[for="burger"]::after {
content: "✖";
opacity: 0;
transition: opacity var(--menu-transition-speed) linear;
}
@container (min-width: 1px) {
label[for="burger"]::after {
opacity: 1;
pointer-events: all;
cursor: pointer;
}
:not(#burger:checked) + .menu label[for="burger"]::after {
content: "☰";
}
:not(#burger:checked) + .menu{
width: min(var(--menu-burger-width), var(--menu-width));
}
:not(#burger:checked) + .menu #MDMA-AGENDA div > div {
padding-left: 0rem;
}
.tab {
width: 100%;
}
}
</style>
<style class="MDMA-AUTOGENERATED">
:root {--MDMA-LOADER-OPACITY: 100%; --MDMA-PAGE-LOADED: 0%;}
body:has(#About:target) #MDMA-AGENDA a[href="#About"],
body:has(#Usage:target) #MDMA-AGENDA a[href="#Usage"],
body:has(#Synopsis:target) #MDMA-AGENDA a[href="#Synopsis"],
body:has(#Build-Instructions:target) #MDMA-AGENDA a[href="#Build-Instructions"],
body:has(#Dependencies:target) #MDMA-AGENDA a[href="#Dependencies"],
body:has(#Showcase:target) #MDMA-AGENDA a[href="#Showcase"],
body:has(#License:target) #MDMA-AGENDA a[href="#License"] {
color: var(--MDMA-AGENDA-TARGET-COLOR);
}
body:not(
:has(#Usage:target),
:has(#Dependencies:target),
:has(#Build-Instructions:target),
:has(#Synopsis:target)
) #MDMA-AGENDA a[href="#Usage"] + div {
font-size: 0;
transition: font-size 0.2s ease-out;
}
</style>
</head>
<body>
<div id="MDMA-LOADER">
</div>
<div id="width-guard">
<div>
<div class="container">
<div class="content">
<div class="md-page">
<div>
</div>
<div>
©<span id="MDMA-YEAR">2024</span>
</div>
</div>
<div id="MDMA-CONTENT">
<article class="tab">
<h1>
<a href="#About" id="About" target="_self">About
<style class="MDMA-AUTOGENERATED">
:root {--MDMA-PAGE-LOADED: 14%;}
</style></a>
</h1>
<p>
In this context MDMA stands for "MarkDown
Monolith Assembler". It is a command line tool
for building elegant browser-based books using
the Markdown markup language.
</p>
<p>
When given a markdown document as an input, this
program produces a monolithic JavaScript-free
HTML5 application as an output. For example, from
this very <em>readme</em> file an HTML document
would be generated that renders as shown in the
below screenshot.
</p>
<table>
<thead>
<tr>
<th style="text-align: center;">
<a href=
"https://raw.githack.com/1Hyena/mdma/master/framework.html"
target="_blank" title=
"Click to see this document in your web browser">
<img alt="Screenshot" loading="lazy" src=
"screenshot.jpg"></a>
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: center;">
Screenshot depicting how this document
renders in the Chromium web browser
</td>
</tr>
</tbody>
</table>
<p>
To see a live demo of this document in the format
of an HTML application, click on the above
screenshot and the respective page will open in
your web browser.
</p>
</article>
<article class="tab">
<h1>
<a href="#Usage" id="Usage" target="_self">Usage
<style class="MDMA-AUTOGENERATED">
:root {--MDMA-PAGE-LOADED: 28%;}
</style></a>
</h1>
<p>
MDMA makes use of the standard input, output and
error streams and follows the <em>garbage in,
garbage out</em> (GIGO) principle by design. If
the program is started with the <code>-h</code>
(short for <code>--help</code>) argument, then it
will only print its usage synopsis and exit.
</p>
<p>
In the following sections the usage synopsis is
given, followed by the most common build
instructions. Finally, libraries that need to be
installed on the host system for successful
compilation are listed.
</p>
<h2>
<a href="#Synopsis" id="Synopsis" target=
"_self">Synopsis
<style class="MDMA-AUTOGENERATED">
:root {--MDMA-PAGE-LOADED: 42%;}
</style></a>
</h2>
<pre><code>Usage: mdma [OPTION]... [FILE]
General options:
--brief Print brief messages (default).
--debug Print debugging messages.
-f --framework Use a custom HTML framework file.
-h --help Display this usage information.
--minify Disable HTML indentation and wrapping.
--monolith Embed images and styles within the output.
-o --output Specify the output file (standard output).
-p --preview Set the image preview shrinking factor (8).
--verbose Print verbose messages.
-v --version Show version information.
Markdown dialect options:
--commonmark Use the CommonMark syntax.
--github Use Github flavored markdown (default).
</code></pre>
<p>
If the <em>FILE</em> argument is missing, the
program will attempt to read a markdown document
from its standard input.
</p>
<h2>
<a href="#Build-Instructions" id=
"Build-Instructions" target="_self">Build
Instructions
<style class="MDMA-AUTOGENERATED">
:root {--MDMA-PAGE-LOADED: 57%;}
</style></a>
</h2>
<p>
MDMA is written in C++ and should be trivial to
compile on most Linux based systems. Just go to
the <em>src</em> directory and type
<em>make</em>. If compilation fails, then most
likely you are missing some of the required
dependencies listed in the following section.
</p>
<h2>
<a href="#Dependencies" id="Dependencies" target=
"_self">Dependencies
<style class="MDMA-AUTOGENERATED">
:root {--MDMA-PAGE-LOADED: 71%;}
</style></a>
</h2>
<p>
In order to compile this program from its
<em>Makefile</em>, the following libraries and
their respective header files must be present in
the system.
</p>
<ul>
<li>
<p>
<a href="https://github.com/mity/md4c"
target="_blank">md4c</a> — C Markdown parser
</p>
</li>
<li>
<p>
<a href=
"https://github.com/leethomason/tinyxml2"
target="_blank">tinyxml2</a> — Simple XML
parser made for easy integration
</p>
</li>
<li>
<p>
<a href="https://www.html-tidy.org/" target=
"_blank">tidy</a> — A tool to tidy down HTML
code to a clean style
</p>
</li>
<li>
<p>
<a href=
"https://github.com/uriparser/uriparser"
target="_blank">uriparser</a> — Strictly RFC
3986 compliant URI parsing and handling
library written in C89
</p>
</li>
<li>
<p>
<a href=
"https://docs.enlightenment.org/api/imlib2/html/"
target="_blank">imlib2</a> — Library that
does image file loading, saving and
manipulation
</p>
</li>
<li>
<p>
<a href=
"https://developers.google.com/speed/webp"
target="_blank">webp</a> — Library that
handles the WebP image format
</p>
</li>
<li>
<p>
<a href="https://curl.se/" target=
"_blank">curl</a> — Command line tool and
library for transferring data with URLs
</p>
</li>
</ul>
</article>
<article class="tab">
<h1>
<a href="#Showcase" id="Showcase" target=
"_self">Showcase
<style class="MDMA-AUTOGENERATED">
:root {--MDMA-PAGE-LOADED: 85%;}
</style></a>
</h1>
<p>
Next, some of the projects that have put MarkDown
Monolith Assembler into a good use are listed.
</p>
<table>
<thead>
<tr>
<th style="text-align: center;">
<img alt="Screenshot" loading="lazy" src=
"showcase/ericherstu.net.jpg">
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: center;">
<a href="https://ErichErstu.net/" target=
"_blank">ErichErstu.net</a>
</td>
</tr>
</tbody>
</table>
<table>
<thead>
<tr>
<th style="text-align: center;">
<img alt="Screenshot" loading="lazy" src=
"showcase/stonia.net.ee.jpg">
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: center;">
<a href="https://Stonia.net.ee/" target=
"_blank">Stonia.net.ee</a>
</td>
</tr>
</tbody>
</table>
</article>
<article class="tab">
<h1>
<a href="#License" id="License" target=
"_self">License
<style class="MDMA-AUTOGENERATED">
:root {--MDMA-PAGE-LOADED: 100%;}
</style></a>
</h1>
<p>
MarkDown Monolith Assembler has been authored by
Erich Erstu and is released under the <a href=
"LICENSE" target="_blank">MIT</a> license.
</p>
</article>
</div>
</div>
</div>
<input id="burger" name="burger" type="checkbox" value=
"value">
<div class="menu">
<div class="options">
<div class="options-bg">
</div>
<div class="menu-header">
<label for="burger"></label>
</div>
<div id="MDMA-AGENDA">
<div>
<a href="#About" target="_self">About</a><a href=
"#Usage" target="_self">Usage</a>
<div>
<a href="#Synopsis" target=
"_self">Synopsis</a><a href="#Build-Instructions"
target="_self">Build Instructions</a><a href=
"#Dependencies" target="_self">Dependencies</a>
</div>
<a href="#Showcase" target=
"_self">Showcase</a><a href="#License" target=
"_self">License</a>
</div>
</div>
<div class="menu-footer">
Powered by <a href="https://github.com/1Hyena/mdma"
target="_blank">MDMA</a>
</div>
</div>
</div>
</div>
</div>
<style class="MDMA-AUTOGENERATED">
:root {--MDMA-LOADER-OPACITY: 0%;}
</style>
</body>
</html>