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
|
|
|
~~~
|
2019-11-13 22:24:11 +01:00
|
|
|
{ 'Overview
|
2019-03-21 12:23:15 +01:00
|
|
|
'Obtaining-Retro
|
2019-05-09 13:33:58 +02:00
|
|
|
'Building-Unix
|
2019-03-21 12:23:15 +01:00
|
|
|
'Building-Windows
|
2019-03-21 21:51:52 +01:00
|
|
|
'Starting
|
2019-03-21 12:23:15 +01:00
|
|
|
'Basic-Interactions
|
|
|
|
'Syntax
|
|
|
|
'Quick-Tutorial
|
|
|
|
'Using-the-Glossary
|
|
|
|
'Programming-Techniques
|
|
|
|
'Programming-Techniques-Unu
|
|
|
|
'Programming-Techniques-Naming-Conventions
|
|
|
|
'Programming-Techniques-Stack-Diagrams
|
|
|
|
'Programming-Techniques-Word-Classes
|
|
|
|
'Programming-Techniques-Using-Combinators
|
|
|
|
'Programming-Techniques-Working-With
|
2019-03-21 21:04:51 +01:00
|
|
|
'The-Stacks
|
2019-03-21 12:23:15 +01:00
|
|
|
'Programming-Techniques-Working-With-Arrays
|
|
|
|
'Programming-Techniques-Working-With-Buffer
|
|
|
|
'Programming-Techniques-Working-With-Characters
|
|
|
|
'Programming-Techniques-Working-With-Dictionary
|
|
|
|
'Programming-Techniques-Working-With-Floating-Point
|
|
|
|
'Programming-Techniques-Working-With-Numbers
|
|
|
|
'Programming-Techniques-Working-With-Pointers
|
|
|
|
'Programming-Techniques-Working-With-Strings
|
|
|
|
'Programming-Techniques-Writing-Combinators
|
|
|
|
'Programming-Techniques-Working-With-Assembly
|
2019-05-13 22:09:58 +02:00
|
|
|
'Checking-The-Version
|
2019-04-02 14:20:11 +02:00
|
|
|
'Lexical-Scope
|
2019-03-21 12:23:15 +01:00
|
|
|
'Internals
|
|
|
|
'Internals-Nga
|
|
|
|
'Internals-Interface-Layers
|
|
|
|
'Internals-Retro-Image
|
|
|
|
'Additional-Tools
|
|
|
|
'Advanced-Builds
|
|
|
|
'Retro-Compiler
|
|
|
|
'Errors
|
2019-03-22 14:40:39 +01:00
|
|
|
'Security
|
2019-03-21 13:51:36 +01:00
|
|
|
'Tech-Notes
|
|
|
|
'Historical-Papers
|
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 ;
|
|
|
|
:\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-03-22 12:20:08 +01:00
|
|
|
:open 'RETRO-Book.md file:open<for-writing> !Out ;
|
|
|
|
: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
|
|
|
|
|
|
|
~~~
|
2019-03-22 12:20:08 +01:00
|
|
|
:open 'gophermap file:open<for-writing> !Out ;
|
|
|
|
:close @Out file:close ;
|
|
|
|
:ENTRY '0%s\t/book/%s\tforth.works\t70\n ;
|
2019-04-24 16:02:15 +02:00
|
|
|
:process-files [ dup ENTRY s:format [ @Out file:write ] s:for-each ] a:for-each ;
|
2019-03-22 12:20:08 +01:00
|
|
|
:gophermap 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
|
|
|
~~~
|
2019-03-22 12:20:08 +01:00
|
|
|
:process dup assemble gophermap ;
|
|
|
|
|
|
|
|
TOC process
|
2019-03-15 19:35:34 +01:00
|
|
|
~~~
|