-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsource-code.html
1266 lines (1154 loc) · 95.1 KB
/
source-code.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
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!-- 2022-W11-4 02:12 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Website Source Code</title>
<meta name="author" content="Inanna" />
<meta name="description" content="The source code for my blog, presented in a nice HTML file with commentary." />
<meta name="generator" content="Org Mode" />
<link href="/site.css" rel="stylesheet" type="text/css" /><link href="images/website-icon.png" rel="icon" />
</head>
<body>
<div id="preamble" class="status">
<div><a href="/index.html"><img alt="An abstract logo representing a series of three assembly line stamping machines with the words CONS, DEV, and embalzoned in white on each machine." id="site-logo" src="/images/website-logo.png" /></a></div>
</div>
<div id="content" class="content">
<h1 class="title">Website Source Code</h1>
<div id="table-of-contents" role="doc-toc">
<h2>Table of Contents</h2>
<div id="text-table-of-contents" role="doc-toc">
<ul>
<li><a href="#orga84625d">Introduction</a>
<ul>
<li><a href="#org8276bc8">Some History</a></li>
<li><a href="#org19476de">Implementation Concept</a></li>
</ul>
</li>
<li><a href="#orgbbae0d1">Lein Setup</a></li>
<li><a href="#org201a791">Website Setup</a>
<ul>
<li><a href="#org1603934">Website Info</a></li>
<li><a href="#org51ba0fe">Source Directories</a></li>
<li><a href="#org7bd9a88">Domain Data</a></li>
<li><a href="#org1ffb19c">Sitemap</a></li>
<li><a href="#org4298678">Publishing Function</a></li>
<li><a href="#org3d7fab0">Inserting Footnotes as Side Notes</a></li>
<li><a href="#org9dc9f02">Directory Local Variables</a></li>
<li><a href="#org60b31b4">Git Setup</a></li>
</ul>
</li>
<li><a href="#orgca3028e">HTML</a>
<ul>
<li><a href="#orgd9c097e">Dependencies</a></li>
<li><a href="#org323040f">Preamble and Postamble</a>
<ul>
<li><a href="#org35fa209">License Info</a></li>
<li><a href="#org982071b">Preamble</a></li>
<li><a href="#org32b7e29">Postamble</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#org040bb70">Stylesheets</a>
<ul>
<li><a href="#org6f3fcc0">Dependencies</a></li>
<li><a href="#org7b595a5">Emacs Configuration</a></li>
<li><a href="#org082038d">Create CSS File</a></li>
<li><a href="#org8add767">Background and Foreground</a></li>
<li><a href="#orgc7eb402">Tables</a></li>
<li><a href="#org9cf3001">Lists</a></li>
<li><a href="#org5a5f437">Verses and Quotes</a></li>
<li><a href="#orga2f8479">Embedded Content</a></li>
<li><a href="#orgb871747">Dynamic Size Switching</a>
<ul>
<li><a href="#org2b47d9e">Non Dynamic Style</a></li>
<li><a href="#org7b5d43a">Wide Screen</a></li>
<li><a href="#org1531579">Narrow Screen</a></li>
</ul>
</li>
<li><a href="#org0f0cd9b">Selected Text</a></li>
<li><a href="#org6d87a67">Headlines</a></li>
<li><a href="#orgdd24c5d">Author and Title Information</a></li>
<li><a href="#org2f26de9">Code Blocks</a>
<ul>
<li><a href="#org2ef87a3">Blocks</a></li>
<li><a href="#orga4ac295">Hover Info</a></li>
</ul>
</li>
<li><a href="#orgb23ac4b">Links</a></li>
<li><a href="#org1240fe7">Helper Code Blocks</a></li>
</ul>
</li>
</ul>
</div>
</div>
<blockquote>
<p>
Programs must be written for people to read, and only incidentally for machines to execute.
</p>
<p>
– Harld Abelson, The Structure and Interpretation of Computer Programs
</p>
</blockquote>
<div id="outline-container-orga84625d" class="outline-2">
<h2 id="orga84625d">Introduction</h2>
<div class="outline-text-2" id="text-orga84625d">
<p>
This is my the source code for my website. Currently it's only CSS, some emacs config, and a bit of HTML, but eventually I intend to add features for running ClojureScript in source code blocks among other things. Changes to this file will be noted in the <a href="changelog.html#ID-fde20eb9-16be-4f58-a5b1-b58aaad47cb6">changelog</a>.
</p>
<p>
The entire document is done in a nonlinear format, so each section does not exactly relate to an individual file, but rather combines the various files used into one. If you want to get to the code, just skip the intro and go straight to <a href="#orgbbae0d1">Lein Setup</a>.<label class="sidenote-number" for="1"><sup>1</sup></label><input checked="checked" id="1" style="display:none" type="checkbox" /><span class="sidenote"><span class="sidenote-number"> 1</span> Leinigen is great, though it's kind of interesting to note the transformation from the macro-heavy sort of language of Leinigen and the macro-free setup of things like <a href="https://github.com/noprompt/garden">garden</a>.</span>
</p>
</div>
<div id="outline-container-org8276bc8" class="outline-3">
<h3 id="org8276bc8">Some History</h3>
<div class="outline-text-3" id="text-org8276bc8">
<p>
I have been blogging (and attempting to make websites) for a few years, however with each website I built I would run into a number of issues.
</p>
<p>
In the beginning my issue was HTML, CSS, and JavaScript. All of them sucked quite a bit.
</p>
<p>
Initially it was just that the blog was in markdown and had a somewhat messy system to generate it from the markdown files using ruby.
</p>
<p>
I have also recently been organizing my OS and system configuration into a giant wiki<label class="sidenote-number" for="2"><sup>2</sup></label><input checked="checked" id="2" style="display:none" type="checkbox" /><span class="sidenote"><span class="sidenote-number"> 2</span> So far it's been going really well. given how my projects tend to go.</span>, so compatibility with that was also a necessary feature. I had attempted to do blogging in org mode before as well, though the <a href="https://github.com/kaushalmodi/ox-hugo">ox-hugo</a> option both lacked some features I wanted and left me with a somewhat lackluster experience when it came to linking files together. I probably was simply inexperienced, but it still left a bad taste in my mouth and didn't make me optimistic about the idea of having a public section to my personal wiki
</p>
<p>
However, when I read about the org-publish feature, I was very interested in writing my own website with it. So far the simple export feature has been all that it was advertised to be and seems to be more than sufficient to make a good blog.
</p>
</div>
</div>
<div id="outline-container-org19476de" class="outline-3">
<h3 id="org19476de">Implementation Concept</h3>
<div class="outline-text-3" id="text-org19476de">
<p>
The implementation itself is designed to be entirely local to this directory. So providing the org files should be roughly equivalent to providing the site itself (minus the color scheme of my Emacs configuration). It also adds free content if you will to the site.
</p>
</div>
</div>
</div>
<div id="outline-container-orgbbae0d1" class="outline-2">
<h2 id="orgbbae0d1">Lein Setup</h2>
<div class="outline-text-2" id="text-orgbbae0d1">
<p>
This sets up the Clojure project. Right now I don't actually really use the project per-se, but rather use it to generate CSS and HTML code from code blocks. Eventually I intend to add the ability to run ClojureScript in code blocks, but for now this works.
</p>
<div class="org-src-container">
<pre class="src src-clojure"><span style="color: #494949;">(</span><span style="color: #E53935; font-style: italic;">defproject</span> <span style="font-weight: bold; font-style: italic;">cons-blog</span> <span style="color: #494949;">"1.0.0"</span>
<span style="color: #E53935;">:description</span> <span style="color: #494949;">"Generate HTML and CSS for org mode export."</span>
<span style="color: #E53935;">:dependencies</span> <span style="color: #bbb;">[</span><span style="color: #494949;">[</span><span style="color: #E53935;">org.clojure</span>/clojure <span style="color: #494949;">"1.10.2"</span><span style="color: #494949;">]</span>
<span style="color: #494949;">[</span><span style="color: #E53935;">org.clojure</span>/clojurescript <span style="color: #494949;">"1.10.891"</span><span style="color: #494949;">]</span>
<span style="color: #494949;">[</span><span style="color: #E53935;">org.clojure</span>/math.combinatorics <span style="color: #494949;">"0.1.6"</span><span style="color: #494949;">]</span>
<span style="color: #494949;">[</span><span style="color: #E53935;">org.clojure</span>/math.numeric-tower <span style="color: #494949;">"0.0.4"</span><span style="color: #494949;">]</span>
<span style="color: #494949;">[</span><span style="color: #E53935;">org.clojure</span>/core.match <span style="color: #494949;">"1.0.0"</span><span style="color: #494949;">]</span>
<span style="color: #494949;">[</span><span style="color: #E53935;">org.clojure</span>/core.logic <span style="color: #494949;">"1.0.0"</span><span style="color: #494949;">]</span>
<span style="color: #494949;">[</span><span style="color: #E53935;">lambdaisland</span>/regal <span style="color: #494949;">"0.0.143"</span><span style="color: #494949;">]</span>
<span style="color: #494949;">[</span><span style="color: #E53935;">com.cerner</span>/clara-rules <span style="color: #494949;">"0.21.1"</span><span style="color: #494949;">]</span>
<<stylesheet-deps>>
<<html-deps>><span style="color: #bbb;">]</span><span style="color: #494949;">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org201a791" class="outline-2">
<h2 id="org201a791">Website Setup</h2>
<div class="outline-text-2" id="text-org201a791">
<p>
This is the Emacs Lisp code used to define the website. I use the <a href="https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html">per-directory local variable</a> functionality to set the <code>org-html-publish</code> settings.<label class="sidenote-number" for="3"><sup>3</sup></label><input checked="checked" id="3" style="display:none" type="checkbox" /><span class="sidenote"><span class="sidenote-number"> 3</span> For a while this was broken with some mysterious errors where my settings would be reset after a single run. It turned out that I had actually set the dir-locals in this directory with a hidden file that I had forgotten about. Oops.</span>
</p>
</div>
<div id="outline-container-org1603934" class="outline-3">
<h3 id="org1603934">Website Info</h3>
<div class="outline-text-3" id="text-org1603934">
<p>
This gets the website info and sets the directories relative to the current one. It also sets the website name, adds the basic HTML publish / indent features, and excludes drafts from the project. (idea taken from <a href="https://www.john2x.com/blog/blogging-with-orgmode.html">John Louis Del Rosario</a>).
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp" id="orgce2bd3f"><span style="color: #494949;">"(cons dev nil) org"</span>
<span style="color: #E53935;">:language</span> <span style="color: #494949;">"en"</span>
<span style="color: #E53935;">:author</span> <span style="color: #494949;">"Inanna"</span>
<span style="color: #E53935;">:exclude</span> <span style="color: #494949;">"level-.*</span><span style="color: #000; font-weight: bold;">\\</span><span style="color: #000; font-weight: bold;">|</span><span style="color: #494949;">.*</span><span style="color: #E64A19;">\</span><span style="color: #494949;">.draft</span><span style="color: #E64A19;">\</span><span style="color: #494949;">.org"</span>
<span style="color: #E53935;">:html-metadata-timestamp-format</span> <span style="color: #494949;">"%G-W%V-%u %H:%M"</span>
<span style="color: #E53935;">:section-numbers</span> nil
<span style="color: #E53935;">:publishing-function</span> org-html-publish-to-tufte-html
<span style="color: #E53935;">:html-html5-fancy</span> t
<span style="color: #E53935;">:html-head-include-default-style</span> nil
<span style="color: #E53935;">:html-indent</span> nil
</pre>
</div>
</div>
</div>
<div id="outline-container-org51ba0fe" class="outline-3">
<h3 id="org51ba0fe">Source Directories</h3>
<div class="outline-text-3" id="text-org51ba0fe">
<p>
As of generating this file, thce directory above it contains the following files.
</p>
<pre class="example" id="org44be4da">
total 68
-rw-r--r-- 1 1000 998 17556 Feb 24 15:07 .cider-repl-history
drwxr-xr-x 2 1000 998 4096 Dec 10 18:37 classes
-rw-r--r-- 1 1000 998 5793 Mar 17 02:10 .dir-locals.el
-rw-r--r-- 1 1000 998 34 Jul 29 2021 .git
-rw-r--r-- 1 1000 998 240 Mar 17 02:10 .gitignore
-rw-r--r-- 1 1000 998 73 Dec 10 18:34 hello.clj
-rw-r--r-- 1 1000 998 5 Mar 17 01:42 .nrepl-port
-rw-r--r-- 1 1000 998 580 Mar 17 02:10 project.clj
drwxr-xr-x 7 1000 998 4096 Mar 17 02:12 public
drwxr-xr-x 8 1000 998 4096 Mar 17 02:10 src
drwxr-xr-x 4 1000 998 4096 Jan 9 23:47 target
-rw-r--r-- 1 1000 998 4050 Dec 2 14:01 test.css
</pre>
<p>
The <code>project.clj</code> and <code>target</code> directories are automatically generated as are the dotfiles, while the <code>src</code> and <code>public</code> directories are not generated by any code. The <code>src</code> directory of course contains the org files while the <code>public</code> contains exported HTML. We set variables for these since the <a href="#org4298678">publishing function</a> (WIP) also needs to know the directories. To find the location of the project itself I use <a href="https://github.com/bbatsov/projectile">projectile</a>.<label class="sidenote-number" for="4"><sup>4</sup></label><input checked="checked" id="4" style="display:none" type="checkbox" /><span class="sidenote"><span class="sidenote-number"> 4</span> I can't help but shill for projectile. It's one of the better Emacs packages out there and allows you to quickly search through your directories.</span>
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp" id="org8ed59f9"><span style="color: #494949;">(</span>cd-source-dir <span style="color: #bbb;">(</span>concat <span style="color: #494949;">(</span>projectile-project-root<span style="color: #494949;">)</span> <span style="color: #494949;">"src/"</span><span style="color: #bbb;">)</span><span style="color: #494949;">)</span>
<span style="color: #494949;">(</span>cd-publish-dir <span style="color: #bbb;">(</span>concat <span style="color: #494949;">(</span>projectile-project-root<span style="color: #494949;">)</span> <span style="color: #494949;">"public/"</span><span style="color: #bbb;">)</span><span style="color: #494949;">)</span>
</pre>
</div>
<p>
Here we add them to the project configuration. The <code>:base-directory</code> property is source for the project and the <code>:publishing-directory</code> is where the results of exporting are to be placed.
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp" id="orga1b368c"><span style="color: #E53935;">:base-directory</span> ,cd-source-dir
<span style="color: #E53935;">:publishing-directory</span> ,cd-publish-dir
</pre>
</div>
</div>
</div>
<div id="outline-container-org7bd9a88" class="outline-3">
<h3 id="org7bd9a88">Domain Data</h3>
<div class="outline-text-3" id="text-org7bd9a88">
<p>
This adds the CNAME data to the file. This is required for the site to serve properly under the A record I set up for it.
</p>
<div class="org-src-container">
<pre class="src src-text">cons.dev
</pre>
</div>
</div>
</div>
<div id="outline-container-org1ffb19c" class="outline-3">
<h3 id="org1ffb19c">Sitemap</h3>
<div class="outline-text-3" id="text-org1ffb19c">
<p>
This configures the sitemap title and name. It is automatically generated for all pages to make my life easier. Currently I use a flat layout for my website, so it is simply a list of all nodes. Eventually I want it to be displayed as a graph of links.
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp" id="orge0659aa"><span style="color: #E53935;">:sitemap-title</span> <span style="color: #494949;">"(cons dev sitemap)"</span>
<span style="color: #E53935;">:auto-sitemap</span> t
</pre>
</div>
</div>
</div>
<div id="outline-container-org4298678" class="outline-3">
<h3 id="org4298678">Publishing Function</h3>
<div class="outline-text-3" id="text-org4298678">
<p>
This will eventually automatically publish files. Currently it is WIP and is published primarily because it realtes to my <a href="namespace-el.html#ID-31083c96-f4f8-45af-8790-490ab514ab04">emacs namespacing adventures</a>.
</p>
<p>
The assumption in the design is that I only really need to see the diff on the org files and the HTML files will sort themselves out. Therefore I just create a magit commit and do the job from there. The only issue is that the magit functions simply create buffers. I think the solution is to create a function to temporarily modify the hooks run after some of the functions.
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span style="color: #494949;">(</span><span style="color: #E53935; font-style: italic;">defun</span> <span style="font-weight: bold; font-style: italic;">cd-publish-files</span> <span style="color: #bbb;">()</span>
<span style="color: #bbb;">(</span><span style="color: #E53935; font-style: italic;">interactive</span><span style="color: #bbb;">)</span>
<span style="color: #bbb;">(</span>org-publish <span style="color: #494949;">"(cons dev nil)"</span><span style="color: #bbb;">)</span>
<span style="color: #bbb;">(</span>cd cd-source-dir<span style="color: #bbb;">)</span>
<span style="color: #bbb;">(</span>shell-command-to-string <span style="color: #494949;">(</span>format <span style="color: #494949;">"git add '%s'"</span> cd-source-dir<span style="color: #494949;">)</span><span style="color: #bbb;">)</span>
<span style="color: #bbb;">(</span>magit-commit-create<span style="color: #bbb;">)</span>
<span style="color: #a4a4a4; font-style: italic;">;</span><span style="color: #a4a4a4; font-style: italic;">(magit-git-push "main" "origin" "origin")</span>
<span style="color: #bbb;">(</span>cd cd-publish-dir<span style="color: #bbb;">)</span>
<span style="color: #bbb;">(</span>shell-command-to-string <span style="color: #494949;">(</span>format <span style="color: #494949;">"git add '%s'"</span> cd-publish-dir<span style="color: #494949;">)</span><span style="color: #bbb;">)</span>
<span style="color: #bbb;">(</span>shell-command-to-string <span style="color: #494949;">"git commit -m 'Automatically published, check website-src for details.'"</span><span style="color: #bbb;">)</span>
<span style="color: #bbb;">(</span>magit-git-push <span style="color: #494949;">"main"</span> <span style="color: #494949;">"origin"</span> <span style="color: #494949;">"origin"</span><span style="color: #bbb;">)</span><span style="color: #494949;">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org3d7fab0" class="outline-3">
<h3 id="org3d7fab0">Inserting Footnotes as Side Notes</h3>
<div class="outline-text-3" id="text-org3d7fab0">
<p>
I like the sort of tufte-css style side notes, so I decided to copy an implementation that <a href="https://jnboehm.gitlab.io/blog/tufte-css/">someone else</a> had done.<label class="sidenote-number" for="5"><sup>5</sup></label><input checked="checked" id="5" style="display:none" type="checkbox" /><span class="sidenote"><span class="sidenote-number"> 5</span> <a href="https://www.youtube.com/watch?v=_lf1mB8OZeg">Why make when you can steal?</a></span> Eventually I intend to add in some further features to document code block tangling and add RSS to the website. <a href="https://thibaultmarin.github.io/blog/posts/2016-11-13-Personal_website_in_org.html">This website</a> has some good examples of that I think, though I have yet to implement that.
</p>
<div class="org-src-container">
<pre class="src src-elisp" id="org846c3f4"><span style="color: #494949;">(</span><span style="color: #E53935; font-style: italic;">defun</span> <span style="font-weight: bold; font-style: italic;">tufte-html-footnote-reference</span> <span style="color: #bbb;">(</span>footnote-reference contents info<span style="color: #bbb;">)</span>
<span style="color: #a4a4a4; font-style: italic;">"Create a footnote according to the tufte css format.</span>
<span style="color: #a4a4a4; font-style: italic;">FOOTNOTE-REFERENCE is the org element, CONTENTS is nil. INFO is</span>
<span style="color: #a4a4a4; font-style: italic;">a plist holding contextual information."</span>
<span style="color: #bbb;">(</span><span style="color: #E53935; font-style: italic;">let</span> <span style="color: #494949;">(</span><span style="color: #bbb;">(</span>prev <span style="color: #494949;">(</span>org-export-get-previous-element footnote-reference info<span style="color: #494949;">)</span><span style="color: #bbb;">)</span>
<span style="color: #bbb;">(</span>fn-id <span style="color: #494949;">(</span>org-export-get-footnote-number footnote-reference info<span style="color: #494949;">)</span><span style="color: #bbb;">)</span><span style="color: #494949;">)</span>
<span style="color: #494949;">(</span>format <<sidenote-html<span style="color: #bbb;">()</span>>>
fn-id
fn-id
fn-id
fn-id
<span style="color: #bbb;">(</span>org-trim <span style="color: #494949;">(</span>org-export-data <span style="color: #bbb;">(</span>org-export-get-footnote-definition footnote-reference info<span style="color: #bbb;">)</span> info<span style="color: #494949;">)</span><span style="color: #bbb;">)</span><span style="color: #494949;">)</span><span style="color: #bbb;">)</span><span style="color: #494949;">)</span>
<span style="color: #494949;">(</span>org-export-define-derived-backend 'tufte-html 'html
<span style="color: #E53935;">:translate-alist</span> '<span style="color: #bbb;">(</span><span style="color: #494949;">(</span>footnote-reference . tufte-html-footnote-reference<span style="color: #494949;">)</span>
<span style="color: #494949;">(</span>footnote-definition . tufte-html-footnote-definition<span style="color: #494949;">)</span><span style="color: #bbb;">)</span><span style="color: #494949;">)</span>
<span style="color: #494949;">(</span><span style="color: #E53935; font-style: italic;">defun</span> <span style="font-weight: bold; font-style: italic;">org-html-publish-to-tufte-html</span> <span style="color: #bbb;">(</span>plist filename pub-dir<span style="color: #bbb;">)</span>
<span style="color: #a4a4a4; font-style: italic;">"Publish an org file to HTML.</span>
<span style="color: #a4a4a4; font-style: italic;">FILENAME is the filename of the Org file to be published. PLIST</span>
<span style="color: #a4a4a4; font-style: italic;">is the property list for the given project. PUB-DIR is the</span>
<span style="color: #a4a4a4; font-style: italic;">publishing directory.</span>
<span style="color: #a4a4a4; font-style: italic;">Return output file name."</span>
<span style="color: #bbb;">(</span>org-publish-org-to 'tufte-html filename
<span style="color: #494949;">(</span>concat <span style="color: #bbb;">(</span><span style="color: #E53935; font-style: italic;">when</span> <span style="color: #494949;">(</span>> <span style="color: #bbb;">(</span>length org-html-extension<span style="color: #bbb;">)</span> 0<span style="color: #494949;">)</span> <span style="color: #494949;">"."</span><span style="color: #bbb;">)</span>
<span style="color: #bbb;">(</span><span style="color: #E53935; font-style: italic;">or</span> <span style="color: #494949;">(</span>plist-get plist <span style="color: #E53935;">:html-extension</span><span style="color: #494949;">)</span>
org-html-extension
<span style="color: #494949;">"html"</span><span style="color: #bbb;">)</span><span style="color: #494949;">)</span>
plist pub-dir<span style="color: #bbb;">)</span><span style="color: #494949;">)</span>
</pre>
</div>
<p>
This is the HTML template for a sidenote feature.
</p>
<div class="org-src-container">
<pre class="src src-clojure" id="orgf3a4641"><span style="color: #494949;">(</span>use 'hiccup.core<span style="color: #494949;">)</span>
<span style="color: #494949;">(</span>html <span style="color: #bbb;">[</span><span style="color: #E53935;">:label</span> <span style="color: #494949;">{</span><span style="color: #E53935;">:class</span> <span style="color: #494949;">"sidenote-number"</span>
<span style="color: #E53935;">:for</span> <span style="color: #494949;">"%s"</span><span style="color: #494949;">}</span>
<span style="color: #494949;">[</span><span style="color: #E53935;">:sup</span> <span style="color: #494949;">"%s"</span><span style="color: #494949;">]</span><span style="color: #bbb;">]</span>
<span style="color: #bbb;">[</span><span style="color: #E53935;">:input</span> <span style="color: #494949;">{</span><span style="color: #E53935;">:style</span> <span style="color: #494949;">"display:none"</span>
<span style="color: #E53935;">:type</span> 'checkbox
<span style="color: #E53935;">:checked</span> <span style="color: #E53935;">true</span>
<span style="color: #E53935;">:id</span> <span style="color: #494949;">"%s"</span><span style="color: #494949;">}</span><span style="color: #bbb;">]</span>
<span style="color: #bbb;">[</span><span style="color: #E53935;">:span</span> <span style="color: #494949;">{</span><span style="color: #E53935;">:class</span> <span style="color: #494949;">"sidenote"</span><span style="color: #494949;">}</span>
<span style="color: #494949;">[</span><span style="color: #E53935;">:span</span> <span style="color: #bbb;">{</span><span style="color: #E53935;">:class</span> <span style="color: #494949;">"sidenote-number"</span><span style="color: #bbb;">}</span> <span style="color: #494949;">" %s"</span><span style="color: #494949;">]</span>
<span style="color: #494949;">" %s"</span><span style="color: #bbb;">]</span><span style="color: #494949;">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org9dc9f02" class="outline-3">
<h3 id="org9dc9f02">Directory Local Variables</h3>
<div class="outline-text-3" id="text-org9dc9f02">
<p>
This is the setup of the dir locals for the blog. They are used to keep the entire project local to the current directory.
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span style="color: #494949;">(</span><span style="color: #bbb;">(</span>nil . <span style="color: #494949;">(</span><span style="color: #bbb;">(</span>eval
. <span style="color: #494949;">(</span><span style="color: #E53935; font-style: italic;">progn</span>
<span style="color: #bbb;">(</span><span style="color: #E53935; font-style: italic;">setq</span> lexical-binding t<span style="color: #bbb;">)</span>
<span style="color: #bbb;">(</span><span style="color: #E53935; font-style: italic;">lexical-let</span> <span style="color: #494949;">(</span>
<<emacs-directories>><span style="color: #494949;">)</span>
<<auto-publish-command>>
<<site-html-generator>>
<span style="color: #494949;">(</span><span style="color: #E53935; font-style: italic;">setq</span>
org-export-with-section-numbers nil
org-html-footnotes-section <span style="color: #494949;">"<!-- %s --><!-- %s -->"</span>
org-publish-project-alist
`<span style="color: #bbb;">(</span><span style="color: #494949;">(</span><span style="color: #494949;">"(cons dev nil) images"</span>
<span style="color: #E53935;">:base-directory</span> <span style="color: #494949;">"~/Memex/cons-site/src/images/"</span>
<span style="color: #E53935;">:base-extension</span> <span style="color: #494949;">"svg</span><span style="color: #000; font-weight: bold;">\\</span><span style="color: #000; font-weight: bold;">|</span><span style="color: #494949;">png</span><span style="color: #000; font-weight: bold;">\\</span><span style="color: #000; font-weight: bold;">|</span><span style="color: #494949;">jpeg"</span>
<span style="color: #E53935;">:publishing-directory</span> <span style="color: #494949;">"~/Memex/cons-site/public/images/"</span>
<span style="color: #E53935;">:publishing-function</span> org-publish-attachment<span style="color: #494949;">)</span>
<span style="color: #494949;">(</span><span style="color: #494949;">"(cons dev nil) other"</span>
<span style="color: #E53935;">:base-directory</span> <span style="color: #494949;">"~/Memex/cons-site/src/other"</span>
<span style="color: #E53935;">:base-extension</span> <span style="color: #494949;">"pdf</span><span style="color: #000; font-weight: bold;">\\</span><span style="color: #000; font-weight: bold;">|</span><span style="color: #494949;">clj</span><span style="color: #000; font-weight: bold;">\\</span><span style="color: #000; font-weight: bold;">|</span><span style="color: #494949;">sh"</span>
<span style="color: #E53935;">:publishing-directory</span> <span style="color: #494949;">"~/Memex/cons-site/public/other/"</span>
<span style="color: #E53935;">:publishing-function</span> org-publish-attachment<span style="color: #494949;">)</span>
<span style="color: #494949;">(</span><span style="color: #494949;">"(cons dev nil) fonts"</span>
<span style="color: #E53935;">:base-directory</span> <span style="color: #494949;">"~/Memex/cons-site/src/fonts"</span>
<span style="color: #E53935;">:base-extension</span> <span style="color: #494949;">"*"</span>
<span style="color: #E53935;">:publishing-directory</span> <span style="color: #494949;">"~/Memex/cons-site/public/fonts/"</span>
<span style="color: #E53935;">:publishing-function</span> org-publish-attachment<span style="color: #494949;">)</span>
<span style="color: #494949;">(</span><span style="color: #494949;">"dodgy"</span>
<span style="color: #E53935;">:base-directory</span> <span style="color: #494949;">"~/Memex/cons-site/src/dodgy/resources/public/"</span>
<span style="color: #E53935;">:base-extension</span> <span style="color: #494949;">"js</span><span style="color: #000; font-weight: bold;">\\</span><span style="color: #000; font-weight: bold;">|</span><span style="color: #494949;">html"</span>
<span style="color: #E53935;">:publishing-directory</span> <span style="color: #494949;">"~/Memex/cons-site/public/dodgy/resources/public/"</span>
<span style="color: #E53935;">:publishing-function</span> org-publish-attachment
<span style="color: #E53935;">:recursive</span> t<span style="color: #494949;">)</span>
<span style="color: #494949;">(</span>
<<emacs-site-info>>
<<emacs-sitemap>>
<<emacs-site-files>>
<<emacs-preamble>>
<<emacs-postamble>>
<<emacs-idx-sitemap>>
<<emacs-stylesheet>><span style="color: #494949;">)</span>
<span style="color: #494949;">(</span><span style="color: #494949;">"(cons dev nil)"</span>
<span style="color: #E53935;">:components</span> <span style="color: #bbb;">(</span><span style="color: #494949;">"(cons dev nil) org"</span>
<span style="color: #494949;">"(cons dev nil) images"</span>
<span style="color: #494949;">"(cons dev nil) other"</span>
<span style="color: #494949;">"dodgy"</span><span style="color: #bbb;">)</span><span style="color: #494949;">)</span><span style="color: #bbb;">)</span><span style="color: #494949;">)</span><span style="color: #bbb;">)</span><span style="color: #494949;">)</span><span style="color: #bbb;">)</span><span style="color: #494949;">)</span><span style="color: #bbb;">)</span><span style="color: #494949;">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org60b31b4" class="outline-3">
<h3 id="org60b31b4">Git Setup</h3>
<div class="outline-text-3" id="text-org60b31b4">
<p>
This is basically the (rather small) amount of setup used to ensure that generated files are not included in the git repository. It also ignores draft files.
</p>
<div class="org-src-container">
<pre class="src src-gitignore">.dir-locals.el
.gitignore
project.clj
public
.cider-repl-history
<span style="color: #E53935; font-style: italic;">*</span>.draft.org
<span style="color: #a4a4a4; font-style: italic;"># Lein related stuff </span>
<span style="color: #E53935;">/</span>target
<span style="color: #E53935;">/</span>classes
<span style="color: #E53935;">/</span>checkouts
profiles.clj
pom.xml
pom.xml.asc
<span style="color: #E53935; font-style: italic;">*</span>.jar
<span style="color: #E53935; font-style: italic;">*</span>.class
<span style="color: #E53935;">/</span>.lein-<span style="color: #E53935; font-style: italic;">*</span>
<span style="color: #E53935;">/</span>.nrepl-port
<span style="color: #E53935;">/</span>.prepl-port
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-orgca3028e" class="outline-2">
<h2 id="orgca3028e">HTML</h2>
<div class="outline-text-2" id="text-orgca3028e">
<p>
This is where I configure the HTML displayed by the system, for th emost part.
</p>
</div>
<div id="outline-container-orgd9c097e" class="outline-3">
<h3 id="orgd9c097e">Dependencies</h3>
<div class="outline-text-3" id="text-orgd9c097e">
<p>
Here we import hiccup so we can write our HTML in Clojure. You may have noticed that I am slightly allergic to HTML. This is partially because I like to do
</p>
<div class="org-src-container">
<pre class="src src-clojure" id="orgff635d9"><span style="color: #494949;">[</span>hiccup <span style="color: #494949;">"1.0.5"</span><span style="color: #494949;">]</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org323040f" class="outline-3">
<h3 id="org323040f">Preamble and Postamble</h3>
<div class="outline-text-3" id="text-org323040f">
<p>
This is the first section of the program and the
</p>
</div>
<div id="outline-container-org35fa209" class="outline-4">
<h4 id="org35fa209">License Info</h4>
<div class="outline-text-4" id="text-org35fa209">
<p>
This is the license info for my website. I selected the license because it provides one-way compatibility with the GPL-3.0 license. Thus I can license my code under the GPL, while licensing most of the text of the site under the <a href="https://creativecommons.org/licenses/by-sa/4.0/">CC-BY-SA 4.0 license</a>. Currently it is displayed in the postamble on all pages, though I might want to alter that someday.
</p>
<div class="org-src-container">
<pre class="src src-clojure" id="org33bb4cc"><span style="color: #494949;">[</span><span style="color: #E53935;">:p</span> <span style="color: #bbb;">{</span><span style="color: #E53935;">:class</span> <span style="color: #494949;">"license"</span><span style="color: #bbb;">}</span>
<span style="color: #494949;">"Except where otherwise noted content on "</span>
<span style="color: #bbb;">[</span><span style="color: #E53935;">:a</span> <span style="color: #494949;">{</span><span style="color: #E53935;">:href</span> <span style="color: #494949;">"https://cons.dev"</span><span style="color: #494949;">}</span> <span style="color: #494949;">"cons.dev"</span><span style="color: #bbb;">]</span>
<span style="color: #494949;">" is licensed under a "</span>
<span style="color: #bbb;">[</span><span style="color: #E53935;">:a</span> <span style="color: #494949;">{</span><span style="color: #E53935;">:rel</span> <span style="color: #494949;">"license"</span> <span style="color: #E53935;">:href</span> <span style="color: #494949;">"https://creativecommons.org/licenses/by-sa/4.0/"</span><span style="color: #494949;">}</span>
<span style="color: #494949;">"Creative Commons Attribution-ShareAlike 4.0 International License"</span><span style="color: #bbb;">]</span> <span style="color: #494949;">"."</span><span style="color: #494949;">]</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org982071b" class="outline-4">
<h4 id="org982071b">Preamble</h4>
<div class="outline-text-4" id="text-org982071b">
<p>
This adds a few links to the beginning of the document to aid with navigation.
</p>
<div class="org-src-container">
<pre class="src src-clojure" id="org8b4ff9b"><span style="color: #494949;">(</span>use 'hiccup.core<span style="color: #494949;">)</span>
<span style="color: #494949;">(</span>html <span style="color: #bbb;">[</span><span style="color: #E53935;">:div</span>
<span style="color: #494949;">[</span><span style="color: #E53935;">:a</span> <span style="color: #bbb;">{</span><span style="color: #E53935;">:href</span> <span style="color: #494949;">"/index.html"</span><span style="color: #bbb;">}</span>
<span style="color: #bbb;">[</span><span style="color: #E53935;">:img</span> <span style="color: #494949;">{</span><span style="color: #E53935;">:id</span> <span style="color: #494949;">"site-logo"</span>
<span style="color: #E53935;">:src</span> <span style="color: #494949;">"/images/website-logo.png"</span>
<span style="color: #E53935;">:alt</span> <span style="color: #494949;">"An abstract logo representing a series of three assembly line stamping machines with the words CONS, DEV, and NIL embalzoned in white on each machine."</span><span style="color: #494949;">}</span><span style="color: #bbb;">]</span><span style="color: #494949;">]</span><span style="color: #bbb;">]</span><span style="color: #494949;">)</span>
</pre>
</div>
<p>
This is the Emacs code that sets the preamble
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp" id="org609f794"><span style="color: #E53935;">:html-preamble</span> t
<span style="color: #E53935;">:html-preamble-format</span> '<span style="color: #494949;">(</span><span style="color: #494949;">"en"</span> <<emacs-html-preamble<span style="color: #bbb;">()</span>>><span style="color: #494949;">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org32b7e29" class="outline-4">
<h4 id="org32b7e29">Postamble</h4>
<div class="outline-text-4" id="text-org32b7e29">
<p>
The end of each document this adds a little bit of text containing the info about the program that created it, the date the file was modified, and licensing information
</p>
<div class="org-src-container">
<pre class="src src-clojure" id="orgfc31860"><span style="color: #494949;">(</span>use 'hiccup.core<span style="color: #494949;">)</span>
<span style="color: #494949;">(</span>html <span style="color: #bbb;">[</span><span style="color: #E53935;">:p</span> <span style="color: #494949;">{</span><span style="color: #E53935;">:class</span> <span style="color: #494949;">"date"</span><span style="color: #494949;">}</span> <span style="color: #494949;">"Last Modified: %C"</span><span style="color: #bbb;">]</span>
<span style="color: #bbb;">[</span><span style="color: #E53935;">:p</span> <span style="color: #494949;">{</span><span style="color: #E53935;">:class</span> <span style="color: #494949;">"creator"</span><span style="color: #494949;">}</span> <span style="color: #494949;">"Generated Using: %c"</span><span style="color: #bbb;">]</span>
<<license-info>><span style="color: #494949;">)</span>
</pre>
</div>
<p>
This code sets the postamble.
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp" id="org2233b5e"><span style="color: #E53935;">:html-postamble</span> t
<span style="color: #E53935;">:html-postamble-format</span> '<span style="color: #494949;">(</span><span style="color: #494949;">"en"</span> <<emacs-html-postamble<span style="color: #bbb;">()</span>>><span style="color: #494949;">)</span>
</pre>
</div>
</div>
</div>
</div>
</div>
<div id="outline-container-org040bb70" class="outline-2">
<h2 id="org040bb70">Stylesheets</h2>
<div class="outline-text-2" id="text-org040bb70">
<p>
While <a href="https://orgmode.org/manual/HTML-Export.html#HTML-Export">org-html-export</a> does an admirable job at exporting code in my preferred syntax highlighting style, it unfortunately does not replicate the other features of my org-mode buffers. To do that I use <a href="https://github.com/noprompt/garden">Garden</a>, a Clojure library for defining CSS. The reason I use garden is mostly because I dislike using CSS directly and have a ton of features set up for structure editing lisp that I don't have for HTML and CSS.
</p>
</div>
<div id="outline-container-org6f3fcc0" class="outline-3">
<h3 id="org6f3fcc0">Dependencies</h3>
<div class="outline-text-3" id="text-org6f3fcc0">
<div class="org-src-container">
<pre class="src src-clojure" id="org041107c"><span style="color: #494949;">[</span>garden <span style="color: #494949;">"1.3.10"</span><span style="color: #494949;">]</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org7b595a5" class="outline-3">
<h3 id="org7b595a5">Emacs Configuration</h3>
<div class="outline-text-3" id="text-org7b595a5">
<p>
This adds the Emacs configuration for the stylesheets in the blog. It also adds a link to the fonts stylesheet.
</p>
<div class="org-src-container">
<pre class="src src-clojure" id="org974f671"><span style="color: #494949;">(</span>use 'hiccup.core<span style="color: #494949;">)</span>
<span style="color: #494949;">(</span>html <span style="color: #bbb;">[</span><span style="color: #E53935;">:link</span> <span style="color: #494949;">{</span><span style="color: #E53935;">:rel</span> <span style="color: #494949;">"stylesheet"</span> <span style="color: #E53935;">:type</span> <span style="color: #494949;">"text/css"</span> <span style="color: #E53935;">:href</span> <span style="color: #494949;">"/site.css"</span><span style="color: #494949;">}</span><span style="color: #bbb;">]</span>
<span style="color: #bbb;">[</span><span style="color: #E53935;">:link</span> <span style="color: #494949;">{</span><span style="color: #E53935;">:rel</span> <span style="color: #494949;">"icon"</span> <span style="color: #E53935;">:href</span> <span style="color: #494949;">"images/website-icon.png"</span><span style="color: #494949;">}</span><span style="color: #bbb;">]</span><span style="color: #494949;">)</span>
</pre>
</div>
<p>
This property then sets the HTML head on every file to be the HTML generated by that.
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp" id="org70ce55c"><span style="color: #E53935;">:html-head</span> <<html-head<span style="color: #494949;">()</span>>>
</pre>
</div>
</div>
</div>
<div id="outline-container-org082038d" class="outline-3">
<h3 id="org082038d">Create CSS File</h3>
<div class="outline-text-3" id="text-org082038d">
<p>
This creates the CSS file in my public directory. It is automatically called every time the project is updated (thus generating the CSS file). This ensures that the state of this file is kept in sync with the actual state of the project itself.
</p>
<div class="org-src-container">
<pre class="src src-clojure" id="org348fe91"><span style="color: #494949;">(</span><span style="color: #E53935; font-style: italic;">ns</span> <span style="color: #E53935;">stylesheets</span>
<span style="color: #a4a4a4; font-style: italic;">"A namespace for stylesheets"</span>
<span style="color: #bbb;">(</span><span style="color: #E53935;">:require</span> <span style="color: #494949;">[</span>garden.core <span style="color: #E53935;">:refer</span> <span style="color: #bbb;">[</span>css<span style="color: #bbb;">]</span><span style="color: #494949;">]</span>
<span style="color: #494949;">[</span>garden.def <span style="color: #E53935;">:refer</span> <span style="color: #bbb;">[</span>defcssfn<span style="color: #bbb;">]</span><span style="color: #494949;">]</span>
<span style="color: #494949;">[</span>garden.units <span style="color: #E53935;">:refer</span> <span style="color: #bbb;">[</span>em px percent vw<span style="color: #bbb;">]</span><span style="color: #494949;">]</span>
<span style="color: #494949;">[</span>garden.selectors <span style="color: #E53935;">:refer</span> <span style="color: #bbb;">[</span>defpseudoelement > pre p a +<span style="color: #bbb;">]</span><span style="color: #494949;">]</span>
<span style="color: #494949;">[</span>garden.stylesheet <span style="color: #E53935;">:refer</span> <span style="color: #bbb;">[</span>at-import at-media at-font-face<span style="color: #bbb;">]</span><span style="color: #494949;">]</span><span style="color: #bbb;">)</span><span style="color: #494949;">)</span>
<span style="color: #494949;">(</span><span style="color: #E53935; font-style: italic;">defcssfn</span> <span style="font-weight: bold; font-style: italic;">url</span><span style="color: #494949;">)</span>
<span style="color: #494949;">(</span><span style="color: #E53935; font-style: italic;">defpseudoelement</span> <span style="font-weight: bold; font-style: italic;">selection</span><span style="color: #494949;">)</span>
<span style="color: #494949;">(</span><span style="color: #E53935; font-style: italic;">def</span> <span style="font-style: italic;">red</span> <span style="color: #494949;">"</span><span style="color: #ffffff; background-color: #e53935;">#e53935</span><span style="color: #494949;">"</span><span style="color: #494949;">)</span>
<span style="color: #494949;">(</span><span style="color: #E53935; font-style: italic;">def</span> <span style="font-style: italic;">fg</span> <span style="color: #494949;">"</span><span style="color: #ffffff; background-color: #000;">#000</span><span style="color: #494949;">"</span><span style="color: #494949;">)</span>
<span style="color: #494949;">(</span><span style="color: #E53935; font-style: italic;">def</span> <span style="font-style: italic;">fg-alt</span> <span style="color: #494949;">"</span><span style="color: #000000; background-color: #a4a4a4;">#a4a4a4</span><span style="color: #494949;">"</span><span style="color: #494949;">)</span>
<span style="color: #494949;">(</span><span style="color: #E53935; font-style: italic;">def</span> <span style="font-style: italic;">light-red</span> <span style="color: #494949;">"</span><span style="color: #000000; background-color: #ff6d60;">#ff6d60</span><span style="color: #494949;">"</span><span style="color: #494949;">)</span>
<span style="color: #494949;">(</span><span style="color: #E53935; font-style: italic;">def</span> <span style="font-style: italic;">bg</span> <span style="color: #494949;">"</span><span style="color: #000000; background-color: #fff;">#fff</span><span style="color: #494949;">"</span><span style="color: #494949;">)</span>
<span style="color: #494949;">(</span><span style="color: #E53935; font-style: italic;">def</span> <span style="font-style: italic;">bg-alt</span> <span style="color: #494949;">"</span><span style="color: #000000; background-color: #f5f5f5;">#f5f5f5</span><span style="color: #494949;">"</span><span style="color: #494949;">)</span>
<span style="color: #494949;">(</span><span style="color: #E53935; font-style: italic;">def</span> <span style="font-style: italic;">mono-font</span> <span style="color: #494949;">"'Iosevka Term Web'"</span><span style="color: #494949;">)</span>
<span style="color: #494949;">(</span><span style="color: #E53935; font-style: italic;">def</span> <span style="font-style: italic;">title-font</span> <span style="color: #494949;">"'Jura'"</span><span style="color: #494949;">)</span>
<span style="color: #494949;">(</span><span style="color: #E53935; font-style: italic;">def</span> <span style="font-style: italic;">proportional-font</span> <span style="color: #494949;">"'Iosevka Aile Web'"</span><span style="color: #494949;">)</span>
<span style="color: #494949;">(</span>spit <span style="color: #494949;">"./public/site.css"</span>
<span style="color: #bbb;">(</span>css
<<stylesheet-default>>
<<stylesheet-tables>>
<<stylesheet-lists>>
<<stylesheet-verses-and-quotes>>
<<stylsheet-unchanging>>
<<stylesheet-wide-screen>>
<<stylesheet-narrow-screen>>
<<stylesheet-selection>>
<<stylesheet-headlines>>
<<stylesheet-info>>
<<stylesheet-links>>
<<stylesheet-src-hover-info>>
<<stylesheet-src-hover-info-languages>>
<<stylesheet-src-block>><span style="color: #bbb;">)</span><span style="color: #494949;">)</span>
</pre>
</div>
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
<col class="org-left" />
</colgroup>
<tbody>
<tr>
<td class="org-left">#'stylesheets/url</td>
</tr>
<tr>
<td class="org-left">#'stylesheets/selection</td>
</tr>
<tr>
<td class="org-left">#'stylesheets/red</td>
</tr>
<tr>
<td class="org-left">#'stylesheets/fg</td>
</tr>
<tr>
<td class="org-left">#'stylesheets/fg-alt</td>
</tr>
<tr>
<td class="org-left">#'stylesheets/light-red</td>
</tr>
<tr>
<td class="org-left">#'stylesheets/bg</td>
</tr>
<tr>
<td class="org-left">#'stylesheets/bg-alt</td>
</tr>
<tr>
<td class="org-left">#'stylesheets/mono-font</td>
</tr>
<tr>
<td class="org-left">#'stylesheets/title-font</td>
</tr>
<tr>
<td class="org-left">#'stylesheets/proportional-font</td>
</tr>
<tr>
<td class="org-left">class clojure.lang.Compiler$CompilerException</td>
</tr>
</tbody>
</table>
</div>
</div>
<div id="outline-container-org8add767" class="outline-3">
<h3 id="org8add767">Background and Foreground</h3>
<div class="outline-text-3" id="text-org8add767">
<p>
This keeps the default background and foreground in sync with the rest of the system. To see the code blocks being called, view the <a href="#org1240fe7">helper blocks</a> section. I also set up the I use here, in this case <a href="https://typeof.net/Iosevka/">Iosevka</a>, a pleasing DIN-like<label class="sidenote-number" for="6"><sup>6</sup></label><input checked="checked" id="6" style="display:none" type="checkbox" /><span class="sidenote"><span class="sidenote-number"> 6</span> How else am I to make my website as compliant with as many meaningless standards as possible? It's ISO-8601 compliant, DIN-1451 compliant (almost), RFC-791 compliant, and probably quite a few more.</span> font that is entirely fixed-width for use in terminals.
</p>
<p>
The Iosevka Term Web font itself provides a <a href="iosevka-term-css.html#ID-48b42ccb-bec4-4e61-8c5e-fb692acf1c4c">css file</a> that works rather well, <a href="iosevka-aile-css.html#ID-93a7561c-1cbf-47d9-b940-1dc78f7e9122">as does</a> the Iosevka Aile font.
</p>
<div class="org-src-container">
<pre class="src src-clojure" id="org15d5680"><span style="color: #494949;">(</span>at-import <span style="color: #bbb;">(</span>url <span style="color: #494949;">"fonts/iosevka-term.css"</span><span style="color: #bbb;">)</span><span style="color: #494949;">)</span>
<span style="color: #494949;">(</span>at-import <span style="color: #bbb;">(</span>url <span style="color: #494949;">"fonts/iosevka-aile.css"</span><span style="color: #bbb;">)</span><span style="color: #494949;">)</span>
<span style="color: #494949;">(</span>at-font-face <span style="color: #bbb;">{</span><span style="color: #E53935;">:font-family</span> title-fotnt
<span style="color: #E53935;">:src</span> <span style="color: #494949;">(</span>url <span style="color: #494949;">"fonts/ttf/Jura-VariableFont_wght.ttf"</span><span style="color: #494949;">)</span><span style="color: #bbb;">}</span><span style="color: #494949;">)</span>
<span style="color: #494949;">[</span><span style="color: #E53935;">:body</span> <span style="color: #bbb;">{</span><span style="color: #E53935;">:background-color</span> bg
<span style="color: #E53935;">:color</span> fg
<span style="color: #E53935;">:font-family</span> proportional-font
<span style="color: #E53935;">:-ms-overflow-style</span> 'none
<span style="color: #E53935;">:line-height</span> 1.3
<span style="color: #E53935;">:scrollbar-width</span> 'none<span style="color: #bbb;">}</span>
<span style="color: #bbb;">[</span><span style="color: #494949;">":-webkit-scrollbar"</span> <span style="color: #494949;">{</span><span style="color: #E53935;">:display</span> 'none<span style="color: #494949;">}</span><span style="color: #bbb;">]</span><span style="color: #494949;">]</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-orgc7eb402" class="outline-3">
<h3 id="orgc7eb402">Tables</h3>
<div class="outline-text-3" id="text-orgc7eb402">
<p>
Tables are also nice to style, and I want them to have a subtle color scheme to make them more readable, center them in the body, and a system to automatically highlight the rows of the table. <label class="sidenote-number" for="7"><sup>7</sup></label><input checked="checked" id="7" style="display:none" type="checkbox" /><span class="sidenote"><span class="sidenote-number"> 7</span> Example table from the org-mode manual.</span>
</p>
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
<col class="org-left" />
<col class="org-right" />
<col class="org-left" />
<col class="org-left" />
</colgroup>
<thead>
<tr>
<th scope="col" class="org-left">Func</th>
<th scope="col" class="org-right">n</th>
<th scope="col" class="org-left">x</th>
<th scope="col" class="org-left">Result</th>
</tr>
</thead>
<tbody>
<tr>
<td class="org-left">exp(x)</td>
<td class="org-right">1</td>
<td class="org-left">x</td>
<td class="org-left">1 + x</td>
</tr>
<tr>
<td class="org-left">exp(x)</td>
<td class="org-right">2</td>
<td class="org-left">x</td>
<td class="org-left">1 + x + x<sup>2</sup> / 2</td>
</tr>
<tr>
<td class="org-left">exp(x)</td>
<td class="org-right">3</td>
<td class="org-left">x</td>
<td class="org-left">1 + x + x<sup>2</sup> / 2 + x<sup>3</sup> / 6</td>
</tr>
<tr>
<td class="org-left">x<sup>2</sup>+sqrt(x)</td>
<td class="org-right">2</td>
<td class="org-left">x=0</td>
<td class="org-left">x*(0.5 / 0) + x<sup>2</sup> (2 - 0.25 / 0) / 2</td>
</tr>
<tr>
<td class="org-left">x<sup>2</sup>+sqrt(x)</td>
<td class="org-right">2</td>
<td class="org-left">x=1</td>
<td class="org-left">2 + 2.5 x - 2.5 + 0.875 (x - 1)<sup>2</sup></td>
</tr>
<tr>
<td class="org-left">tan(x)</td>
<td class="org-right">3</td>
<td class="org-left">x</td>
<td class="org-left">x pi / 180 + 5.72e-8 x<sup>3</sup> pi<sup>3</sup></td>
</tr>
</tbody>
</table>
<div class="org-src-container">
<pre class="src src-clojure" id="org5ea7d93"><span style="color: #494949;">[</span><span style="color: #E53935;">:table</span> <span style="color: #bbb;">{</span><span style="color: #E53935;">:margin-left</span> 'auto
<span style="color: #E53935;">:margin-right</span> 'auto<span style="color: #bbb;">}</span><span style="color: #494949;">]</span>
<span style="color: #494949;">[</span><span style="color: #E53935;">:table</span> <span style="color: #E53935;">:tr</span> <span style="color: #E53935;">:td</span> <span style="color: #E53935;">:thead</span> <span style="color: #E53935;">:tbody</span>
<span style="color: #bbb;">{</span><span style="color: #E53935;">:border-width</span> 0<span style="color: #bbb;">}</span><span style="color: #494949;">]</span>
<span style="color: #494949;">[</span><span style="color: #E53935;">:thead</span> <span style="color: #bbb;">{</span><span style="color: #E53935;">:background-color</span> red
<span style="color: #E53935;">:font-weight</span> 'bold
<span style="color: #E53935;">:color</span> bg
<span style="color: #E53935;">:font-family</span> title-font<span style="color: #bbb;">}</span><span style="color: #494949;">]</span>
<span style="color: #494949;">[</span><span style="color: #E53935;">:th</span> <span style="color: #E53935;">:td</span> <span style="color: #bbb;">{</span><span style="color: #E53935;">:text-align</span> 'left
<span style="color: #E53935;">:padding-bottom</span> <span style="color: #494949;">(</span>em 0.25<span style="color: #494949;">)</span>
<span style="color: #E53935;">:padding-top</span> <span style="color: #494949;">(</span>em 0.25<span style="color: #494949;">)</span>
<span style="color: #E53935;">:padding-left</span> <span style="color: #494949;">(</span>em 0.5<span style="color: #494949;">)</span>
<span style="color: #E53935;">:padding-right</span> <span style="color: #494949;">(</span>em 0.5<span style="color: #494949;">)</span><span style="color: #bbb;">}</span><span style="color: #494949;">]</span>
<span style="color: #494949;">[</span><span style="color: #E53935;">:tbody</span> <span style="color: #bbb;">[</span><span style="color: #494949;">"tr:hover"</span> <span style="color: #494949;">{</span><span style="color: #E53935;">:background-color</span> bg-alt<span style="color: #494949;">}</span><span style="color: #bbb;">]</span><span style="color: #494949;">]</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org9cf3001" class="outline-3">
<h3 id="org9cf3001">Lists</h3>
<div class="outline-text-3" id="text-org9cf3001">
<p>
Here the lists are styled so I can make them look better and more interesting. List bullets are colored red <label class="sidenote-number" for="8"><sup>8</sup></label><input checked="checked" id="8" style="display:none" type="checkbox" /><span class="sidenote"><span class="sidenote-number"> 8</span> Implementation stolen from <a href="https://www.w3.org/Style/Examples/007/color-bullets.en.html">here</a>.</span> and the description lists also have their first elements colored red.
</p>
<p>
Example <code>ul</code>:
</p>
<ul class="org-ul">
<li>This</li>
<li>is</li>
<li>a</li>
<li>list</li>
</ul>
<p>
Example <code>ol</code>:
</p>
<ol class="org-ol">
<li>A</li>
<li>simple</li>
<li>list</li>
</ol>
<p>
Example <code>dl</code>:
</p>
<dl class="org-dl">
<dt>some</dt><dd>descriptions</dd>
<dt>of</dt><dd>objects</dd>
</dl>
<div class="org-src-container">
<pre class="src src-clojure" id="orgff0cba6"><span style="color: #494949;">[</span><span style="color: #E53935;">:dt</span> <span style="color: #bbb;">{</span><span style="color: #E53935;">:color</span> red<span style="color: #bbb;">}</span><span style="color: #494949;">]</span>
<span style="color: #494949;">[</span><span style="color: #E53935;">:ol</span> <span style="color: #bbb;">{</span><span style="color: #E53935;">:list-style</span> 'none
<span style="color: #E53935;">:counter-reset</span> 'li<span style="color: #bbb;">}</span>
<span style="color: #bbb;">[</span><span style="color: #E53935;">:li</span> <span style="color: #494949;">{</span><span style="color: #E53935;">:counter-increment</span> 'li<span style="color: #494949;">}</span><span style="color: #bbb;">]</span>
<span style="color: #bbb;">[</span><span style="color: #494949;">"li::before"</span> <span style="color: #494949;">{</span><span style="color: #E53935;">:content</span> <span style="color: #494949;">"counter(li)"</span>
<span style="color: #E53935;">:width</span> <span style="color: #bbb;">(</span>em 1<span style="color: #bbb;">)</span>
<span style="color: #E53935;">:margin-right</span> <span style="color: #bbb;">(</span>em 0.5<span style="color: #bbb;">)</span>
<span style="color: #E53935;">:text-align</span> 'right
<span style="color: #E53935;">:direction</span> 'rtl
<span style="color: #E53935;">:margin-left</span> <span style="color: #bbb;">(</span>em -1.5<span style="color: #bbb;">)</span><span style="color: #494949;">}</span><span style="color: #bbb;">]</span><span style="color: #494949;">]</span>
<span style="color: #494949;">[</span><span style="color: #E53935;">:ul</span> <span style="color: #bbb;">{</span><span style="color: #E53935;">:list-style</span> 'none<span style="color: #bbb;">}</span>
<span style="color: #bbb;">[</span><span style="color: #494949;">"li::before"</span> <span style="color: #494949;">{</span><span style="color: #E53935;">:content</span> <span style="color: #494949;">"'•'"</span>
<span style="color: #E53935;">:width</span> <span style="color: #bbb;">(</span>em 1<span style="color: #bbb;">)</span>
<span style="color: #E53935;">:margin-left</span> <span style="color: #bbb;">(</span>em -1<span style="color: #bbb;">)</span><span style="color: #494949;">}</span><span style="color: #bbb;">]</span><span style="color: #494949;">]</span>
<span style="color: #494949;">[</span><span style="color: #494949;">"li::before"</span> <span style="color: #bbb;">{</span><span style="color: #E53935;">:color</span> red
<span style="color: #E53935;">:display</span> 'inline-block<span style="color: #bbb;">}</span><span style="color: #494949;">]</span>
<span style="color: #494949;">[</span><span style="color: #E53935;">:li</span> <span style="color: #bbb;">{</span><span style="color: #E53935;">:margin-top</span> <span style="color: #494949;">(</span>em 0.5<span style="color: #494949;">)</span><span style="color: #bbb;">}</span><span style="color: #494949;">]</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org5a5f437" class="outline-3">
<h3 id="org5a5f437">Verses and Quotes</h3>
<div class="outline-text-3" id="text-org5a5f437">
<p>
I decided that verses should be indented, but given minimal styling, while quotes should be indented, italicized, and have a quotation mark superimposed on them.
</p>
<blockquote>
<p>
There is nothing quite like writing a long string of code.
</p>
<p>
– nil
</p>
</blockquote>
<dl class="org-dl">
<dt>The Eternal Flame by Julia Ecklar</dt><dd></dd>
</dl>
<p class="verse">
I was taught Assembler in my second year of school<br />
It's kinda like construction work –<br />
With a toothpick for a tool<br />
So when I made my senior year<br />
I threw my code away<br />
And learned the way to program<br />
That I still prefer today<br />
<br />
Now, some folks on the Internet<br />
Put their faith in C++<br />
They swear that it's so powerful<br />
It's what God used for us<br />
And maybe He lets mortals dredge<br />
Their objects from the C<br />
But I think that explains<br />
Why only God can make a tree<br />
<br />
For God wrote in Lisp code<br />
When he filled the leaves with green<br />
The fractal flowers and recursive roots:<br />
The most lovely hack I've seen<br />
And when I ponder snowflakes<br />
Never finding two the same<br />
I know God likes a language<br />
With its own four-letter name<br />
Now, I've used a SUN under Unix<br />
So I've seen what C can hold<br />
I've surfed for Perls, found what Fortran's for<br />
Got that Java stuff down cold<br />
Though the chance that I'd write COBOL code<br />
Is a SNOBOL's chance in Hell<br />
And I basically hate hieroglyphs<br />
So I won't use APL<br />
<br />
Now, God must know all these languages<br />
And a few I haven't named<br />
But the Lord made sure, when each sparrow falls<br />
That its flesh will be reclaimed<br />
And the Lord could not count grains of sand<br />
With a 32-bit word<br />
Who knows where we would go to<br />
If Lisp weren't what he preferred?<br />
<br />
And God wrote in Lisp code<br />
Every creature great and small<br />
Don't search the disk drive for man.c<br />
When the listing's on the wall<br />
And when I watch the lightning burn<br />
Unbelievers to a crisp<br />
I know God had six days to work<br />
So he wrote it all in Lisp<br />
Yes, God had a deadline<br />
So he wrote it all in Lisp<br />
</p>
<div class="org-src-container">
<pre class="src src-clojure" id="org92a87a7"><span style="color: #494949;">[</span><span style="color: #E53935;">:blockquote</span> <span style="color: #bbb;">{</span><span style="color: #E53935;">:font-style</span> 'italic
<span style="color: #E53935;">:background-color</span> bg-alt
<span style="color: #E53935;">:padding</span> <span style="color: #494949;">(</span>em 0.5<span style="color: #494949;">)</span><span style="color: #bbb;">}</span><span style="color: #494949;">]</span>
<span style="color: #494949;">[</span><span style="color: #494949;">"blockquote::before"</span> <span style="color: #bbb;">{</span><span style="color: #E53935;">:content</span> <span style="color: #494949;">"'</span><span style="color: #494949; font-weight: bold;">\"</span><span style="color: #494949;">'"</span>
<span style="color: #E53935;">:font-size</span> <span style="color: #494949;">(</span>em 5<span style="color: #494949;">)</span>
<span style="color: #E53935;">:color</span> <span style="color: #494949;">"rgba(0,0,0,0.1)"</span> <span style="color: #a4a4a4; font-style: italic;">; semi-transparent quote</span>
<span style="color: #E53935;">:margin-left</span> <span style="color: #494949;">(</span>em -0.15<span style="color: #494949;">)</span>
<span style="color: #E53935;">:margin-top</span> <span style="color: #494949;">(</span>em -0.15<span style="color: #494949;">)</span>
<span style="color: #E53935;">:height</span> <span style="color: #494949;">(</span>em 0<span style="color: #494949;">)</span>
<span style="color: #E53935;">:display</span> 'block<span style="color: #bbb;">}</span><span style="color: #494949;">]</span>
<span style="color: #494949;">[</span><span style="color: #E53935;">:.verse</span> <span style="color: #bbb;">{</span><span style="color: #E53935;">:margin-left</span> <span style="color: #494949;">(</span>em 3<span style="color: #494949;">)</span><span style="color: #bbb;">}</span><span style="color: #494949;">]</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-orga2f8479" class="outline-3">
<h3 id="orga2f8479">Embedded Content</h3>
</div>
<div id="outline-container-orgb871747" class="outline-3">
<h3 id="orgb871747">Dynamic Size Switching</h3>
<div class="outline-text-3" id="text-orgb871747">
<p>
To ensure that the website looks good regardless of what you use <label class="sidenote-number" for="9"><sup>9</sup></label><input checked="checked" id="9" style="display:none" type="checkbox" /><span class="sidenote"><span class="sidenote-number"> 9</span> And I do mean regardless, I have put in some effort to ensure that it looks good even in a terminal browser, mostly by avoiding modifications to the org-exported HTML.</span> I switch a large portion of the style of the website between two modes, a small single-column version for <code>< 60em</code> screens (phones and the like), and a large fully expanded one for <code>> 60em</code> screens (desktops, people with big browsing areas).
</p>
</div>
<div id="outline-container-org2b47d9e" class="outline-4">
<h4 id="org2b47d9e">Non Dynamic Style</h4>
<div class="outline-text-4" id="text-org2b47d9e">
<p>
To start out some non-dynamic things need to be styled.
</p>
<div class="org-src-container">
<pre class="src src-clojure" id="orgff6e001"><span style="color: #494949;">[</span><span style="color: #E53935;">:#table-of-contents</span>
<span style="color: #bbb;">{</span><span style="color: #E53935;">:background-color</span> bg-alt<span style="color: #bbb;">}</span>
<span style="color: #bbb;">[</span><span style="color: #E53935;">:ul</span> <span style="color: #494949;">{</span><span style="color: #E53935;">:list-style-type</span> 'none
<span style="color: #E53935;">:padding-left</span> <span style="color: #bbb;">(</span>em 0.5<span style="color: #bbb;">)</span><span style="color: #494949;">}</span><span style="color: #bbb;">]</span>
<span style="color: #bbb;">[</span><span style="color: #494949;">"li::before"</span> <span style="color: #494949;">{</span><span style="color: #E53935;">:content</span> 'none<span style="color: #494949;">}</span><span style="color: #bbb;">]</span><span style="color: #494949;">]</span>
<span style="color: #494949;">[</span><span style="color: #E53935;">:.sidenote</span> <span style="color: #bbb;">{</span><span style="color: #E53935;">:background-color</span> bg-alt
<span style="color: #E53935;">:padding</span> <span style="color: #494949;">(</span>em 0.5<span style="color: #494949;">)</span>
<span style="color: #E53935;">:display</span> 'block<span style="color: #bbb;">}</span><span style="color: #494949;">]</span>
<span style="color: #494949;">[</span><span style="color: #E53935;">:.sidenote-number</span> <span style="color: #bbb;">{</span><span style="color: #E53935;">:color</span> red<span style="color: #bbb;">}</span><span style="color: #494949;">]</span>
<span style="color: #494949;">[</span><span style="color: #E53935;">:#postamble</span> <span style="color: #bbb;">{</span><span style="color: #E53935;">:color</span> fg-alt
<span style="color: #E53935;">:background-color</span> bg-alt
<span style="color: #E53935;">:padding-left</span> <span style="color: #494949;">(</span>em 0.5<span style="color: #494949;">)</span>
<span style="color: #E53935;">:padding-top</span> <span style="color: #494949;">(</span>em 0.5<span style="color: #494949;">)</span>
<span style="color: #E53935;">:padding-bottom</span> <span style="color: #494949;">(</span>em 0.5<span style="color: #494949;">)</span>
<span style="color: #E53935;">:marign-right</span> <span style="color: #494949;">(</span>em 1<span style="color: #494949;">)</span><span style="color: #bbb;">}</span><span style="color: #494949;">]</span>
</pre>
</div>