diff --git a/src/book.css b/src/book.css index 0a1223d..497ef8b 100644 --- a/src/book.css +++ b/src/book.css @@ -31,8 +31,19 @@ hr { height: 1px; margin: 16px 0; } -table { +div.chapter { page-break-inside: avoid; +} +div#title { + page-break-after: always; +} +div#contents { + page-break-after: always; +} +div#introduction { + page-break-after: always; +} +table { width: 690px; min-width: 690px; max-width: 690px; diff --git a/src/index.txt b/src/contents.txt similarity index 96% rename from src/index.txt rename to src/contents.txt index 83b8dc8..88aeb61 100644 --- a/src/index.txt +++ b/src/contents.txt @@ -1,7 +1,4 @@ -title -contents introduction - hello-world values variables @@ -29,7 +26,6 @@ embedding interfaces errors ok-guards - goroutines concurrent-goroutines channels @@ -47,7 +43,6 @@ timers tickers state-goroutine state-mutex - sorting sorting-by-functions collection-functions @@ -64,7 +59,6 @@ number-parsing urls sha1-hashes base64-encoding - reading-files writing-files line-filters @@ -75,12 +69,10 @@ spawning-processes execing-processes signals exit - http-client https-client redis postgres - hello-web responses request-routing @@ -90,4 +82,4 @@ basic-authentication canonical-hosts middleware graceful-shutdown -https-servers +https-servers \ No newline at end of file diff --git a/src/contents/contents.html b/src/contents/contents.html deleted file mode 100644 index 6a46643..0000000 --- a/src/contents/contents.html +++ /dev/null @@ -1,7 +0,0 @@ -
Why you should care.
- +This is why.
diff --git a/src/scatter-gather/081-scatter-gather.go b/src/scatter-gather/scatter-gather.go similarity index 100% rename from src/scatter-gather/081-scatter-gather.go rename to src/scatter-gather/scatter-gather.go diff --git a/src/title.html b/src/title.html new file mode 100644 index 0000000..b4d50de --- /dev/null +++ b/src/title.html @@ -0,0 +1,7 @@ +Version eb9cf61d
+Version eb9cf61d
diff --git a/tool/build-html.go b/tool/build-html.go index 4a669db..9331e1c 100644 --- a/tool/build-html.go +++ b/tool/build-html.go @@ -186,6 +186,8 @@ func main() { outF, err := os.Create(os.Args[1]) check(err) ensureCache() + + // Header fmt.Fprint(outF, ` @@ -196,20 +198,31 @@ func main() { `) - indexLines := readLines("src/index.txt") - indexNames := filterStrings(indexLines, func(s string) bool { - return s != "" - }) + // Title page + fmt.Fprint(outF, mustReadFile("src/title.html")) - for _, indexName := range indexNames { - fmt.Fprintf(outF, `