Skip to content

Commit 33fc17b

Browse files
committed
Fix typo
Closes #271
1 parent 7d8079d commit 33fc17b

File tree

6 files changed

+21
-4
lines changed

6 files changed

+21
-4
lines changed

Diff for: 00_intro.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Introduction
44

55
This is a book about instructing ((computer))s. Computers are about as
6-
common a screwdrivers today. But they are quite a bit more complex
6+
common as screwdrivers today. But they are quite a bit more complex
77
than screwdrivers, and making them do the precise thing you want them
88
to do isn't always easy.
99

Diff for: 05_higher_order.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ function textScripts(text) {
739739
}).join(", ");
740740
}
741741
742-
console.log(textScripts('英國狗說“woof”,但俄羅斯狗說“тяв”'));
742+
console.log(textScripts('英国的狗说“woof”, 俄罗斯的狗说“тяв”'));
743743
// → 59% Han, 24% Latin, 18% Cyrillic
744744
```
745745

Diff for: Makefile

+10
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,13 @@ test: html
3434
@for F in $(CHAPTERS); do echo Testing $$F:; node src/run_tests.js $$F.md; done
3535
@node src/check_links.js
3636
@echo Done.
37+
38+
book.pdf: $(foreach CHAP,$(CHAPTERS),pdf/$(CHAP).tex) pdf/book.tex $(patsubst img/%.svg,img/generated/%.pdf,$(SVGS))
39+
#cd pdf && sh build.sh book > /dev/null
40+
mv pdf/book.pdf .
41+
42+
img/generated/%.pdf: img/%.svg
43+
inkscape --export-pdf=$@ $<
44+
45+
pdf/%.tex: %.md
46+
node src/render_latex.js $< > $@

Diff for: README.md

+5
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,8 @@ Feedback welcome, in the form of issues and pull requests.
99

1010
npm install
1111
make html
12+
13+
To build the PDF file:
14+
15+
apt-get install texlive texlive-xetex texlive-fonts-extra
16+
make book.pdf

Diff for: src/render_html.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ let file = process.argv[2]
1111

1212
let {tokens, metadata} = transformTokens(require("./markdown").parse(fs.readFileSync(file, "utf8"), {}), {
1313
defined: ["interactive", "html"],
14-
ids: true,
14+
takeTitle: true,
1515
index: false
1616
})
1717

Diff for: src/transform.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,11 @@ exports.transformTokens = function(tokens, options) {
8787
nextTag(tokens, i).tableData = tok.args[0]
8888
} else if (type == "meta_if_open") {
8989
i = handleIf(tokens, i, options)
90+
} else if (type == "meta_hint_open" && options.strip === "hints") {
91+
do { i++ } while (tokens[i].type != "meta_hint_close")
9092
} else if (type == "meta_if_close" || (options.index === false && (type == "meta_indexsee" || type == "meta_index"))) {
9193
// Drop
92-
} else if (tok.tag == "h1") {
94+
} else if (tok.tag == "h1" && options.takeTitle) {
9395
if (tokens[i + 1].children.length != 1) throw new Error("Complex H1 not supported")
9496
meta.title = tokens[i + 1].children[0].content
9597
i += 2

0 commit comments

Comments
 (0)