2019-03-15 19:35:34 +01:00
|
|
|
#!/usr/bin/env retro
|
|
|
|
|
2019-03-22 12:20:08 +01:00
|
|
|
This is used to assemble the Markdown copy of the RETRO Handbook.
|
2019-03-15 19:35:34 +01:00
|
|
|
|
2019-03-22 12:20:08 +01:00
|
|
|
The individual chapters are in the `book/` directory. This is set
|
|
|
|
using the `BOOK-BASE` constant.
|
2019-03-20 21:33:26 +01:00
|
|
|
|
2019-03-22 12:20:08 +01:00
|
|
|
~~~
|
2019-03-29 21:00:20 +01:00
|
|
|
'doc/book/ 'BOOK-BASE s:const
|
2019-03-22 12:20:08 +01:00
|
|
|
~~~
|
2019-03-20 21:33:26 +01:00
|
|
|
|
2019-03-22 12:20:08 +01:00
|
|
|
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.
|
2019-03-15 19:35:34 +01:00
|
|
|
|
2019-03-22 12:20:08 +01:00
|
|
|
~~~
|
2020-09-24 20:43:59 +02:00
|
|
|
'tools/book-chapters.retro include
|
2019-03-22 12:20:08 +01:00
|
|
|
~~~
|
|
|
|
|
2019-03-22 14:40:39 +01:00
|
|
|
|
2019-03-22 12:20:08 +01:00
|
|
|
~~~
|
|
|
|
'Out var
|
|
|
|
|
|
|
|
:import here swap BOOK-BASE s:prepend file:slurp ;
|
2020-01-10 21:13:04 +01:00
|
|
|
:/n ASCII:LF @Out file:write ;
|
|
|
|
:add-to-book here [ @Out file:write ] s:for-each /n ;
|
2019-04-24 20:35:09 +02:00
|
|
|
:process-files [ import add-to-book $. c:put ] a:for-each nl ;
|
2019-11-22 19:45:37 +01:00
|
|
|
:open 'doc/RETRO-Book.md file:open<for-writing> !Out ;
|
2019-03-22 12:20:08 +01:00
|
|
|
:close @Out file:close ;
|
|
|
|
:assemble open process-files close ;
|
2019-03-22 14:40:39 +01:00
|
|
|
~~~
|
2019-03-22 12:20:08 +01:00
|
|
|
|
2019-03-22 14:40:39 +01:00
|
|
|
~~~
|
2020-01-10 21:13:04 +01:00
|
|
|
TOC assemble
|
2019-03-15 19:35:34 +01:00
|
|
|
~~~
|