-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.html
1273 lines (1139 loc) · 53.7 KB
/
README.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Lilac</title>
<meta name="author" content="Linus Arver" />
<meta name="generator" content="Org Mode" />
<style>
#content { max-width: 60em; margin: auto; }
.title { text-align: center;
margin-bottom: .2em; }
.subtitle { text-align: center;
font-size: medium;
font-weight: bold;
margin-top:0; }
.todo { font-family: monospace; color: red; }
.done { font-family: monospace; color: green; }
.priority { font-family: monospace; color: orange; }
.tag { background-color: #eee; font-family: monospace;
padding: 2px; font-size: 80%; font-weight: normal; }
.timestamp { color: #bebebe; }
.timestamp-kwd { color: #5f9ea0; }
.org-right { margin-left: auto; margin-right: 0px; text-align: right; }
.org-left { margin-left: 0px; margin-right: auto; text-align: left; }
.org-center { margin-left: auto; margin-right: auto; text-align: center; }
.underline { text-decoration: underline; }
#postamble p, #preamble p { font-size: 90%; margin: .2em; }
p.verse { margin-left: 3%; }
pre {
border: 1px solid #e6e6e6;
border-radius: 3px;
background-color: #f2f2f2;
padding: 8pt;
font-family: monospace;
overflow: auto;
margin: 1.2em;
}
pre.src {
position: relative;
overflow: auto;
}
pre.src:before {
display: none;
position: absolute;
top: -8px;
right: 12px;
padding: 3px;
color: #555;
background-color: #f2f2f299;
}
pre.src:hover:before { display: inline; margin-top: 14px;}
/* Languages per Org manual */
pre.src-asymptote:before { content: 'Asymptote'; }
pre.src-awk:before { content: 'Awk'; }
pre.src-authinfo::before { content: 'Authinfo'; }
pre.src-C:before { content: 'C'; }
/* pre.src-C++ doesn't work in CSS */
pre.src-clojure:before { content: 'Clojure'; }
pre.src-css:before { content: 'CSS'; }
pre.src-D:before { content: 'D'; }
pre.src-ditaa:before { content: 'ditaa'; }
pre.src-dot:before { content: 'Graphviz'; }
pre.src-calc:before { content: 'Emacs Calc'; }
pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }
pre.src-fortran:before { content: 'Fortran'; }
pre.src-gnuplot:before { content: 'gnuplot'; }
pre.src-haskell:before { content: 'Haskell'; }
pre.src-hledger:before { content: 'hledger'; }
pre.src-java:before { content: 'Java'; }
pre.src-js:before { content: 'Javascript'; }
pre.src-latex:before { content: 'LaTeX'; }
pre.src-ledger:before { content: 'Ledger'; }
pre.src-lisp:before { content: 'Lisp'; }
pre.src-lilypond:before { content: 'Lilypond'; }
pre.src-lua:before { content: 'Lua'; }
pre.src-matlab:before { content: 'MATLAB'; }
pre.src-mscgen:before { content: 'Mscgen'; }
pre.src-ocaml:before { content: 'Objective Caml'; }
pre.src-octave:before { content: 'Octave'; }
pre.src-org:before { content: 'Org mode'; }
pre.src-oz:before { content: 'OZ'; }
pre.src-plantuml:before { content: 'Plantuml'; }
pre.src-processing:before { content: 'Processing.js'; }
pre.src-python:before { content: 'Python'; }
pre.src-R:before { content: 'R'; }
pre.src-ruby:before { content: 'Ruby'; }
pre.src-sass:before { content: 'Sass'; }
pre.src-scheme:before { content: 'Scheme'; }
pre.src-screen:before { content: 'Gnu Screen'; }
pre.src-sed:before { content: 'Sed'; }
pre.src-sh:before { content: 'shell'; }
pre.src-sql:before { content: 'SQL'; }
pre.src-sqlite:before { content: 'SQLite'; }
/* additional languages in org.el's org-babel-load-languages alist */
pre.src-forth:before { content: 'Forth'; }
pre.src-io:before { content: 'IO'; }
pre.src-J:before { content: 'J'; }
pre.src-makefile:before { content: 'Makefile'; }
pre.src-maxima:before { content: 'Maxima'; }
pre.src-perl:before { content: 'Perl'; }
pre.src-picolisp:before { content: 'Pico Lisp'; }
pre.src-scala:before { content: 'Scala'; }
pre.src-shell:before { content: 'Shell Script'; }
pre.src-ebnf2ps:before { content: 'ebfn2ps'; }
/* additional language identifiers per "defun org-babel-execute"
in ob-*.el */
pre.src-cpp:before { content: 'C++'; }
pre.src-abc:before { content: 'ABC'; }
pre.src-coq:before { content: 'Coq'; }
pre.src-groovy:before { content: 'Groovy'; }
/* additional language identifiers from org-babel-shell-names in
ob-shell.el: ob-shell is the only babel language using a lambda to put
the execution function name together. */
pre.src-bash:before { content: 'bash'; }
pre.src-csh:before { content: 'csh'; }
pre.src-ash:before { content: 'ash'; }
pre.src-dash:before { content: 'dash'; }
pre.src-ksh:before { content: 'ksh'; }
pre.src-mksh:before { content: 'mksh'; }
pre.src-posh:before { content: 'posh'; }
/* Additional Emacs modes also supported by the LaTeX listings package */
pre.src-ada:before { content: 'Ada'; }
pre.src-asm:before { content: 'Assembler'; }
pre.src-caml:before { content: 'Caml'; }
pre.src-delphi:before { content: 'Delphi'; }
pre.src-html:before { content: 'HTML'; }
pre.src-idl:before { content: 'IDL'; }
pre.src-mercury:before { content: 'Mercury'; }
pre.src-metapost:before { content: 'MetaPost'; }
pre.src-modula-2:before { content: 'Modula-2'; }
pre.src-pascal:before { content: 'Pascal'; }
pre.src-ps:before { content: 'PostScript'; }
pre.src-prolog:before { content: 'Prolog'; }
pre.src-simula:before { content: 'Simula'; }
pre.src-tcl:before { content: 'tcl'; }
pre.src-tex:before { content: 'TeX'; }
pre.src-plain-tex:before { content: 'Plain TeX'; }
pre.src-verilog:before { content: 'Verilog'; }
pre.src-vhdl:before { content: 'VHDL'; }
pre.src-xml:before { content: 'XML'; }
pre.src-nxml:before { content: 'XML'; }
/* add a generic configuration mode; LaTeX export needs an additional
(add-to-list 'org-latex-listings-langs '(conf " ")) in .emacs */
pre.src-conf:before { content: 'Configuration File'; }
table { border-collapse:collapse; }
caption.t-above { caption-side: top; }
caption.t-bottom { caption-side: bottom; }
td, th { vertical-align:top; }
th.org-right { text-align: center; }
th.org-left { text-align: center; }
th.org-center { text-align: center; }
td.org-right { text-align: right; }
td.org-left { text-align: left; }
td.org-center { text-align: center; }
dt { font-weight: bold; }
.footpara { display: inline; }
.footdef { margin-bottom: 1em; }
.figure { padding: 1em; }
.figure p { text-align: center; }
.equation-container {
display: table;
text-align: center;
width: 100%;
}
.equation {
vertical-align: middle;
}
.equation-label {
display: table-cell;
text-align: right;
vertical-align: middle;
}
.inlinetask {
padding: 10px;
border: 2px solid gray;
margin: 10px;
background: #ffffcc;
}
#org-div-home-and-up
{ text-align: right; font-size: 70%; white-space: nowrap; }
textarea { overflow-x: auto; }
.linenr { font-size: smaller }
.code-highlighted { background-color: #ffff00; }
.org-info-js_info-navigation { border-style: none; }
#org-info-js_console-label
{ font-size: 10px; font-weight: bold; white-space: nowrap; }
.org-info-js_search-highlight
{ background-color: #ffff00; color: #000000; font-weight: bold; }
.org-svg { }
</style>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,opsz,wght@0,8..60,200..900;1,8..60,200..900&family=Source+Sans+3:ital,wght@0,200..900;1,200..900&family=Source+Code+Pro:ital,wght@0,200..900;1,200..900">
<script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>
<script src="lilac.js"></script>
<link rel="stylesheet" type="text/css" href="syntax-highlighting.css"/>
<link rel="stylesheet" type="text/css" href="lilac.css" />
<!-- LILAC_HTML_HEAD -->
<script>
// @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later
function CodeHighlightOn(elem, id)
{
var target = document.getElementById(id);
if(null != target) {
elem.classList.add("code-highlighted");
target.classList.add("code-highlighted");
}
}
function CodeHighlightOff(elem, id)
{
var target = document.getElementById(id);
if(null != target) {
elem.classList.remove("code-highlighted");
target.classList.remove("code-highlighted");
}
}
// @license-end
</script>
<script>
window.MathJax = {
tex: {
ams: {
multlineWidth: '85%'
},
tags: 'ams',
tagSide: 'right',
tagIndent: '.8em'
},
chtml: {
scale: 1.0,
displayAlign: 'center',
displayIndent: '0em'
},
svg: {
scale: 1.0,
displayAlign: 'center',
displayIndent: '0em'
},
output: {
font: 'mathjax-modern',
displayOverflow: 'overflow'
}
};
</script>
<script
id="MathJax-script"
async
src="https://cdn.jsdelivr.net/npm/mathjax@4.0.0-beta.4/tex-mml-chtml.js">
</script>
</head>
<body>
<div id="content" class="content">
<h1 class="title">Lilac</h1>
<div id="table-of-contents" role="doc-toc">
<div id="text-table-of-contents" role="doc-toc">
<ul>
<li><a href="#h-Introduction">1. Introduction</a>
<ul>
<li><a href="#h-Motivation-and-differences-vs-Org-defaults">1.1. Motivation and differences vs Org defaults</a>
<ul>
<li><a href="#h-Source-code-block-captions">1.1.1. Source code block captions</a>
<ul>
<li><a href="#h-Org-defaults">1.1.1.1. Org defaults</a></li>
<li><a href="#h-Lilac">1.1.1.2. Lilac</a></li>
</ul>
</li>
<li><a href="#h-Source-code-block-links">1.1.2. Source code block links</a>
<ul>
<li><a href="#h-Org-defaults-1">1.1.2.1. Org defaults</a></li>
<li><a href="#h-Lilac-1">1.1.2.2. Lilac</a></li>
</ul>
</li>
<li><a href="#h-Link-IDs">1.1.3. Link IDs</a>
<ul>
<li><a href="#h-Org-defaults-2">1.1.3.1. Org defaults</a></li>
<li><a href="#h-Lilac-2">1.1.3.2. Lilac</a></li>
</ul>
</li>
<li><a href="#h-HTML-Table-of-Contents">1.1.4. HTML Table of Contents</a>
<ul>
<li><a href="#h-Org-defaults-3">1.1.4.1. Org defaults</a></li>
<li><a href="#h-Lilac-3">1.1.4.2. Lilac</a></li>
</ul>
</li>
<li><a href="#h-Side-notes--aka--margin-notes">1.1.5. Side notes, aka "margin notes"</a>
<ul>
<li><a href="#h-Org-defaults-4">1.1.5.1. Org defaults</a></li>
<li><a href="#h-Lilac-4">1.1.5.2. Lilac</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li><a href="#h-User-Guide">2. User Guide</a>
<ul>
<li><a href="#h-Source-code-blocks--monoblocks-and-polyblocks">2.1. Source code blocks: monoblocks and polyblocks</a>
<ul>
<li><a href="#h-Examples-of-source-code-blocks">2.1.1. Examples of source code blocks</a>
<ul>
<li><a href="#h-Multi-parent-child-blocks">2.1.1.1. Multi-parent child blocks</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#h-Examples">2.2. Examples</a>
<ul>
<li><a href="#h-Code-blocks">2.2.1. Code blocks</a>
<ul>
<li><a href="#h-Source-blocks">2.2.1.1. Source blocks</a>
<ul>
<li><a href="#h-Plain">2.2.1.1.1. Plain</a></li>
<li><a href="#h-Monoblock">2.2.1.1.2. Monoblock</a></li>
<li><a href="#h-Monoblock--evaluation-result-s-value">2.2.1.1.3. Monoblock (evaluation result's value)</a></li>
<li><a href="#h-Monoblock--pass-argument-to-source-code-block">2.2.1.1.4. Monoblock (pass argument to source code block)</a></li>
<li><a href="#h-Polyblock">2.2.1.1.5. Polyblock</a></li>
<li><a href="#h-Linking-to-a-line-in-the-code-block-body">2.2.1.1.6. Linking to a line in the code block body</a></li>
</ul>
</li>
<li><a href="#h-Example-blocks">2.2.1.2. Example blocks</a></li>
<li><a href="#h-Quote-blocks">2.2.1.3. Quote blocks</a></li>
</ul>
</li>
<li><a href="#h-Side-notes">2.2.2. Side notes</a></li>
<li><a href="#h-Math--MathJax">2.2.3. Math (MathJax)</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#h-Known-limitations">3. Known limitations</a></li>
<li><a href="#h-Developer-Guide">4. Developer Guide</a></li>
<li><a href="#h-Glossary">5. Glossary</a></li>
<li><a href="#h-Projects-using-Lilac">6. Projects using Lilac</a></li>
<li><a href="#h-References">7. References</a></li>
</ul>
</div>
</div>
<div id="outline-container-h-Introduction" class="outline-2">
<h2 id="h-Introduction"><span class="section-number-2">1.</span> Introduction</h2>
<div class="outline-text-2" id="text-h-Introduction">
<div class="sidenote" id="org0000000">
<p>
The <i>lilac</i> is a <a href="https://en.wikipedia.org/wiki/Syringa">flowering woody plant</a>.
</p>
</div>
<p>
<i>Lilac</i> is an addon for Emacs Org mode to make <a href="https://en.wikipedia.org/wiki/Literate_programming">Literate Programming</a> (LP) using
<a href="#org0000001">Noweb</a>-style <a href="#citeproc_bib_item_1">[1]</a> references easy. It comes in two parts:
</p>
<ol class="org-ol">
<li><code>lilac.el</code>: to be loaded and used when <a href="#org0000003"><i>weaving</i></a> <a href="#citeproc_bib_item_2">[2, p. 98]</a> and
<a href="#org0000005"><i>tangling</i></a> <a href="#citeproc_bib_item_2">[2, p. 98]</a> from your own Org mode files (which use
Noweb references), and</li>
<li><code>lilac.theme</code>: to be sourced by your Org mode files to use Lilac's CSS and
JavaScript on top of the HTML export.</li>
</ol>
<p>
This document itself reuses the <code>lilac.theme</code> file, which gives you a preview
(if you are viewing the HTML output) of what weaving with Lilac looks like.
</p>
<p>
NOTE: Do not view this page using GitHub's default Org file viewer, because many
sections will appear broken. Instead, please view this page by visiting
<a href="https://funloop.org/lilac">https://funloop.org/lilac</a>, or by cloning <a href="https://github.com/listx/lilac">the repository</a> and pointing your
browser to the top-level index.html file directly.
</p>
</div>
<div id="outline-container-h-Motivation-and-differences-vs-Org-defaults" class="outline-3">
<h3 id="h-Motivation-and-differences-vs-Org-defaults"><span class="section-number-3">1.1.</span> Motivation and differences vs Org defaults</h3>
<div class="outline-text-3" id="text-h-Motivation-and-differences-vs-Org-defaults">
<p>
Lilac sacrifices some degree of customization in Org mode in order to make it
easier to write literate programs using Noweb-style references. Lilac also
focuses on HTML export for <i>weaving</i>.
</p>
<p>
The following are some examples of how things are done in the default Org mode
settings, and how Lilac does things differently.
</p>
</div>
<div id="outline-container-h-Source-code-block-captions" class="outline-4">
<h4 id="h-Source-code-block-captions"><span class="section-number-4">1.1.1.</span> Source code block captions</h4>
<div class="outline-text-4" id="text-h-Source-code-block-captions">
</div>
<div id="outline-container-h-Org-defaults" class="outline-5">
<h5 id="h-Org-defaults"><span class="section-number-5">1.1.1.1.</span> Org defaults</h5>
<div class="outline-text-5" id="text-h-Org-defaults">
<p>
By default, source code blocks do not get any captions in the HTML output. This
can be an annoyance for LP because you have to manually explain the name of each
block to keep track of their usage in other blocks (when referring to them with
Noweb style references).
</p>
</div>
</div>
<div id="outline-container-h-Lilac" class="outline-5">
<h5 id="h-Lilac"><span class="section-number-5">1.1.1.2.</span> Lilac</h5>
<div class="outline-text-5" id="text-h-Lilac">
<p>
Lilac frees you from having to write a custom <code>#+caption: ...</code> text for every
source code block, because it generates them based on the name of the Noweb
reference. Lilac links child blocks and parent blocks together so that you can
click on code block names to navigate around this parent/child hierarchy.
</p>
</div>
</div>
</div>
<div id="outline-container-h-Source-code-block-links" class="outline-4">
<h4 id="h-Source-code-block-links"><span class="section-number-4">1.1.2.</span> Source code block links</h4>
<div class="outline-text-4" id="text-h-Source-code-block-links">
</div>
<div id="outline-container-h-Org-defaults-1" class="outline-5">
<h5 id="h-Org-defaults-1"><span class="section-number-5">1.1.2.1.</span> Org defaults</h5>
<div class="outline-text-5" id="text-h-Org-defaults-1">
<p>
While Org mode allows source code blocks to refer to other blocks (Noweb
references), it does not do any kind of linking. So you can write blocks like
</p>
<div class="org-src-container"><pre class="src src-org" id="nil-1"><span class="org-org-meta-line">#+name: example-parent-block</span>
<span class="org-org-block-begin-line">#+begin_src bash</span>
<span class="org-org-block"><span class="org-builtin">echo</span></span><span class="org-org-block"> </span><span class="org-org-block"><span class="org-string">"Hello from the parent block"</span></span>
<span class="org-org-block"><<some-other-block>></span>
<span class="org-org-block-end-line">#+end_src</span>
...
<span class="org-org-meta-line">#+name: some-child-block</span>
<span class="org-org-block-begin-line">#+begin_src bash</span>
<span class="org-org-block"><span class="org-builtin">echo</span></span><span class="org-org-block"> </span><span class="org-org-block"><span class="org-string">"I am child 1"</span></span>
<span class="org-org-block-end-line">#+end_src</span>
</pre></div><p>
but when this is exported to HTML neither <code>example-parent-block</code> nor
<code>some-child-block</code> have any links to each other. This is frustrating because it
makes navigating between them difficult.
</p>
<p>
Org mode does not create link anchors for headings, which makes referring to
them from other external documents slightly annoying. Org mode does not add link
anchors to source code blocks.
</p>
</div>
</div>
<div id="outline-container-h-Lilac-1" class="outline-5">
<h5 id="h-Lilac-1"><span class="section-number-5">1.1.2.2.</span> Lilac</h5>
<div class="outline-text-5" id="text-h-Lilac-1">
<p>
Lilac automatically links child blocks and parent blocks together so that you
can click on code block names to navigate around this parent/child hierarchy.
</p>
<p>
Also, link anchors are added to all source code blocks as well as headlines,
and they are saved in your browser's history as you click around, such that you
can go back/forward and be taken back to these intra-document locations. This
makes intra-document navigation more structured to help prevent you from getting
lost.
</p>
</div>
</div>
</div>
<div id="outline-container-h-Link-IDs" class="outline-4">
<h4 id="h-Link-IDs"><span class="section-number-4">1.1.3.</span> Link IDs</h4>
<div class="outline-text-4" id="text-h-Link-IDs">
</div>
<div id="outline-container-h-Org-defaults-2" class="outline-5">
<h5 id="h-Org-defaults-2"><span class="section-number-5">1.1.3.1.</span> Org defaults</h5>
<div class="outline-text-5" id="text-h-Org-defaults-2">
<p>
Org mode generates random link ID's on every export. That is, even if you change
nothing in your Org mode file, if you export to HTML there <b>will</b> be a diff
because all of the linked objects will get a new link ID.
</p>
</div>
</div>
<div id="outline-container-h-Lilac-2" class="outline-5">
<h5 id="h-Lilac-2"><span class="section-number-5">1.1.3.2.</span> Lilac</h5>
<div class="outline-text-5" id="text-h-Lilac-2">
<p>
Lilac makes HTML generation deterministic. This makes it VCS and CI-friendly
because the output changes if and only if the input changes. Speaking of
CI-friendliness, Lilac was designed to be run from outside of Emacs by default
(and not interactively).
</p>
</div>
</div>
</div>
<div id="outline-container-h-HTML-Table-of-Contents" class="outline-4">
<h4 id="h-HTML-Table-of-Contents"><span class="section-number-4">1.1.4.</span> HTML Table of Contents</h4>
<div class="outline-text-4" id="text-h-HTML-Table-of-Contents">
</div>
<div id="outline-container-h-Org-defaults-3" class="outline-5">
<h5 id="h-Org-defaults-3"><span class="section-number-5">1.1.4.1.</span> Org defaults</h5>
<div class="outline-text-5" id="text-h-Org-defaults-3">
<p>
When exporting to HTML, the Table of Contents (TOC) is at the top of the
document.
</p>
</div>
</div>
<div id="outline-container-h-Lilac-3" class="outline-5">
<h5 id="h-Lilac-3"><span class="section-number-5">1.1.4.2.</span> Lilac</h5>
<div class="outline-text-5" id="text-h-Lilac-3">
<p>
Lilac puts the TOC in a sidebar on the left. It also uses some JavaScript to
check where the current mouse position is to update the current location in the
TOC. That is, the TOC follows you as you scroll down the document.
</p>
</div>
</div>
</div>
<div id="outline-container-h-Side-notes--aka--margin-notes" class="outline-4">
<h4 id="h-Side-notes--aka--margin-notes"><span class="section-number-4">1.1.5.</span> Side notes, aka "margin notes"</h4>
<div class="outline-text-4" id="text-h-Side-notes--aka--margin-notes">
</div>
<div id="outline-container-h-Org-defaults-4" class="outline-5">
<h5 id="h-Org-defaults-4"><span class="section-number-5">1.1.5.1.</span> Org defaults</h5>
<div class="outline-text-5" id="text-h-Org-defaults-4">
<p>
Side notes are used to insert notes on the right-hand-side margin, and are
inspired by the ones found in Donald Knuth's books.
</p>
<p>
They are not supported in Org mode.
</p>
</div>
</div>
<div id="outline-container-h-Lilac-4" class="outline-5">
<h5 id="h-Lilac-4"><span class="section-number-5">1.1.5.2.</span> Lilac</h5>
<div class="outline-text-5" id="text-h-Lilac-4">
<p>
Lilac supports the <code>#+begin_sidenote</code> and <code>#+end_sidenote</code> delimiters. Text
inside such delimiters are shown on the right hand margin.
</p>
</div>
</div>
</div>
</div>
</div>
<div id="outline-container-h-User-Guide" class="outline-2">
<h2 id="h-User-Guide"><span class="section-number-2">2.</span> User Guide</h2>
<div class="outline-text-2" id="text-h-User-Guide">
<p>
First create an Org mode file that uses LP. Then either clone this repo or add
it as a submodule to your project. The point is to get the <code>lilac.el</code> (and its
dependencies, themselves submodules) and <code>lilac.theme</code> (and associated
CSS/JavaScript files) available locally. Then for the Org mode file you are
using, you can load <code>lilac.el</code> and run <code>(lilac-publish)</code> to generate the HTML
file, or run <code>(org-babel-tangle)</code> to generate the source code from it. See the
<code>Makefile</code> that this project uses as a reference.
</p>
<p>
The main thing that you need to keep in mind when writing Org mode files for
consumption by Lilac is that the source code blocks must use Noweb references
using <code>__NREF__</code> as a prefix. See the discussion below.
</p>
</div>
<div id="outline-container-h-Source-code-blocks--monoblocks-and-polyblocks" class="outline-3">
<h3 id="h-Source-code-blocks--monoblocks-and-polyblocks"><span class="section-number-3">2.1.</span> Source code blocks: monoblocks and polyblocks</h3>
<div class="outline-text-3" id="text-h-Source-code-blocks--monoblocks-and-polyblocks">
<p>
In Org mode, Noweb-style references by default must be enclosed in double angle
brackets <code><<</code> and <code>>></code>. While this works, it's problematic because it can mean
different things syntactically based on the source code language. Your source
code block's language might think that the angle brackets are operators or
keywords and colorize them differently, for example.
</p>
<p>
Instead, Lilac expects Noweb-style references in the form <code>__NREF__foo</code> (where
the "NREF" stands for "Noweb reference"). Then you are free to name your child
block with this same <code>__NREF__foo</code> name. This is better because now you can
search for this word <code>__NREF__foo</code> in your raw Org mode document and you'll
instantly be able to see where it is used. Contrast this with the default Org
mode behavior where you'll have to search for <code><<foo>></code> and <code>foo</code> separately
(because searching for just <code>foo</code> may collide with other names that are not
source code block names).
</p>
<p>
In the example below, the <code>parent-block</code> refers to 2 other child blocks for its
definition.
</p>
<div class="org-src-container"><div class="lilac-pre-with-caption"><div class="lilac-caption"><label class="org-src-name">Sample Org-mode Noweb-style references</label><span class="lilac-caption-link-symbol"><a href="#Sample-Org-mode-Noweb-style-references">🔗</a></span></div><pre class="src src-org" id="Sample-Org-mode-Noweb-style-references"><span class="org-org-meta-line">#+name: parent-block</span>
<span class="org-org-block-begin-line">#+begin_src bash</span>
<span class="org-org-block"><span class="org-builtin">echo</span></span><span class="org-org-block"> </span><span class="org-org-block"><span class="org-string">"Hello from the parent block"</span></span>
<span class="org-org-block">__NREF__child-block-1</span>
<span class="org-org-block">__NREF__child-block-2</span>
<span class="org-org-block-end-line">#+end_src</span>
...
<span class="org-org-meta-line">#+name: __NREF__child-block-1</span>
<span class="org-org-block-begin-line">#+begin_src bash</span>
<span class="org-org-block"><span class="org-builtin">echo</span></span><span class="org-org-block"> </span><span class="org-org-block"><span class="org-string">"I am child 1"</span></span>
<span class="org-org-block-end-line">#+end_src</span>
...
<span class="org-org-meta-line">#+header: :noweb-ref __NREF__child-block-2</span>
<span class="org-org-block-begin-line">#+begin_src bash</span>
<span class="org-org-block"><span class="org-builtin">echo</span></span><span class="org-org-block"> -n </span><span class="org-org-block"><span class="org-string">"I am "</span></span>
<span class="org-org-block-end-line">#+end_src</span>
<span class="org-org-meta-line">#+header: :noweb-ref __NREF__child-block-2</span>
<span class="org-org-block-begin-line">#+begin_src bash</span>
<span class="org-org-block"><span class="org-builtin">echo</span></span><span class="org-org-block"> </span><span class="org-org-block"><span class="org-string">"child 2"</span></span>
<span class="org-org-block-end-line">#+end_src</span>
</pre></div></div><p>
This example illustrates the two ways to define a child block: either as a
single code block with <code>#+name: __NREF__foo</code>, or as multiple blocks with
<code>#+header: :noweb-ref __NREF__foo</code>. Lilac calls them <a href="#org000000b">monoblocks</a> and <a href="#org000000d">polyblocks</a>
respectively. Polyblocks are concatenated together in the order they appear in
the overall Org file; this final concatenated version is what gets inserted into
the Noweb reference in the parent block.
</p>
</div>
<div id="outline-container-h-Examples-of-source-code-blocks" class="outline-4">
<h4 id="h-Examples-of-source-code-blocks"><span class="section-number-4">2.1.1.</span> Examples of source code blocks</h4>
<div class="outline-text-4" id="text-h-Examples-of-source-code-blocks">
<p>
Below is an example of the usage described above. Notice how the child blocks
referenced in the parent block are linked to their definitions.
</p>
<div class="org-src-container"><div class="lilac-pre-with-caption"><div class="lilac-caption"><label class="org-src-name">example-parent-block</label><span class="lilac-caption-link-symbol"><a href="#example-parent-block">🔗</a></span></div><pre class="src src-bash" id="example-parent-block"><span class="org-builtin">echo</span> <span class="org-string">"Hello from the parent block"</span>
<span class="lilac-child-link-from-parent"><a href="#__NREF__example-child-block-foo">example-child-block-foo</a></span>
<span class="org-builtin">echo</span> <span class="org-string">""</span>
<span class="lilac-child-link-from-parent"><a href="#__NREF__example-child-block-bar-1">example-child-block-bar</a></span>
</pre></div></div><p>
Below are the child blocks. The first is a monoblock. Every child block's name
links back up to the parent block where it is referenced.
</p>
<div class="org-src-container"><div class="lilac-pre-with-caption"><div class="lilac-caption"><span class="lilac-caption-parent-link"><a href="#example-parent-block">example-child-block-foo</a></span><span class="lilac-caption-link-symbol"><a href="#__NREF__example-child-block-foo">🔗</a></span></div><pre class="src src-bash" id="__NREF__example-child-block-foo"><span class="org-builtin">echo</span> <span class="org-string">"I am child 1"</span>
</pre></div></div><p>
The blocks below are polyblocks.
</p>
<div class="org-src-container"><div class="lilac-pre-with-caption"><div class="lilac-caption"><span class="lilac-caption-parent-link"><a href="#example-parent-block">example-child-block-bar</a></span>(1/2) <span class="lilac-caption-link-symbol"><a href="#__NREF__example-child-block-bar-1">🔗</a></span></div><pre class="src src-bash" id="__NREF__example-child-block-bar-1"><span class="org-builtin">echo</span> -n <span class="org-string">"I am "</span>
</pre></div></div><p>
Note the fraction after the name which denotes the position of the block in the
overall polyblock "chain".
</p>
<div class="org-src-container"><div class="lilac-pre-with-caption"><div class="lilac-caption"><span class="lilac-caption-parent-link"><a href="#example-parent-block">example-child-block-bar</a></span>(2/2) <span class="lilac-caption-link-symbol"><a href="#__NREF__example-child-block-bar-2">🔗</a></span></div><pre class="src src-bash" id="__NREF__example-child-block-bar-2"><span class="org-builtin">echo</span> <span class="org-string">"child 2"</span>
</pre></div></div>
</div>
<div id="outline-container-h-Multi-parent-child-blocks" class="outline-5">
<h5 id="h-Multi-parent-child-blocks"><span class="section-number-5">2.1.1.1.</span> Multi-parent child blocks</h5>
<div class="outline-text-5" id="text-h-Multi-parent-child-blocks">
<p>
Sometimes a piece of code will be reused in different source code blocks. You
can think of it as constants in a programming language, but in LP the concept
extends to any arbitrary piece of text.
</p>
<p>
Below is an example where we define a child block once…
</p>
<div class="org-src-container"><div class="lilac-pre-with-caption"><div class="lilac-caption"><span class="lilac-caption-parent-link"><a href="#example-parent-1">example-child-block-baz</a></span><span class="lilac-caption-parent-link"><a href="#example-parent-2">2</a></span><span class="lilac-caption-link-symbol"><a href="#__NREF__example-child-block-baz">🔗</a></span></div><pre class="src src-bash" id="__NREF__example-child-block-baz"><span class="org-builtin">echo</span> <span class="org-string">"Hello from child block baz"</span>
</pre></div></div><p>
…but where we also reuse it (reference it) in different parent blocks.
</p>
<div class="org-src-container"><div class="lilac-pre-with-caption"><div class="lilac-caption"><label class="org-src-name">example-parent-1</label><span class="lilac-caption-link-symbol"><a href="#example-parent-1">🔗</a></span></div><pre class="src src-bash" id="example-parent-1"><span class="org-builtin">echo</span> <span class="org-string">"Hello from parent 1"</span>
<span class="lilac-child-link-from-parent"><a href="#__NREF__example-child-block-baz">example-child-block-baz</a></span>
</pre></div></div><div class="org-src-container"><div class="lilac-pre-with-caption"><div class="lilac-caption"><label class="org-src-name">example-parent-2</label><span class="lilac-caption-link-symbol"><a href="#example-parent-2">🔗</a></span></div><pre class="src src-bash" id="example-parent-2"><span class="org-builtin">echo</span> <span class="org-string">"Hello from parent 2"</span>
<span class="lilac-child-link-from-parent"><a href="#__NREF__example-child-block-baz">example-child-block-baz</a></span>
</pre></div></div><p>
Notice that the child block has an additional link named "2", which points to
the second parent that references this block (the first parent is linked by the
child block name itself, as in the previous example). If it is referenced in
additional parent blocks, they will show up as links "3", "4", etc.
</p>
</div>
</div>
</div>
</div>
<div id="outline-container-h-Examples" class="outline-3">
<h3 id="h-Examples"><span class="section-number-3">2.2.</span> Examples</h3>
<div class="outline-text-3" id="text-h-Examples">
<p>
Here we have some examples of how certain Org mode features look when exported
to HTML with Lilac. Each section has an orgmode input and HTML output. The input
is what you type into your <code>*.org</code> (plaintext) file, and the output is what you
get in HTML after it is rendered with Lilac's publishing function,
<code>(lilac-publish)</code>.
</p>
</div>
<div id="outline-container-h-Code-blocks" class="outline-4">
<h4 id="h-Code-blocks"><span class="section-number-4">2.2.1.</span> Code blocks</h4>
<div class="outline-text-4" id="text-h-Code-blocks">
</div>
<div id="outline-container-h-Source-blocks" class="outline-5">
<h5 id="h-Source-blocks"><span class="section-number-5">2.2.1.1.</span> Source blocks</h5>
<div class="outline-text-5" id="text-h-Source-blocks">
</div>
<div id="outline-container-h-Plain" class="outline-6">
<h6 id="h-Plain"><span class="section-number-6">2.2.1.1.1.</span> Plain</h6>
<div class="outline-text-6" id="text-h-Plain">
<p>
Orgmode input:
</p>
<div class="org-src-container"><pre class="src src-plaintext" id="nil-2">#+begin_src python
def foo():
return 42
#+end_src
</pre></div><p>
Rendered HTML output:
</p>
<div class="org-src-container"><pre class="src src-python" id="nil-3"><span class="org-keyword">def</span> <span class="org-function-name">foo</span>():
<span class="org-keyword">return</span> 42
</pre></div>
</div>
</div>
<div id="outline-container-h-Monoblock" class="outline-6">
<h6 id="h-Monoblock"><span class="section-number-6">2.2.1.1.2.</span> Monoblock</h6>
<div class="outline-text-6" id="text-h-Monoblock">
<p>
Orgmode input:
</p>
<div class="sidenote" id="org0000021">
<p>
Although the <code>ex_monoblock</code> text is linkified here, ignore it. The text that you
need to write in the Orgmode input is literally <code>__NREF__ex_monoblock</code>. Lilac
currently doesn't understand that the block here is an example and that it
should not linkify it.
</p>
</div>
<div class="org-src-container"><pre class="src src-plaintext" id="nil-4">#+caption: A parent block.
#+begin_src python
def foo():
<span class="lilac-child-link-from-parent"><a href="#__NREF__ex_monoblock">ex_monoblock</a></span>
return 42
#+end_src
#+name: <span class="lilac-child-link-from-parent"><a href="#__NREF__ex_monoblock">ex_monoblock</a></span>
#+begin_src python
print("hello world")
#+end_src
</pre></div><p>
Rendered HTML output:
</p>
<div class="org-src-container"><div class="lilac-pre-with-caption"><div class="lilac-caption"><label class="org-src-name">A parent block.</label><span class="lilac-caption-link-symbol"><a href="#A-parent-block-1">🔗</a></span></div><pre class="src src-python" id="A-parent-block-1"><span class="org-keyword">def</span> <span class="org-function-name">foo</span>():
<span class="lilac-child-link-from-parent"><a href="#__NREF__ex_monoblock">ex_monoblock</a></span>
<span class="org-keyword">return</span> 42
</pre></div></div><div class="sidenote" id="org0000026">
<p>
Similarly, the <code>2</code> link is only here because Lilac thinks that this child block
is referenced in multiple blocks. In a real example this <code>2</code> would not show up.
</p>
</div>
<div class="org-src-container"><div class="lilac-pre-with-caption"><div class="lilac-caption"><span class="lilac-caption-parent-link"><a href="#nil-4">ex_monoblock</a></span><span class="lilac-caption-parent-link"><a href="#A-parent-block-1">2</a></span><span class="lilac-caption-link-symbol"><a href="#__NREF__ex_monoblock">🔗</a></span></div><pre class="src src-python" id="__NREF__ex_monoblock"><span class="org-builtin">print</span>(<span class="org-string">"hello world"</span>)
</pre></div></div>
</div>
</div>
<div id="outline-container-h-Monoblock--evaluation-result-s-value" class="outline-6">
<h6 id="h-Monoblock--evaluation-result-s-value"><span class="section-number-6">2.2.1.1.3.</span> Monoblock (evaluation result's value)</h6>
<div class="outline-text-6" id="text-h-Monoblock--evaluation-result-s-value">
<p>
Sometimes it's useful to evaluate code and to use the resulting value. This is
in contrast to always inserting the contents of the source code blocks
literally.
</p>
<p>
However you must make sure that the referenced source code block's programming
language is added to the list of <code>org-babel-do-load-languages</code>. Otherwise the
evaluation will be forbidden.
</p>
<p>
Orgmode input:
</p>
<div class="org-src-container"><pre class="src src-plaintext" id="nil-5">#+name: __NREF__ex_evaluate_me
#+begin_src python :exports none
return 4 * 10 + 2
#+end_src
#+caption: This uses an evaluation result.
#+begin_src python :noweb yes
print("The answer is <<__NREF__ex_evaluate_me()>>")
#+end_src
</pre></div><p>
Rendered HTML output:
</p>
<div class="sidenote" id="org000002b">
<p>
The "42" here is computed by the Python interpreter and then injected into the
print statement's string argument.
</p>
</div>
<div class="org-src-container"><div class="lilac-pre-with-caption"><div class="lilac-caption"><label class="org-src-name">This uses an evaluation result.</label><span class="lilac-caption-link-symbol"><a href="#This-uses-an-evaluation-result">🔗</a></span></div><pre class="src src-python" id="This-uses-an-evaluation-result"><span class="org-builtin">print</span>(<span class="org-string">"The answer is 42"</span>)
</pre></div></div>
</div>
</div>
<div id="outline-container-h-Monoblock--pass-argument-to-source-code-block" class="outline-6">
<h6 id="h-Monoblock--pass-argument-to-source-code-block"><span class="section-number-6">2.2.1.1.4.</span> Monoblock (pass argument to source code block)</h6>
<div class="outline-text-6" id="text-h-Monoblock--pass-argument-to-source-code-block">
<p>
Here we have an example of passing in an argument to a source code block.
</p>
<p>
Orgmode input:
</p>
<div class="org-src-container"><pre class="src src-plaintext" id="nil-6">#+name: __NREF__ex_take_argument
#+begin_src python :exports none :var my_var="foo"
return "Hello, my name is " + my_var
#+end_src
#+caption: Passing string args.
#+begin_src python :noweb yes
print("Call without explicit argument: __NREF__ex_take_argument()")
print("Call with explicit argument: __NREF__ex_take_argument(my_var="bar")")
#+end_src
</pre></div><p>
Rendered HTML output:
</p>
<div class="org-src-container"><div class="lilac-pre-with-caption"><div class="lilac-caption"><label class="org-src-name">Passing string args.</label><span class="lilac-caption-link-symbol"><a href="#Passing-string-args">🔗</a></span></div><pre class="src src-python" id="Passing-string-args"><span class="org-builtin">print</span>(<span class="org-string">"Call without explicit argument: Hello, my name is foo"</span>)
<span class="org-builtin">print</span>(<span class="org-string">"Call with explicit argument: Hello, my name is bar"</span>)
</pre></div></div>
</div>
</div>
<div id="outline-container-h-Polyblock" class="outline-6">
<h6 id="h-Polyblock"><span class="section-number-6">2.2.1.1.5.</span> Polyblock</h6>
<div class="outline-text-6" id="text-h-Polyblock">
<p>
Orgmode input:
</p>
<div class="sidenote" id="org0000032">
<p>
Like above for monoblocks, Lilac needlessly linkifies the source code body text
of the parent block when it doesn't need to (as this is only an illustrative
example).
</p>
</div>
<div class="org-src-container"><pre class="src src-plaintext" id="nil-7">#+caption: A parent block.
#+begin_src python
def foo():
<span class="lilac-child-link-from-parent"><a href="#__NREF__ex_polyblock-1">ex_polyblock</a></span>
return 42
#+end_src
#+header: :noweb-ref <span class="lilac-child-link-from-parent"><a href="#__NREF__ex_polyblock-1">ex_polyblock</a></span>
#+begin_src python
print("hello world")
#+end_src
Some intervening text.
#+header: :noweb-ref <span class="lilac-child-link-from-parent"><a href="#__NREF__ex_polyblock-1">ex_polyblock</a></span>
#+begin_src python
print("abcdefg")
#+end_src
</pre></div><p>
Rendered HTML output:
</p>
<div class="org-src-container"><div class="lilac-pre-with-caption"><div class="lilac-caption"><label class="org-src-name">A parent block.</label><span class="lilac-caption-link-symbol"><a href="#A-parent-block-2">🔗</a></span></div><pre class="src src-python" id="A-parent-block-2"><span class="org-keyword">def</span> <span class="org-function-name">foo</span>():
<span class="lilac-child-link-from-parent"><a href="#__NREF__ex_polyblock-1">ex_polyblock</a></span>
<span class="org-keyword">return</span> 42
</pre></div></div><div class="org-src-container"><div class="lilac-pre-with-caption"><div class="lilac-caption"><span class="lilac-caption-parent-link"><a href="#nil-7">ex_polyblock</a></span><span class="lilac-caption-parent-link"><a href="#A-parent-block-2">2</a></span>(1/2) <span class="lilac-caption-link-symbol"><a href="#__NREF__ex_polyblock-1">🔗</a></span></div><pre class="src src-python" id="__NREF__ex_polyblock-1"><span class="org-builtin">print</span>(<span class="org-string">"hello world"</span>)
</pre></div></div><p>
Some intervening text.
</p>
<div class="org-src-container"><div class="lilac-pre-with-caption"><div class="lilac-caption"><span class="lilac-caption-parent-link"><a href="#nil-7">ex_polyblock</a></span><span class="lilac-caption-parent-link"><a href="#A-parent-block-2">2</a></span>(2/2) <span class="lilac-caption-link-symbol"><a href="#__NREF__ex_polyblock-2">🔗</a></span></div><pre class="src src-python" id="__NREF__ex_polyblock-2"><span class="org-builtin">print</span>(<span class="org-string">"abcdefg"</span>)
</pre></div></div>
</div>
</div>
<div id="outline-container-h-Linking-to-a-line-in-the-code-block-body" class="outline-6">
<h6 id="h-Linking-to-a-line-in-the-code-block-body"><span class="section-number-6">2.2.1.1.6.</span> Linking to a line in the code block body</h6>
<div class="outline-text-6" id="text-h-Linking-to-a-line-in-the-code-block-body">
<div class="sidenote" id="org000003b">
<p>
The <code>-r</code> flag removes these <code>#ref:...</code> labels from the source code. The <code>-l</code>
flag changes the format. In this case we make the format use a leading <code>#</code>
character because that's the comment character in Python. This way they appear
as comments when we are inserting them into the block while still in Orgmode.
</p>
<p>
These links are documented in Org's <a href="https://orgmode.org/manual/Literal-Examples.html">Literal Examples</a> section.
</p>
</div>
<p>
Orgmode input:
</p>
<div class="org-src-container"><pre class="src src-plaintext" id="nil-8">#+begin_src python -r -l "#ref:%s"
print("foo")
print("hi") #ref:embedded-link
print("bar")
#+end_src
The line at [[(embedded-link)][=embedded-link=]] prints "hi".
</pre></div><p>
Rendered HTML output:
</p>
<div class="org-src-container"><pre class="src src-python" id="nil-9"><span class="org-builtin">print</span>(<span class="org-string">"foo"</span>)
<span id="coderef-embedded-link" class="coderef-off"><span class="org-builtin">print</span>(<span class="org-string">"hi"</span>)</span>
<span class="org-builtin">print</span>(<span class="org-string">"bar"</span>)
</pre></div><p>
The line at <a href="#coderef-embedded-link" class="coderef" onmouseover="CodeHighlightOn(this, 'coderef-embedded-link');" onmouseout="CodeHighlightOff(this, 'coderef-embedded-link');"><code>embedded-link</code></a> prints "hi".
</p>
</div>
</div>
</div>
<div id="outline-container-h-Example-blocks" class="outline-5">
<h5 id="h-Example-blocks"><span class="section-number-5">2.2.1.2.</span> Example blocks</h5>
<div class="outline-text-5" id="text-h-Example-blocks">
<p>
Orgmode input:
</p>
<div class="org-src-container"><pre class="src src-plaintext" id="nil-10">#+begin_example
Hello world.
Foo bar.
#+end_example
</pre></div><p>
Rendered HTML output:
</p>
<pre class="example" id="org0000042">
Hello world.
Foo bar.
</pre>
</div>
</div>
<div id="outline-container-h-Quote-blocks" class="outline-5">
<h5 id="h-Quote-blocks"><span class="section-number-5">2.2.1.3.</span> Quote blocks</h5>