Skip to content

Commit 6872682

Browse files
committed
Add a script to extract the solutions, and put them at the end of the book
Also fix up some problems with hyperrefs Closes marijnh#85
1 parent da6321d commit 6872682

21 files changed

+62
-42
lines changed

01_values.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
:chap_num: 1
22
:prev_link: 00_intro
33
:next_link: 02_program_structure
4+
:docid: values
45

5-
[[values]]
66
= Values, Types, and Operators =
77

88
[quote, Master Yuan-Ma, The Book of Programming]

02_program_structure.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
:prev_link: 01_values
33
:next_link: 03_functions
44

5-
[[program_structure]]
65
= Program Structure =
76

87
[chapterquote="true"]
@@ -864,8 +863,9 @@ end of the introduction.
864863

865864
Each exercise starts with a problem description. Read that and try to
866865
solve the exercise. If you run into problems, consider reading the
867-
hints after the exercise. Full solutions to the exercises are not
868-
included in this book, but you can find them online at
866+
hints (!html after the exercise!)(!tex at the link:solutions[end of the book]!).
867+
Full solutions to the exercises are not included in this
868+
book, but you can find them online at
869869
http://eloquentjavascript.net/exercises.html[_eloquentjavascript.net/exercises.html_].
870870
If you want to learn something from the exercises, I recommend looking
871871
at the solutions only after you've solved the exercise, or at least

03_functions.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
:prev_link: 02_program_structure
33
:next_link: 04_data
44

5-
[[functions]]
65
= Functions =
76

87
[chapterquote="true"]
@@ -415,7 +414,6 @@ one will tell you about it.
415414
indexsee:[optional argument,argument optional]
416415

417416
[[power]]
418-
419417
(((power example)))(((argument,optional)))(((optional arguments)))The
420418
upside is that this behavior can be used to have a function take
421419
“optional” arguments. For example, the following version of `power`

04_data.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
:next_link: 05_higher_order
44
:load_files: ["code/jacques_journal.js", "code/chapter/04_data.js"]
55

6-
[[data]]
76
= Data Structures: Objects and Arrays =
87

98
[chapterquote="true"]
@@ -106,7 +105,6 @@ the element in the left-hand expression that corresponds to the _index_
106105
given by the expression in the brackets.
107106

108107
[[array_indexing]]
109-
110108
The first index of an array is zero, not one. So the first element can be read
111109
with `listOfNumbers[0]`. If you don't have a programming background,
112110
this convention might take some getting used to. But zero-based counting has a long
@@ -190,7 +188,7 @@ is also `toLowerCase`. You can guess what that does.
190188
Interestingly, even though the call to `toUpperCase` does not pass any
191189
arguments, the function somehow has access to the string
192190
`"Doh"`, the value whose property we called. How this works
193-
is described in link:06_object.html#methods[Chapter 6].
191+
is described in link:06_object.html#obj_methods[Chapter 6].
194192

195193
Properties that contain functions are generally called _methods_ of
196194
the value they belong to. As in, “`toUpperCase` is a method of a

05_higher_order.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
:next_link: 06_object
44
:load_files: ["code/ancestry.js", "code/chapter/05_higher_order.js", "js/intro.js"]
55

6-
[[higher_order]]
76
= Higher-Order Functions =
87

98
ifdef::html_target[]

06_object.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ has popularized. These are worth studying.
6565
This chapter describes JavaScript's rather eccentric take on objects,
6666
and the way they relate to some classical object-oriented techniques.
6767

68-
[[methods]]
68+
[[obj_methods]]
6969
== Methods ==
7070

7171
(((rabbit example)))(((method)))(((property)))Methods are simply

07_elife.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
:next_link: 08_error
44
:load_files: ["code/chapter/07_elife.js", "js/animateworld.js"]
55

6-
[[elife]]
76
= Project: Electronic Life =
87

98
[chapterquote="true"]

10_modules.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
:next_link: 11_language
44
:load_files: ["code/chapter/10_modules.js", "js/loadfile.js"]
55

6-
[[modules]]
76
= Modules =
87

98
ifdef::html_target[]

13_dom.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
:next_link: 14_event
44
:load_files: ["code/mountains.js", "code/chapter/13_dom.js"]
55

6-
[[dom]]
76
= The Document Object Model =
87

98
When you open a web page in your browser, it will retrieve the page's

15_game.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
:next_link: 16_canvas
44
:load_files: ["code/chapter/15_game.js", "code/game_levels.js"]
55

6-
[[game]]
76
= Project: A Platform Game =
87

98
My initial fascination with computers, like that of many kids,

0 commit comments

Comments
 (0)