From 4b8c651bf243d011bf6065b802b5930b40b0690e Mon Sep 17 00:00:00 2001 From: crc Date: Wed, 30 Sep 2020 19:59:50 +0000 Subject: [PATCH] epub: chapter titles now work, chapters now start with 1 instead of 0 FossilOrigin-Name: 478d5f52924ab3ad4f5929c7f006e431eb848b3c860f670590bef498b907633b --- generate-epub.retro | 8 +++++--- tools/book-chapters.retro | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/generate-epub.retro b/generate-epub.retro index 1a61a86..16682fc 100755 --- a/generate-epub.retro +++ b/generate-epub.retro @@ -89,7 +89,9 @@ Then create `META-INF/container.xml`. ' } [ file:s:put file:nl ] a:for-each -#0 TOC [ #1 a:fetch over dup dup '____Chapter_%n s:format file:s:put file:nl n:inc ] a:for-each drop +:a:unpack [ ] a:for-each ; + +#1 TOC [ a:unpack 'abc 'acbaaa reorder '____Chapter_%n:_%s s:format file:s:put file:nl n:inc ] a:for-each drop { ' ' @@ -125,12 +127,12 @@ that are used in the book. '__ file:s:put file:nl '____ file:s:put file:nl -#0 TOC [ #1 a:fetch over swap '____ s:format file:s:put file:nl n:inc ] a:for-each +#1 TOC [ #1 a:fetch over swap '____ s:format file:s:put file:nl n:inc ] a:for-each drop '__ file:s:put file:nl '__ file:s:put file:nl -#0 TOC [ drop dup '____ s:format file:s:put file:nl n:inc ] a:for-each drop +#1 TOC [ drop dup '____ s:format file:s:put file:nl n:inc ] a:for-each drop '__ file:s:put file:nl ~~~ diff --git a/tools/book-chapters.retro b/tools/book-chapters.retro index d09373d..73daf64 100755 --- a/tools/book-chapters.retro +++ b/tools/book-chapters.retro @@ -47,7 +47,7 @@ This contains the list of files for the chapters in the book. { 'Errors 'techniques/errors } { 'Lexical_Scope 'techniques/lexical-scope } { 'The_Stacks 'techniques/the-stacks } - { 'Naa 'internals/nga } + { 'The_Nga_Virtual_Machine 'internals/nga } { 'Interface_Layers 'internals/interface-layers } { 'I/O 'internals/io } { 'Image 'internals/image }