Browse code
chore(docs): format index.html
Edward Langley authored on 16/03/2022 08:30:42
Showing 1 changed files
Showing 1 changed files
... | ... |
@@ -1,268 +1,545 @@ |
1 |
-<?xml version="1.0" encoding="utf-8"?> |
|
2 |
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" |
|
3 |
-"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
|
1 |
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
|
4 | 2 |
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> |
5 |
-<head> |
|
6 |
-<!-- 2022-03-16 Wed 01:22 --> |
|
7 |
-<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> |
|
8 |
-<meta name="viewport" content="width=device-width, initial-scale=1" /> |
|
9 |
-<title>README for js-generic-functions</title> |
|
10 |
-<meta name="author" content="Ed L" /> |
|
11 |
-<meta name="generator" content="Org Mode" /> |
|
12 |
-<style> |
|
13 |
- #content { max-width: 60em; margin: auto; } |
|
14 |
- .title { text-align: center; |
|
15 |
- margin-bottom: .2em; } |
|
16 |
- .subtitle { text-align: center; |
|
17 |
- font-size: medium; |
|
18 |
- font-weight: bold; |
|
19 |
- margin-top:0; } |
|
20 |
- .todo { font-family: monospace; color: red; } |
|
21 |
- .done { font-family: monospace; color: green; } |
|
22 |
- .priority { font-family: monospace; color: orange; } |
|
23 |
- .tag { background-color: #eee; font-family: monospace; |
|
24 |
- padding: 2px; font-size: 80%; font-weight: normal; } |
|
25 |
- .timestamp { color: #bebebe; } |
|
26 |
- .timestamp-kwd { color: #5f9ea0; } |
|
27 |
- .org-right { margin-left: auto; margin-right: 0px; text-align: right; } |
|
28 |
- .org-left { margin-left: 0px; margin-right: auto; text-align: left; } |
|
29 |
- .org-center { margin-left: auto; margin-right: auto; text-align: center; } |
|
30 |
- .underline { text-decoration: underline; } |
|
31 |
- #postamble p, #preamble p { font-size: 90%; margin: .2em; } |
|
32 |
- p.verse { margin-left: 3%; } |
|
33 |
- pre { |
|
34 |
- border: 1px solid #e6e6e6; |
|
35 |
- border-radius: 3px; |
|
36 |
- background-color: #f2f2f2; |
|
37 |
- padding: 8pt; |
|
38 |
- font-family: monospace; |
|
39 |
- overflow: auto; |
|
40 |
- margin: 1.2em; |
|
41 |
- } |
|
42 |
- pre.src { |
|
43 |
- position: relative; |
|
44 |
- overflow: auto; |
|
45 |
- } |
|
46 |
- pre.src:before { |
|
47 |
- display: none; |
|
48 |
- position: absolute; |
|
49 |
- top: -8px; |
|
50 |
- right: 12px; |
|
51 |
- padding: 3px; |
|
52 |
- color: #555; |
|
53 |
- background-color: #f2f2f299; |
|
54 |
- } |
|
55 |
- pre.src:hover:before { display: inline; margin-top: 14px;} |
|
56 |
- /* Languages per Org manual */ |
|
57 |
- pre.src-asymptote:before { content: 'Asymptote'; } |
|
58 |
- pre.src-awk:before { content: 'Awk'; } |
|
59 |
- pre.src-authinfo::before { content: 'Authinfo'; } |
|
60 |
- pre.src-C:before { content: 'C'; } |
|
61 |
- /* pre.src-C++ doesn't work in CSS */ |
|
62 |
- pre.src-clojure:before { content: 'Clojure'; } |
|
63 |
- pre.src-css:before { content: 'CSS'; } |
|
64 |
- pre.src-D:before { content: 'D'; } |
|
65 |
- pre.src-ditaa:before { content: 'ditaa'; } |
|
66 |
- pre.src-dot:before { content: 'Graphviz'; } |
|
67 |
- pre.src-calc:before { content: 'Emacs Calc'; } |
|
68 |
- pre.src-emacs-lisp:before { content: 'Emacs Lisp'; } |
|
69 |
- pre.src-fortran:before { content: 'Fortran'; } |
|
70 |
- pre.src-gnuplot:before { content: 'gnuplot'; } |
|
71 |
- pre.src-haskell:before { content: 'Haskell'; } |
|
72 |
- pre.src-hledger:before { content: 'hledger'; } |
|
73 |
- pre.src-java:before { content: 'Java'; } |
|
74 |
- pre.src-js:before { content: 'Javascript'; } |
|
75 |
- pre.src-latex:before { content: 'LaTeX'; } |
|
76 |
- pre.src-ledger:before { content: 'Ledger'; } |
|
77 |
- pre.src-lisp:before { content: 'Lisp'; } |
|
78 |
- pre.src-lilypond:before { content: 'Lilypond'; } |
|
79 |
- pre.src-lua:before { content: 'Lua'; } |
|
80 |
- pre.src-matlab:before { content: 'MATLAB'; } |
|
81 |
- pre.src-mscgen:before { content: 'Mscgen'; } |
|
82 |
- pre.src-ocaml:before { content: 'Objective Caml'; } |
|
83 |
- pre.src-octave:before { content: 'Octave'; } |
|
84 |
- pre.src-org:before { content: 'Org mode'; } |
|
85 |
- pre.src-oz:before { content: 'OZ'; } |
|
86 |
- pre.src-plantuml:before { content: 'Plantuml'; } |
|
87 |
- pre.src-processing:before { content: 'Processing.js'; } |
|
88 |
- pre.src-python:before { content: 'Python'; } |
|
89 |
- pre.src-R:before { content: 'R'; } |
|
90 |
- pre.src-ruby:before { content: 'Ruby'; } |
|
91 |
- pre.src-sass:before { content: 'Sass'; } |
|
92 |
- pre.src-scheme:before { content: 'Scheme'; } |
|
93 |
- pre.src-screen:before { content: 'Gnu Screen'; } |
|
94 |
- pre.src-sed:before { content: 'Sed'; } |
|
95 |
- pre.src-sh:before { content: 'shell'; } |
|
96 |
- pre.src-sql:before { content: 'SQL'; } |
|
97 |
- pre.src-sqlite:before { content: 'SQLite'; } |
|
98 |
- /* additional languages in org.el's org-babel-load-languages alist */ |
|
99 |
- pre.src-forth:before { content: 'Forth'; } |
|
100 |
- pre.src-io:before { content: 'IO'; } |
|
101 |
- pre.src-J:before { content: 'J'; } |
|
102 |
- pre.src-makefile:before { content: 'Makefile'; } |
|
103 |
- pre.src-maxima:before { content: 'Maxima'; } |
|
104 |
- pre.src-perl:before { content: 'Perl'; } |
|
105 |
- pre.src-picolisp:before { content: 'Pico Lisp'; } |
|
106 |
- pre.src-scala:before { content: 'Scala'; } |
|
107 |
- pre.src-shell:before { content: 'Shell Script'; } |
|
108 |
- pre.src-ebnf2ps:before { content: 'ebfn2ps'; } |
|
109 |
- /* additional language identifiers per "defun org-babel-execute" |
|
3 |
+ <head> |
|
4 |
+ <!-- 2022-03-16 Wed 01:22 --> |
|
5 |
+ <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> |
|
6 |
+ <meta name="viewport" content="width=device-width, initial-scale=1" /> |
|
7 |
+ <title>README for js-generic-functions</title> |
|
8 |
+ <meta name="author" content="Ed L" /> |
|
9 |
+ <meta name="generator" content="Org Mode" /> |
|
10 |
+ <style> |
|
11 |
+ #content { |
|
12 |
+ max-width: 60em; |
|
13 |
+ margin: auto; |
|
14 |
+ } |
|
15 |
+ .title { |
|
16 |
+ text-align: center; |
|
17 |
+ margin-bottom: 0.2em; |
|
18 |
+ } |
|
19 |
+ .subtitle { |
|
20 |
+ text-align: center; |
|
21 |
+ font-size: medium; |
|
22 |
+ font-weight: bold; |
|
23 |
+ margin-top: 0; |
|
24 |
+ } |
|
25 |
+ .todo { |
|
26 |
+ font-family: monospace; |
|
27 |
+ color: red; |
|
28 |
+ } |
|
29 |
+ .done { |
|
30 |
+ font-family: monospace; |
|
31 |
+ color: green; |
|
32 |
+ } |
|
33 |
+ .priority { |
|
34 |
+ font-family: monospace; |
|
35 |
+ color: orange; |
|
36 |
+ } |
|
37 |
+ .tag { |
|
38 |
+ background-color: #eee; |
|
39 |
+ font-family: monospace; |
|
40 |
+ padding: 2px; |
|
41 |
+ font-size: 80%; |
|
42 |
+ font-weight: normal; |
|
43 |
+ } |
|
44 |
+ .timestamp { |
|
45 |
+ color: #bebebe; |
|
46 |
+ } |
|
47 |
+ .timestamp-kwd { |
|
48 |
+ color: #5f9ea0; |
|
49 |
+ } |
|
50 |
+ .org-right { |
|
51 |
+ margin-left: auto; |
|
52 |
+ margin-right: 0px; |
|
53 |
+ text-align: right; |
|
54 |
+ } |
|
55 |
+ .org-left { |
|
56 |
+ margin-left: 0px; |
|
57 |
+ margin-right: auto; |
|
58 |
+ text-align: left; |
|
59 |
+ } |
|
60 |
+ .org-center { |
|
61 |
+ margin-left: auto; |
|
62 |
+ margin-right: auto; |
|
63 |
+ text-align: center; |
|
64 |
+ } |
|
65 |
+ .underline { |
|
66 |
+ text-decoration: underline; |
|
67 |
+ } |
|
68 |
+ #postamble p, |
|
69 |
+ #preamble p { |
|
70 |
+ font-size: 90%; |
|
71 |
+ margin: 0.2em; |
|
72 |
+ } |
|
73 |
+ p.verse { |
|
74 |
+ margin-left: 3%; |
|
75 |
+ } |
|
76 |
+ pre { |
|
77 |
+ border: 1px solid #e6e6e6; |
|
78 |
+ border-radius: 3px; |
|
79 |
+ background-color: #f2f2f2; |
|
80 |
+ padding: 8pt; |
|
81 |
+ font-family: monospace; |
|
82 |
+ overflow: auto; |
|
83 |
+ margin: 1.2em; |
|
84 |
+ } |
|
85 |
+ pre.src { |
|
86 |
+ position: relative; |
|
87 |
+ overflow: auto; |
|
88 |
+ } |
|
89 |
+ pre.src:before { |
|
90 |
+ display: none; |
|
91 |
+ position: absolute; |
|
92 |
+ top: -8px; |
|
93 |
+ right: 12px; |
|
94 |
+ padding: 3px; |
|
95 |
+ color: #555; |
|
96 |
+ background-color: #f2f2f299; |
|
97 |
+ } |
|
98 |
+ pre.src:hover:before { |
|
99 |
+ display: inline; |
|
100 |
+ margin-top: 14px; |
|
101 |
+ } |
|
102 |
+ /* Languages per Org manual */ |
|
103 |
+ pre.src-asymptote:before { |
|
104 |
+ content: "Asymptote"; |
|
105 |
+ } |
|
106 |
+ pre.src-awk:before { |
|
107 |
+ content: "Awk"; |
|
108 |
+ } |
|
109 |
+ pre.src-authinfo::before { |
|
110 |
+ content: "Authinfo"; |
|
111 |
+ } |
|
112 |
+ pre.src-C:before { |
|
113 |
+ content: "C"; |
|
114 |
+ } |
|
115 |
+ /* pre.src-C++ doesn't work in CSS */ |
|
116 |
+ pre.src-clojure:before { |
|
117 |
+ content: "Clojure"; |
|
118 |
+ } |
|
119 |
+ pre.src-css:before { |
|
120 |
+ content: "CSS"; |
|
121 |
+ } |
|
122 |
+ pre.src-D:before { |
|
123 |
+ content: "D"; |
|
124 |
+ } |
|
125 |
+ pre.src-ditaa:before { |
|
126 |
+ content: "ditaa"; |
|
127 |
+ } |
|
128 |
+ pre.src-dot:before { |
|
129 |
+ content: "Graphviz"; |
|
130 |
+ } |
|
131 |
+ pre.src-calc:before { |
|
132 |
+ content: "Emacs Calc"; |
|
133 |
+ } |
|
134 |
+ pre.src-emacs-lisp:before { |
|
135 |
+ content: "Emacs Lisp"; |
|
136 |
+ } |
|
137 |
+ pre.src-fortran:before { |
|
138 |
+ content: "Fortran"; |
|
139 |
+ } |
|
140 |
+ pre.src-gnuplot:before { |
|
141 |
+ content: "gnuplot"; |
|
142 |
+ } |
|
143 |
+ pre.src-haskell:before { |
|
144 |
+ content: "Haskell"; |
|
145 |
+ } |
|
146 |
+ pre.src-hledger:before { |
|
147 |
+ content: "hledger"; |
|
148 |
+ } |
|
149 |
+ pre.src-java:before { |
|
150 |
+ content: "Java"; |
|
151 |
+ } |
|
152 |
+ pre.src-js:before { |
|
153 |
+ content: "Javascript"; |
|
154 |
+ } |
|
155 |
+ pre.src-latex:before { |
|
156 |
+ content: "LaTeX"; |
|
157 |
+ } |
|
158 |
+ pre.src-ledger:before { |
|
159 |
+ content: "Ledger"; |
|
160 |
+ } |
|
161 |
+ pre.src-lisp:before { |
|
162 |
+ content: "Lisp"; |
|
163 |
+ } |
|
164 |
+ pre.src-lilypond:before { |
|
165 |
+ content: "Lilypond"; |
|
166 |
+ } |
|
167 |
+ pre.src-lua:before { |
|
168 |
+ content: "Lua"; |
|
169 |
+ } |
|
170 |
+ pre.src-matlab:before { |
|
171 |
+ content: "MATLAB"; |
|
172 |
+ } |
|
173 |
+ pre.src-mscgen:before { |
|
174 |
+ content: "Mscgen"; |
|
175 |
+ } |
|
176 |
+ pre.src-ocaml:before { |
|
177 |
+ content: "Objective Caml"; |
|
178 |
+ } |
|
179 |
+ pre.src-octave:before { |
|
180 |
+ content: "Octave"; |
|
181 |
+ } |
|
182 |
+ pre.src-org:before { |
|
183 |
+ content: "Org mode"; |
|
184 |
+ } |
|
185 |
+ pre.src-oz:before { |
|
186 |
+ content: "OZ"; |
|
187 |
+ } |
|
188 |
+ pre.src-plantuml:before { |
|
189 |
+ content: "Plantuml"; |
|
190 |
+ } |
|
191 |
+ pre.src-processing:before { |
|
192 |
+ content: "Processing.js"; |
|
193 |
+ } |
|
194 |
+ pre.src-python:before { |
|
195 |
+ content: "Python"; |
|
196 |
+ } |
|
197 |
+ pre.src-R:before { |
|
198 |
+ content: "R"; |
|
199 |
+ } |
|
200 |
+ pre.src-ruby:before { |
|
201 |
+ content: "Ruby"; |
|
202 |
+ } |
|
203 |
+ pre.src-sass:before { |
|
204 |
+ content: "Sass"; |
|
205 |
+ } |
|
206 |
+ pre.src-scheme:before { |
|
207 |
+ content: "Scheme"; |
|
208 |
+ } |
|
209 |
+ pre.src-screen:before { |
|
210 |
+ content: "Gnu Screen"; |
|
211 |
+ } |
|
212 |
+ pre.src-sed:before { |
|
213 |
+ content: "Sed"; |
|
214 |
+ } |
|
215 |
+ pre.src-sh:before { |
|
216 |
+ content: "shell"; |
|
217 |
+ } |
|
218 |
+ pre.src-sql:before { |
|
219 |
+ content: "SQL"; |
|
220 |
+ } |
|
221 |
+ pre.src-sqlite:before { |
|
222 |
+ content: "SQLite"; |
|
223 |
+ } |
|
224 |
+ /* additional languages in org.el's org-babel-load-languages alist */ |
|
225 |
+ pre.src-forth:before { |
|
226 |
+ content: "Forth"; |
|
227 |
+ } |
|
228 |
+ pre.src-io:before { |
|
229 |
+ content: "IO"; |
|
230 |
+ } |
|
231 |
+ pre.src-J:before { |
|
232 |
+ content: "J"; |
|
233 |
+ } |
|
234 |
+ pre.src-makefile:before { |
|
235 |
+ content: "Makefile"; |
|
236 |
+ } |
|
237 |
+ pre.src-maxima:before { |
|
238 |
+ content: "Maxima"; |
|
239 |
+ } |
|
240 |
+ pre.src-perl:before { |
|
241 |
+ content: "Perl"; |
|
242 |
+ } |
|
243 |
+ pre.src-picolisp:before { |
|
244 |
+ content: "Pico Lisp"; |
|
245 |
+ } |
|
246 |
+ pre.src-scala:before { |
|
247 |
+ content: "Scala"; |
|
248 |
+ } |
|
249 |
+ pre.src-shell:before { |
|
250 |
+ content: "Shell Script"; |
|
251 |
+ } |
|
252 |
+ pre.src-ebnf2ps:before { |
|
253 |
+ content: "ebfn2ps"; |
|
254 |
+ } |
|
255 |
+ /* additional language identifiers per "defun org-babel-execute" |
|
110 | 256 |
in ob-*.el */ |
111 |
- pre.src-cpp:before { content: 'C++'; } |
|
112 |
- pre.src-abc:before { content: 'ABC'; } |
|
113 |
- pre.src-coq:before { content: 'Coq'; } |
|
114 |
- pre.src-groovy:before { content: 'Groovy'; } |
|
115 |
- /* additional language identifiers from org-babel-shell-names in |
|
257 |
+ pre.src-cpp:before { |
|
258 |
+ content: "C++"; |
|
259 |
+ } |
|
260 |
+ pre.src-abc:before { |
|
261 |
+ content: "ABC"; |
|
262 |
+ } |
|
263 |
+ pre.src-coq:before { |
|
264 |
+ content: "Coq"; |
|
265 |
+ } |
|
266 |
+ pre.src-groovy:before { |
|
267 |
+ content: "Groovy"; |
|
268 |
+ } |
|
269 |
+ /* additional language identifiers from org-babel-shell-names in |
|
116 | 270 |
ob-shell.el: ob-shell is the only babel language using a lambda to put |
117 | 271 |
the execution function name together. */ |
118 |
- pre.src-bash:before { content: 'bash'; } |
|
119 |
- pre.src-csh:before { content: 'csh'; } |
|
120 |
- pre.src-ash:before { content: 'ash'; } |
|
121 |
- pre.src-dash:before { content: 'dash'; } |
|
122 |
- pre.src-ksh:before { content: 'ksh'; } |
|
123 |
- pre.src-mksh:before { content: 'mksh'; } |
|
124 |
- pre.src-posh:before { content: 'posh'; } |
|
125 |
- /* Additional Emacs modes also supported by the LaTeX listings package */ |
|
126 |
- pre.src-ada:before { content: 'Ada'; } |
|
127 |
- pre.src-asm:before { content: 'Assembler'; } |
|
128 |
- pre.src-caml:before { content: 'Caml'; } |
|
129 |
- pre.src-delphi:before { content: 'Delphi'; } |
|
130 |
- pre.src-html:before { content: 'HTML'; } |
|
131 |
- pre.src-idl:before { content: 'IDL'; } |
|
132 |
- pre.src-mercury:before { content: 'Mercury'; } |
|
133 |
- pre.src-metapost:before { content: 'MetaPost'; } |
|
134 |
- pre.src-modula-2:before { content: 'Modula-2'; } |
|
135 |
- pre.src-pascal:before { content: 'Pascal'; } |
|
136 |
- pre.src-ps:before { content: 'PostScript'; } |
|
137 |
- pre.src-prolog:before { content: 'Prolog'; } |
|
138 |
- pre.src-simula:before { content: 'Simula'; } |
|
139 |
- pre.src-tcl:before { content: 'tcl'; } |
|
140 |
- pre.src-tex:before { content: 'TeX'; } |
|
141 |
- pre.src-plain-tex:before { content: 'Plain TeX'; } |
|
142 |
- pre.src-verilog:before { content: 'Verilog'; } |
|
143 |
- pre.src-vhdl:before { content: 'VHDL'; } |
|
144 |
- pre.src-xml:before { content: 'XML'; } |
|
145 |
- pre.src-nxml:before { content: 'XML'; } |
|
146 |
- /* add a generic configuration mode; LaTeX export needs an additional |
|
272 |
+ pre.src-bash:before { |
|
273 |
+ content: "bash"; |
|
274 |
+ } |
|
275 |
+ pre.src-csh:before { |
|
276 |
+ content: "csh"; |
|
277 |
+ } |
|
278 |
+ pre.src-ash:before { |
|
279 |
+ content: "ash"; |
|
280 |
+ } |
|
281 |
+ pre.src-dash:before { |
|
282 |
+ content: "dash"; |
|
283 |
+ } |
|
284 |
+ pre.src-ksh:before { |
|
285 |
+ content: "ksh"; |
|
286 |
+ } |
|
287 |
+ pre.src-mksh:before { |
|
288 |
+ content: "mksh"; |
|
289 |
+ } |
|
290 |
+ pre.src-posh:before { |
|
291 |
+ content: "posh"; |
|
292 |
+ } |
|
293 |
+ /* Additional Emacs modes also supported by the LaTeX listings package */ |
|
294 |
+ pre.src-ada:before { |
|
295 |
+ content: "Ada"; |
|
296 |
+ } |
|
297 |
+ pre.src-asm:before { |
|
298 |
+ content: "Assembler"; |
|
299 |
+ } |
|
300 |
+ pre.src-caml:before { |
|
301 |
+ content: "Caml"; |
|
302 |
+ } |
|
303 |
+ pre.src-delphi:before { |
|
304 |
+ content: "Delphi"; |
|
305 |
+ } |
|
306 |
+ pre.src-html:before { |
|
307 |
+ content: "HTML"; |
|
308 |
+ } |
|
309 |
+ pre.src-idl:before { |
|
310 |
+ content: "IDL"; |
|
311 |
+ } |
|
312 |
+ pre.src-mercury:before { |
|
313 |
+ content: "Mercury"; |
|
314 |
+ } |
|
315 |
+ pre.src-metapost:before { |
|
316 |
+ content: "MetaPost"; |
|
317 |
+ } |
|
318 |
+ pre.src-modula-2:before { |
|
319 |
+ content: "Modula-2"; |
|
320 |
+ } |
|
321 |
+ pre.src-pascal:before { |
|
322 |
+ content: "Pascal"; |
|
323 |
+ } |
|
324 |
+ pre.src-ps:before { |
|
325 |
+ content: "PostScript"; |
|
326 |
+ } |
|
327 |
+ pre.src-prolog:before { |
|
328 |
+ content: "Prolog"; |
|
329 |
+ } |
|
330 |
+ pre.src-simula:before { |
|
331 |
+ content: "Simula"; |
|
332 |
+ } |
|
333 |
+ pre.src-tcl:before { |
|
334 |
+ content: "tcl"; |
|
335 |
+ } |
|
336 |
+ pre.src-tex:before { |
|
337 |
+ content: "TeX"; |
|
338 |
+ } |
|
339 |
+ pre.src-plain-tex:before { |
|
340 |
+ content: "Plain TeX"; |
|
341 |
+ } |
|
342 |
+ pre.src-verilog:before { |
|
343 |
+ content: "Verilog"; |
|
344 |
+ } |
|
345 |
+ pre.src-vhdl:before { |
|
346 |
+ content: "VHDL"; |
|
347 |
+ } |
|
348 |
+ pre.src-xml:before { |
|
349 |
+ content: "XML"; |
|
350 |
+ } |
|
351 |
+ pre.src-nxml:before { |
|
352 |
+ content: "XML"; |
|
353 |
+ } |
|
354 |
+ /* add a generic configuration mode; LaTeX export needs an additional |
|
147 | 355 |
(add-to-list 'org-latex-listings-langs '(conf " ")) in .emacs */ |
148 |
- pre.src-conf:before { content: 'Configuration File'; } |
|
356 |
+ pre.src-conf:before { |
|
357 |
+ content: "Configuration File"; |
|
358 |
+ } |
|
149 | 359 |
|
150 |
- table { border-collapse:collapse; } |
|
151 |
- caption.t-above { caption-side: top; } |
|
152 |
- caption.t-bottom { caption-side: bottom; } |
|
153 |
- td, th { vertical-align:top; } |
|
154 |
- th.org-right { text-align: center; } |
|
155 |
- th.org-left { text-align: center; } |
|
156 |
- th.org-center { text-align: center; } |
|
157 |
- td.org-right { text-align: right; } |
|
158 |
- td.org-left { text-align: left; } |
|
159 |
- td.org-center { text-align: center; } |
|
160 |
- dt { font-weight: bold; } |
|
161 |
- .footpara { display: inline; } |
|
162 |
- .footdef { margin-bottom: 1em; } |
|
163 |
- .figure { padding: 1em; } |
|
164 |
- .figure p { text-align: center; } |
|
165 |
- .equation-container { |
|
166 |
- display: table; |
|
167 |
- text-align: center; |
|
168 |
- width: 100%; |
|
169 |
- } |
|
170 |
- .equation { |
|
171 |
- vertical-align: middle; |
|
172 |
- } |
|
173 |
- .equation-label { |
|
174 |
- display: table-cell; |
|
175 |
- text-align: right; |
|
176 |
- vertical-align: middle; |
|
177 |
- } |
|
178 |
- .inlinetask { |
|
179 |
- padding: 10px; |
|
180 |
- border: 2px solid gray; |
|
181 |
- margin: 10px; |
|
182 |
- background: #ffffcc; |
|
183 |
- } |
|
184 |
- #org-div-home-and-up |
|
185 |
- { text-align: right; font-size: 70%; white-space: nowrap; } |
|
186 |
- textarea { overflow-x: auto; } |
|
187 |
- .linenr { font-size: smaller } |
|
188 |
- .code-highlighted { background-color: #ffff00; } |
|
189 |
- .org-info-js_info-navigation { border-style: none; } |
|
190 |
- #org-info-js_console-label |
|
191 |
- { font-size: 10px; font-weight: bold; white-space: nowrap; } |
|
192 |
- .org-info-js_search-highlight |
|
193 |
- { background-color: #ffff00; color: #000000; font-weight: bold; } |
|
194 |
- .org-svg { width: 90%; } |
|
195 |
-</style> |
|
196 |
-<link rel="stylesheet" href="./colors.css"></link> |
|
197 |
-</head> |
|
198 |
-<body> |
|
199 |
-<div id="content" class="content"> |
|
200 |
-<h1 class="title">README for js-generic-functions</h1> |
|
201 |
-<div id="table-of-contents" role="doc-toc"> |
|
202 |
-<h2>Table of Contents</h2> |
|
203 |
-<div id="text-table-of-contents" role="doc-toc"> |
|
204 |
-<ul> |
|
205 |
-<li><a href="#orgfafc37c">1. What is this?</a></li> |
|
206 |
-<li><a href="#org9f23f39">2. Docs</a> |
|
207 |
-<ul> |
|
208 |
-<li><a href="#orgd157493">2.1. Basic Usage</a></li> |
|
209 |
-<li><a href="#orgfff236b">2.2. Other sorts of specializers</a></li> |
|
210 |
-</ul> |
|
211 |
-</li> |
|
212 |
-</ul> |
|
213 |
-</div> |
|
214 |
-</div> |
|
360 |
+ table { |
|
361 |
+ border-collapse: collapse; |
|
362 |
+ } |
|
363 |
+ caption.t-above { |
|
364 |
+ caption-side: top; |
|
365 |
+ } |
|
366 |
+ caption.t-bottom { |
|
367 |
+ caption-side: bottom; |
|
368 |
+ } |
|
369 |
+ td, |
|
370 |
+ th { |
|
371 |
+ vertical-align: top; |
|
372 |
+ } |
|
373 |
+ th.org-right { |
|
374 |
+ text-align: center; |
|
375 |
+ } |
|
376 |
+ th.org-left { |
|
377 |
+ text-align: center; |
|
378 |
+ } |
|
379 |
+ th.org-center { |
|
380 |
+ text-align: center; |
|
381 |
+ } |
|
382 |
+ td.org-right { |
|
383 |
+ text-align: right; |
|
384 |
+ } |
|
385 |
+ td.org-left { |
|
386 |
+ text-align: left; |
|
387 |
+ } |
|
388 |
+ td.org-center { |
|
389 |
+ text-align: center; |
|
390 |
+ } |
|
391 |
+ dt { |
|
392 |
+ font-weight: bold; |
|
393 |
+ } |
|
394 |
+ .footpara { |
|
395 |
+ display: inline; |
|
396 |
+ } |
|
397 |
+ .footdef { |
|
398 |
+ margin-bottom: 1em; |
|
399 |
+ } |
|
400 |
+ .figure { |
|
401 |
+ padding: 1em; |
|
402 |
+ } |
|
403 |
+ .figure p { |
|
404 |
+ text-align: center; |
|
405 |
+ } |
|
406 |
+ .equation-container { |
|
407 |
+ display: table; |
|
408 |
+ text-align: center; |
|
409 |
+ width: 100%; |
|
410 |
+ } |
|
411 |
+ .equation { |
|
412 |
+ vertical-align: middle; |
|
413 |
+ } |
|
414 |
+ .equation-label { |
|
415 |
+ display: table-cell; |
|
416 |
+ text-align: right; |
|
417 |
+ vertical-align: middle; |
|
418 |
+ } |
|
419 |
+ .inlinetask { |
|
420 |
+ padding: 10px; |
|
421 |
+ border: 2px solid gray; |
|
422 |
+ margin: 10px; |
|
423 |
+ background: #ffffcc; |
|
424 |
+ } |
|
425 |
+ #org-div-home-and-up { |
|
426 |
+ text-align: right; |
|
427 |
+ font-size: 70%; |
|
428 |
+ white-space: nowrap; |
|
429 |
+ } |
|
430 |
+ textarea { |
|
431 |
+ overflow-x: auto; |
|
432 |
+ } |
|
433 |
+ .linenr { |
|
434 |
+ font-size: smaller; |
|
435 |
+ } |
|
436 |
+ .code-highlighted { |
|
437 |
+ background-color: #ffff00; |
|
438 |
+ } |
|
439 |
+ .org-info-js_info-navigation { |
|
440 |
+ border-style: none; |
|
441 |
+ } |
|
442 |
+ #org-info-js_console-label { |
|
443 |
+ font-size: 10px; |
|
444 |
+ font-weight: bold; |
|
445 |
+ white-space: nowrap; |
|
446 |
+ } |
|
447 |
+ .org-info-js_search-highlight { |
|
448 |
+ background-color: #ffff00; |
|
449 |
+ color: #000000; |
|
450 |
+ font-weight: bold; |
|
451 |
+ } |
|
452 |
+ .org-svg { |
|
453 |
+ width: 90%; |
|
454 |
+ } |
|
455 |
+ </style> |
|
456 |
+ <link rel="stylesheet" href="./colors.css" /> |
|
457 |
+ </head> |
|
458 |
+ <body> |
|
459 |
+ <div id="content" class="content"> |
|
460 |
+ <h1 class="title">README for js-generic-functions</h1> |
|
461 |
+ <div id="table-of-contents" role="doc-toc"> |
|
462 |
+ <h2>Table of Contents</h2> |
|
463 |
+ <div id="text-table-of-contents" role="doc-toc"> |
|
464 |
+ <ul> |
|
465 |
+ <li><a href="#orgfafc37c">1. What is this?</a></li> |
|
466 |
+ <li> |
|
467 |
+ <a href="#org9f23f39">2. Docs</a> |
|
468 |
+ <ul> |
|
469 |
+ <li><a href="#orgd157493">2.1. Basic Usage</a></li> |
|
470 |
+ <li> |
|
471 |
+ <a href="#orgfff236b">2.2. Other sorts of specializers</a> |
|
472 |
+ </li> |
|
473 |
+ </ul> |
|
474 |
+ </li> |
|
475 |
+ </ul> |
|
476 |
+ </div> |
|
477 |
+ </div> |
|
215 | 478 |
|
216 |
-<div id="outline-container-orgfafc37c" class="outline-2"> |
|
217 |
-<h2 id="orgfafc37c"><span class="section-number-2">1.</span> What is this?</h2> |
|
218 |
-<div class="outline-text-2" id="text-1"> |
|
219 |
-<p> |
|
220 |
-An implementation of generic functions based on CLOS and the protocols |
|
221 |
-defined in the Art of the Metaobject protocol, adapted for JS. These |
|
222 |
-adaptations include using the prototype chain instead of classes and |
|
223 |
-additionally providing extensible specializers (as in |
|
224 |
-<a href="https://github.com/sbcl/specializable">https://github.com/sbcl/specializable</a>). For the moment, this is only |
|
225 |
-used to provide a Shape specializer, as the details of the interaction |
|
226 |
-between such specializers and subtyping are an open question. |
|
227 |
-</p> |
|
228 |
-</div> |
|
229 |
-</div> |
|
479 |
+ <div id="outline-container-orgfafc37c" class="outline-2"> |
|
480 |
+ <h2 id="orgfafc37c"> |
|
481 |
+ <span class="section-number-2">1.</span> What is this? |
|
482 |
+ </h2> |
|
483 |
+ <div class="outline-text-2" id="text-1"> |
|
484 |
+ <p> |
|
485 |
+ An implementation of generic functions based on CLOS and the |
|
486 |
+ protocols defined in the Art of the Metaobject protocol, adapted for |
|
487 |
+ JS. These adaptations include using the prototype chain instead of |
|
488 |
+ classes and additionally providing extensible specializers (as in |
|
489 |
+ <a href="https://github.com/sbcl/specializable" |
|
490 |
+ >https://github.com/sbcl/specializable</a |
|
491 |
+ >). For the moment, this is only used to provide a Shape |
|
492 |
+ specializer, as the details of the interaction between such |
|
493 |
+ specializers and subtyping are an open question. |
|
494 |
+ </p> |
|
495 |
+ </div> |
|
496 |
+ </div> |
|
230 | 497 |
|
231 |
-<div id="outline-container-org9f23f39" class="outline-2"> |
|
232 |
-<h2 id="org9f23f39"><span class="section-number-2">2.</span> Docs</h2> |
|
233 |
-<div class="outline-text-2" id="text-2"> |
|
234 |
-</div> |
|
235 |
-<div id="outline-container-orgd157493" class="outline-3"> |
|
236 |
-<h3 id="orgd157493"><span class="section-number-3">2.1.</span> Basic Usage</h3> |
|
237 |
-<div class="outline-text-3" id="text-2-1"> |
|
238 |
-<div class="org-src-container"> |
|
239 |
-<pre class="src src-js" id="org5053093"><span style="color: #F0DFAF;">import</span> { defgeneric } from <span style="color: #D0BF8F;">"./genfuns.js"</span>; |
|
498 |
+ <div id="outline-container-org9f23f39" class="outline-2"> |
|
499 |
+ <h2 id="org9f23f39"><span class="section-number-2">2.</span> Docs</h2> |
|
500 |
+ <div class="outline-text-2" id="text-2"></div> |
|
501 |
+ <div id="outline-container-orgd157493" class="outline-3"> |
|
502 |
+ <h3 id="orgd157493"> |
|
503 |
+ <span class="section-number-3">2.1.</span> Basic Usage |
|
504 |
+ </h3> |
|
505 |
+ <div class="outline-text-3" id="text-2-1"> |
|
506 |
+ <div class="org-src-container"> |
|
507 |
+ <pre |
|
508 |
+ class="src src-js" |
|
509 |
+ id="org5053093" |
|
510 |
+ ><span style="color: #F0DFAF;">import</span> { defgeneric } from <span style="color: #D0BF8F;">"./genfuns.js"</span>; |
|
240 | 511 |
</pre> |
241 |
-</div> |
|
512 |
+ </div> |
|
242 | 513 |
|
243 |
-<p> |
|
244 |
-Defining a function works by calling with some |
|
245 |
-information about the function name and arguments. Methods are then |
|
246 |
-added by calling the appropriate methods with a pair of arguments: a |
|
247 |
-list of specializers (prototypes in the simple case, although there |
|
248 |
-are other options) and a function to run if those specializers match. |
|
249 |
-</p> |
|
514 |
+ <p> |
|
515 |
+ Defining a function works by calling with some information about |
|
516 |
+ the function name and arguments. Methods are then added by calling |
|
517 |
+ the appropriate methods with a pair of arguments: a list of |
|
518 |
+ specializers (prototypes in the simple case, although there are |
|
519 |
+ other options) and a function to run if those specializers match. |
|
520 |
+ </p> |
|
250 | 521 |
|
251 |
-<div class="org-src-container"> |
|
252 |
-<pre class="src src-js" id="orgbfcefb2"><span style="color: #F0DFAF;">const</span> <span style="color: #DC8CC3;">example1generic</span> = defgeneric(<span style="color: #D0BF8F;">"example1"</span>, <span style="color: #D0BF8F;">"a"</span>, <span style="color: #D0BF8F;">"b"</span>) |
|
522 |
+ <div class="org-src-container"> |
|
523 |
+ <pre |
|
524 |
+ class="src src-js" |
|
525 |
+ id="orgbfcefb2" |
|
526 |
+ ><span style="color: #F0DFAF;">const</span> <span style="color: #DC8CC3;">example1generic</span> = defgeneric(<span style="color: #D0BF8F;">"example1"</span>, <span style="color: #D0BF8F;">"a"</span>, <span style="color: #D0BF8F;">"b"</span>) |
|
253 | 527 |
.primary([Number, Object], (n, __) => [1, n]) |
254 | 528 |
.primary([Object, Number], (_, n) => [2, n]) |
255 | 529 |
.primary([Object, Object], (_, __) => [5, <span style="font-weight: bold;">null</span>]); |
256 | 530 |
</pre> |
257 |
-</div> |
|
531 |
+ </div> |
|
258 | 532 |
|
259 |
-<p> |
|
260 |
-After a generic function has been defined, you can get the function to |
|
261 |
-call it by accessing its attribute. |
|
262 |
-</p> |
|
533 |
+ <p> |
|
534 |
+ After a generic function has been defined, you can get the |
|
535 |
+ function to call it by accessing its attribute. |
|
536 |
+ </p> |
|
263 | 537 |
|
264 |
-<div class="org-src-container"> |
|
265 |
-<pre class="src src-js" id="orgcb5dfea"><span style="color: #F0DFAF;">const</span> <span style="color: #DC8CC3;">example1</span> = example1generic.fn; |
|
538 |
+ <div class="org-src-container"> |
|
539 |
+ <pre |
|
540 |
+ class="src src-js" |
|
541 |
+ id="orgcb5dfea" |
|
542 |
+ ><span style="color: #F0DFAF;">const</span> <span style="color: #DC8CC3;">example1</span> = example1generic.fn; |
|
266 | 543 |
|
267 | 544 |
expect(example1(5, {})).toEqual([1, 5]); |
268 | 545 |
expect(example1({}, 6)).toEqual([2, 6]); |
... | ... |
@@ -270,37 +547,44 @@ expect(example1(<span style="color: #D0BF8F;">"hello"</span>, {})).toEqual([5, < |
270 | 547 |
expect(example1({}, <span style="color: #D0BF8F;">"world"</span>)).toEqual([5, <span style="font-weight: bold;">null</span>]); |
271 | 548 |
expect(example1({}, {})).toEqual([5, <span style="font-weight: bold;">null</span>]); |
272 | 549 |
</pre> |
273 |
-</div> |
|
550 |
+ </div> |
|
274 | 551 |
|
275 |
-<p> |
|
276 |
-If a separate reference to the generic function object is maintained, |
|
277 |
-you can add methods like so: |
|
278 |
-</p> |
|
552 |
+ <p> |
|
553 |
+ If a separate reference to the generic function object is |
|
554 |
+ maintained, you can add methods like so: |
|
555 |
+ </p> |
|
279 | 556 |
|
280 |
-<div class="org-src-container"> |
|
281 |
-<pre class="src src-js" id="orgda77441">example1generic |
|
557 |
+ <div class="org-src-container"> |
|
558 |
+ <pre class="src src-js" id="orgda77441">example1generic |
|
282 | 559 |
.primary([String, Object], (s, __) => [3, s]) |
283 | 560 |
.primary([Object, String], (_, s) => [4, s]); |
284 | 561 |
|
285 | 562 |
expect(example1(<span style="color: #D0BF8F;">"hello"</span>, {})).toEqual([3, <span style="color: #D0BF8F;">"hello"</span>]); |
286 | 563 |
expect(example1({}, <span style="color: #D0BF8F;">"world"</span>)).toEqual([4, <span style="color: #D0BF8F;">"world"</span>]); |
287 | 564 |
</pre> |
288 |
-</div> |
|
289 |
-</div> |
|
290 |
-</div> |
|
565 |
+ </div> |
|
566 |
+ </div> |
|
567 |
+ </div> |
|
291 | 568 |
|
292 |
-<div id="outline-container-orgfff236b" class="outline-3"> |
|
293 |
-<h3 id="orgfff236b"><span class="section-number-3">2.2.</span> Other sorts of specializers</h3> |
|
294 |
-<div class="outline-text-3" id="text-2-2"> |
|
295 |
-<div class="org-src-container"> |
|
296 |
-<pre class="src src-js" id="org0346038"><span style="color: #F0DFAF;">import</span> { Shape, Eql } from <span style="color: #D0BF8F;">"./genfuns.js"</span>; |
|
569 |
+ <div id="outline-container-orgfff236b" class="outline-3"> |
|
570 |
+ <h3 id="orgfff236b"> |
|
571 |
+ <span class="section-number-3">2.2.</span> Other sorts of |
|
572 |
+ specializers |
|
573 |
+ </h3> |
|
574 |
+ <div class="outline-text-3" id="text-2-2"> |
|
575 |
+ <div class="org-src-container"> |
|
576 |
+ <pre |
|
577 |
+ class="src src-js" |
|
578 |
+ id="org0346038" |
|
579 |
+ ><span style="color: #F0DFAF;">import</span> { Shape, Eql } from <span style="color: #D0BF8F;">"./genfuns.js"</span>; |
|
297 | 580 |
</pre> |
298 |
-</div> |
|
581 |
+ </div> |
|
299 | 582 |
|
300 |
- |
|
301 |
- |
|
302 |
-<div class="org-src-container"> |
|
303 |
-<pre class="src src-js" id="org89b4645"><span style="color: #F0DFAF;">const</span> <span style="color: #DC8CC3;">example2</span> = defgeneric(<span style="color: #D0BF8F;">"example2"</span>, <span style="color: #D0BF8F;">"inp"</span>) |
|
583 |
+ <div class="org-src-container"> |
|
584 |
+ <pre |
|
585 |
+ class="src src-js" |
|
586 |
+ id="org89b4645" |
|
587 |
+ ><span style="color: #F0DFAF;">const</span> <span style="color: #DC8CC3;">example2</span> = defgeneric(<span style="color: #D0BF8F;">"example2"</span>, <span style="color: #D0BF8F;">"inp"</span>) |
|
304 | 588 |
.primary([Shape(<span style="color: #D0BF8F;">"a"</span>, <span style="color: #D0BF8F;">"b"</span>)], inp => <span style="color: #D0BF8F;">`a: ${inp.a} b: ${inp.b}`</span>) |
305 | 589 |
.primary([Shape(<span style="color: #D0BF8F;">"a"</span>)], inp => <span style="color: #D0BF8F;">`a: ${inp.a} b: <missing>`</span>) |
306 | 590 |
.primary([Shape([<span style="color: #D0BF8F;">"c"</span>, 1])], inp => <span style="color: #D0BF8F;">`c: one`</span>) |
... | ... |
@@ -313,15 +597,17 @@ expect(example2({ c: 1, q: <span style="color: #D0BF8F;">"whatever"</span> })).t |
313 | 597 |
expect(example2({ c: 2, q: <span style="color: #D0BF8F;">"whatever"</span> })).toEqual(<span style="color: #D0BF8F;">"c: two"</span>); |
314 | 598 |
expect(example2(1)).toEqual(<span style="color: #D0BF8F;">"one"</span>); |
315 | 599 |
</pre> |
316 |
-</div> |
|
317 |
-</div> |
|
318 |
-</div> |
|
319 |
-</div> |
|
320 |
-</div> |
|
321 |
-<div id="postamble" class="status"> |
|
322 |
-<p class="author">Author: Ed L</p> |
|
323 |
-<p class="date">Created: 2022-03-16 Wed 01:22</p> |
|
324 |
-<p class="validation"><a href="https://validator.w3.org/check?uri=referer">Validate</a></p> |
|
325 |
-</div> |
|
326 |
-</body> |
|
600 |
+ </div> |
|
601 |
+ </div> |
|
602 |
+ </div> |
|
603 |
+ </div> |
|
604 |
+ </div> |
|
605 |
+ <div id="postamble" class="status"> |
|
606 |
+ <p class="author">Author: Ed L</p> |
|
607 |
+ <p class="date">Created: 2022-03-16 Wed 01:22</p> |
|
608 |
+ <p class="validation"> |
|
609 |
+ <a href="https://validator.w3.org/check?uri=referer">Validate</a> |
|
610 |
+ </p> |
|
611 |
+ </div> |
|
612 |
+ </body> |
|
327 | 613 |
</html> |