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-01-10 21:13:04 +01:00
|
|
|
{
|
|
|
|
'general/introduction
|
|
|
|
'general/copyrights
|
|
|
|
'building/obtaining
|
|
|
|
'building/unix
|
|
|
|
'building/windows
|
|
|
|
'building/alternatives
|
|
|
|
'building/advanced
|
|
|
|
'general/starting
|
|
|
|
'general/basic-interactions
|
|
|
|
'general/retro-unu
|
|
|
|
'general/quick-tutorial
|
|
|
|
'general/syntax
|
|
|
|
'toolchain/info/additional-tools
|
|
|
|
'toolchain/info/retro-compiler
|
|
|
|
'toolchain/man/retro
|
|
|
|
'toolchain/man/retro-describe
|
|
|
|
'toolchain/man/retro-document
|
|
|
|
'toolchain/man/retro-embedimage
|
|
|
|
'toolchain/man/retro-extend
|
|
|
|
'toolchain/man/retro-locate
|
|
|
|
'toolchain/man/retro-muri
|
|
|
|
'toolchain/man/retro-tags
|
|
|
|
'techniques/naming-conventions
|
|
|
|
'techniques/return-stack
|
|
|
|
'techniques/stack-diagrams
|
|
|
|
'techniques/arrays
|
|
|
|
'techniques/assembly
|
|
|
|
'techniques/buffer
|
|
|
|
'techniques/characters
|
2020-04-20 17:08:45 +02:00
|
|
|
'techniques/definitions
|
2020-01-10 21:13:04 +01:00
|
|
|
'techniques/dictionary
|
|
|
|
'techniques/floating-point
|
|
|
|
'techniques/files
|
2020-01-14 16:55:45 +01:00
|
|
|
'techniques/loops
|
2020-01-10 21:13:04 +01:00
|
|
|
'techniques/numbers
|
|
|
|
'techniques/pointers
|
2020-04-20 17:08:45 +02:00
|
|
|
'techniques/quotes
|
2020-01-10 21:13:04 +01:00
|
|
|
'techniques/sockets
|
2020-01-14 20:09:54 +01:00
|
|
|
'techniques/scripting
|
2020-01-10 21:13:04 +01:00
|
|
|
'techniques/strings
|
|
|
|
'techniques/using-combinators
|
|
|
|
'techniques/word-classes
|
|
|
|
'techniques/checking-the-version
|
|
|
|
'techniques/errors
|
|
|
|
'techniques/lexical-scope
|
|
|
|
'techniques/the-stacks
|
|
|
|
'internals/nga
|
|
|
|
'internals/interface-layers
|
|
|
|
'internals/io
|
|
|
|
'internals/image
|
|
|
|
'glossary/using
|
|
|
|
'tech-notes/historical-papers
|
|
|
|
'tech-notes/metacompilation
|
|
|
|
'tech-notes/self-hosting
|
|
|
|
'tech-notes/prefixes
|
|
|
|
'tech-notes/kernel-words
|
|
|
|
'tech-notes/ngaro-to-nga
|
|
|
|
'tech-notes/retro11-retrospective
|
|
|
|
'tech-notes/security
|
2020-02-12 13:58:06 +01:00
|
|
|
'tech-notes/underscores-in-names
|
2020-01-10 21:13:04 +01:00
|
|
|
'tech-notes/code-it-yourself
|
2020-01-22 16:20:57 +01:00
|
|
|
'general/deprecation
|
2019-03-22 12:20:08 +01:00
|
|
|
} 'TOC const
|
|
|
|
~~~
|
|
|
|
|
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
|
|
|
~~~
|