retroforth/tools/epub/chapters-to-xhtml.retro
crc c3a55274ac epub: minor restructuring of source locations
FossilOrigin-Name: 522f32b3aa14ccc1ca01350073b3251e68bc10a755c83e5b9ee473f4866f5e6e
2020-10-01 16:50:36 +00:00

37 lines
960 B
Text
Executable file

#!/usr/bin/env retro
This is used to assemble the Markdown copy of the RETRO Handbook.
The individual chapters are in the `book/` directory. This is set
using the `BOOK-BASE` constant.
~~~
'doc/book/ 'BOOK-BASE s:const
'chapters/ 'OUT-BASE s:const
~~~
The chapters are specified it the `TOC`, a named array. These are
the file names, they will be included in order. I am structuring
it using separate file to make the actual editing process easier
for me.
~~~
'tools/book-chapters.retro include
~~~
~~~
'Out var
:import BOOK-BASE over OUT-BASE '>%s%s.html_retro_example/markdown-to-xhtml.retro_%s%s s:format unix:system ;
:/n ASCII:LF @Out file:write ;
:add-to-book here [ @Out file:write ] s:for-each ;
:process-files [ #1 a:fetch import $. c:put ] a:for-each nl ;
:open 'doc/RETRO-Book.md file:open-for-writing !Out ;
:close @Out file:close ;
:assemble open process-files close ;
~~~
~~~
TOC assemble
~~~