Skip to content

Commit 06e371f

Browse files
committed
Use symlinks to access shared resources without ../ paths
1 parent 4073df6 commit 06e371f

9 files changed

Lines changed: 22 additions & 18 deletions

File tree

01_values.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ will have over thirty billion bits sitting in its volatile data
3838
storage (as opposed to non-volatile storage—the hard disk or
3939
equivalent—which tends to have yet a few orders of magnitude more).
4040

41-
image::../img/bit-sea.png[alt="The Ocean of Bits"]
41+
image::img/bit-sea.png[alt="The Ocean of Bits"]
4242

4343
In order to work with these without getting lost, we'll have to
4444
structure them somehow. One way to do that is to group them into

02_program_structure.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ a little dialog box with a message. It is used like this:
193193
alert("Good morning!");
194194
-----
195195

196-
image::../img/alert.png[alt="An alert dialog"]
196+
image::img/alert.png[alt="An alert dialog"]
197197

198198
indexsee:[application (of functions),function application]
199199
indexsee:[invoking (of functions),function application]
@@ -248,7 +248,7 @@ if the user clicks OK and `false` if the user clicks Cancel.
248248
confirm("Shall we, then?");
249249
-----
250250

251-
image::../img/confirm.png[alt="An confirm dialog"]
251+
image::img/confirm.png[alt="An confirm dialog"]
252252

253253
(((prompt function)))(((text input)))`prompt` can be used to ask an
254254
“open” question. The first argument is the question; the second one is
@@ -260,7 +260,7 @@ the dialog window, and the function will return this as a string.
260260
prompt("Tell me everything you know.", "...");
261261
-----
262262

263-
image::../img/prompt.png[alt="An prompt dialog"]
263+
image::img/prompt.png[alt="An prompt dialog"]
264264

265265
These two functions aren't used much in serious web programming,
266266
mostly because you have no control over the way the resulting windows
@@ -324,7 +324,7 @@ string value, and we want a number. There are similar functions called
324324
Here is a rather boring schematic representation of straight control
325325
flow:
326326

327-
image::../img/controlflow-straight.svg[alt="Trivial control flow"]
327+
image::img/controlflow-straight.svg[alt="Trivial control flow"]
328328

329329
== Conditional execution ==
330330

@@ -333,7 +333,7 @@ straight-line order isn't the only option we have. A common
333333
requirement is conditional execution, where we choose between two
334334
different routes based on a boolean value.
335335

336-
image::../img/controlflow-if.svg[alt="Conditional control flow"]
336+
image::img/controlflow-if.svg[alt="Conditional control flow"]
337337

338338
Conditional execution is written with the `if` keyword in JavaScript.
339339
In the simple case, we just want some code to be executed if, and only
@@ -400,7 +400,7 @@ and 100, and `"Medium"` is shown. If it doesn't, the second and last
400400

401401
The arrow schema for this program looks something like this:
402402

403-
image::../img/controlflow-nested-if.svg[alt="Nested if control flow"]
403+
image::img/controlflow-nested-if.svg[alt="Nested if control flow"]
404404

405405
== while and do loops ==
406406

@@ -423,7 +423,7 @@ make something _less_ work, not more. If we needed all even numbers
423423
less than 1,000, the previous would be unworkable. What we need is a
424424
way to repeat some code—a _loop_.
425425

426-
image::../img/controlflow-loop.svg[alt="Loop control flow"]
426+
image::img/controlflow-loop.svg[alt="Loop control flow"]
427427

428428
Looping control flow allows us to go back to some point in the program
429429
where we were before, and repeat it, in the context of our current

04_data.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ variables and properties might be holding on to the same values. So
250250
now you may start thinking of objects as octopuses with any number of
251251
tentacles, each of which has a name inscribed on it.
252252

253-
image::../img/object-octopus.svg[alt="Artist's representation of an object"]
253+
image::img/object-octopus.svg[alt="Artist's representation of an object"]
254254

255255
(((delete operator)))(((property,deletion)))To cut off such a
256256
leg—remove a property from an object—the `delete` operator can be
@@ -286,7 +286,7 @@ storing sequences of things. If you evaluate `typeof [1, 2]`, this
286286
produces `"object"`. I guess you can see them as long, flat octopuses
287287
with all their arms in a neat row, labeled with numbers.
288288

289-
image::../img/array-octopus.svg[alt="Artist's representation of an array"]
289+
image::img/array-octopus.svg[alt="Artist's representation of an array"]
290290

291291
The desired representation of Jaques' journal is thus an array of
292292
objects.
@@ -409,7 +409,7 @@ of times the various combinations of the two variables were observed.
409409
For example, we could take the event of eating pizza, and put that in
410410
a table like this:
411411

412-
image::../img/pizza-squirrel.svg[alt="Eating pizza versus turning into a squirrel"]
412+
image::img/pizza-squirrel.svg[alt="Eating pizza versus turning into a squirrel"]
413413

414414
From such a table (n), the phi coefficient (ϕ) can be computed by the
415415
following formula.

asciidoc_html.conf

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ html_target=True
2828
<head>
2929
<meta charset="utf-8">
3030
<title>{doctitle}</title>
31-
<link rel=stylesheet href="../node_modules/codemirror/lib/codemirror.css">
32-
<script src="../node_modules/codemirror/lib/codemirror.js"></script>
33-
<script src="../node_modules/codemirror/mode/javascript/javascript.js"></script>
34-
<script src="../node_modules/acorn/acorn.js"></script>
35-
<script src="../node_modules/acorn/util/walk.js"></script>
31+
<link rel=stylesheet href="js/node_modules/codemirror/lib/codemirror.css">
32+
<script src="js/node_modules/codemirror/lib/codemirror.js"></script>
33+
<script src="js/node_modules/codemirror/mode/javascript/javascript.js"></script>
34+
<script src="js/node_modules/acorn/acorn.js"></script>
35+
<script src="js/node_modules/acorn/util/walk.js"></script>
3636
<link rel=stylesheet href="ejs.css">
3737
<script src="js/sandbox.js"></script>
3838
<script src="js/ejs.js"></script>
39-
<script>{chap_num?var chapNum = {chap_num};{load_file?var sandboxLoadFile = "../code/{load_file}.js";}</script>
39+
<script>{chap_num?var chapNum = {chap_num};{load_file?var sandboxLoadFile = "js/code/{load_file}.js";}</script>
4040
</head>
4141

4242
<article>

html/img

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../img/

html/js/code

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../code/

html/js/ejs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ window.addEventListener("load", function() {
44

55
var sandbox;
66
function resetSandbox() {
7-
sandbox = new SandBox({loadFiles: [window.sandboxLoadFile]});
7+
sandbox = new SandBox({loadFiles: window.sandboxLoadFile && [window.sandboxLoadFile]});
88
window.sandbox = sandbox;
99
}
1010
resetSandbox();

html/js/node_modules

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../node_modules/

tex/img

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../img

0 commit comments

Comments
 (0)