epub: chapter titles now work, chapters now start with 1 instead of 0

FossilOrigin-Name: 478d5f52924ab3ad4f5929c7f006e431eb848b3c860f670590bef498b907633b
This commit is contained in:
crc 2020-09-30 19:59:50 +00:00
parent 6f52af0631
commit 4b8c651bf2
2 changed files with 6 additions and 4 deletions

View file

@ -89,7 +89,9 @@ Then create `META-INF/container.xml`.
'<navMap> '<navMap>
} [ file:s:put file:nl ] a:for-each } [ file:s:put file:nl ] a:for-each
#0 TOC [ #1 a:fetch over dup dup '____<navPoint_id="CHAP%n"_playOrder="%n"><navLabel><text>Chapter_%n</text></navLabel><content_src="chapters/%s.html"/></navPoint> 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 '____<navPoint_id="CHAP%n"_playOrder="%n"><navLabel><text>Chapter_%n:_%s</text></navLabel><content_src="chapters/%s.html"/></navPoint> s:format file:s:put file:nl n:inc ] a:for-each drop
{ '</navMap> { '</navMap>
'</ncx> '</ncx>
@ -125,12 +127,12 @@ that are used in the book.
'__<manifest> file:s:put file:nl '__<manifest> file:s:put file:nl
'____<item_id="ncx"_href="TOC.ncx"_media-type="application/x-dtbncx+xml"/> file:s:put file:nl '____<item_id="ncx"_href="TOC.ncx"_media-type="application/x-dtbncx+xml"/> file:s:put file:nl
#0 TOC [ #1 a:fetch over swap '____<item_href="chapters/%s.html"_id="CHAP%n"_media-type="application/xhtml+xml"/> s:format file:s:put file:nl n:inc ] a:for-each #1 TOC [ #1 a:fetch over swap '____<item_href="chapters/%s.html"_id="CHAP%n"_media-type="application/xhtml+xml"/> s:format file:s:put file:nl n:inc ] a:for-each
drop drop
'__</manifest> file:s:put file:nl '__</manifest> file:s:put file:nl
'__<spine_toc="ncx"> file:s:put file:nl '__<spine_toc="ncx"> file:s:put file:nl
#0 TOC [ drop dup '____<itemref_idref="CHAP%n"_linear="yes"/> s:format file:s:put file:nl n:inc ] a:for-each drop #1 TOC [ drop dup '____<itemref_idref="CHAP%n"_linear="yes"/> s:format file:s:put file:nl n:inc ] a:for-each drop
'__</spine> file:s:put file:nl '__</spine> file:s:put file:nl
~~~ ~~~

View file

@ -47,7 +47,7 @@ This contains the list of files for the chapters in the book.
{ 'Errors 'techniques/errors } { 'Errors 'techniques/errors }
{ 'Lexical_Scope 'techniques/lexical-scope } { 'Lexical_Scope 'techniques/lexical-scope }
{ 'The_Stacks 'techniques/the-stacks } { 'The_Stacks 'techniques/the-stacks }
{ 'Naa 'internals/nga } { 'The_Nga_Virtual_Machine 'internals/nga }
{ 'Interface_Layers 'internals/interface-layers } { 'Interface_Layers 'internals/interface-layers }
{ 'I/O 'internals/io } { 'I/O 'internals/io }
{ 'Image 'internals/image } { 'Image 'internals/image }