6b8450ec29
FossilOrigin-Name: 268cb3dd195fb8e732bf3d0e3012e8dfc2aa63903d77e5ccb1277ea5f8c70170
88 lines
2.3 KiB
Text
Executable file
88 lines
2.3 KiB
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
|
|
~~~
|
|
|
|
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.
|
|
|
|
~~~
|
|
{ 'Overview
|
|
'Obtaining-Retro
|
|
'Building-Unix
|
|
'Building-Windows
|
|
'Starting
|
|
'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
|
|
'The-Stacks
|
|
'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
|
|
'Checking-The-Version
|
|
'Lexical-Scope
|
|
'Internals
|
|
'Internals-Nga
|
|
'Internals-Interface-Layers
|
|
'Internals-Retro-Image
|
|
'Additional-Tools
|
|
'Advanced-Builds
|
|
'Retro-Compiler
|
|
'Errors
|
|
'Security
|
|
'Tech-Notes
|
|
'Historical-Papers
|
|
} 'TOC const
|
|
~~~
|
|
|
|
|
|
~~~
|
|
'Out var
|
|
|
|
:import here swap BOOK-BASE s:prepend file:slurp ;
|
|
:+nl ASCII:LF @Out file:write ;
|
|
:add-to-book here [ @Out file:write ] s:for-each +nl ;
|
|
:process-files [ import add-to-book $. 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 ;
|
|
~~~
|
|
|
|
|
|
~~~
|
|
:open 'gophermap file:open<for-writing> !Out ;
|
|
:close @Out file:close ;
|
|
:ENTRY '0%s\t/book/%s\tforth.works\t70\n ;
|
|
:process-files [ dup ENTRY s:format [ @Out file:write ] s:for-each ] a:for-each ;
|
|
:gophermap open process-files close ;
|
|
~~~
|
|
|
|
|
|
~~~
|
|
:process (dup assemble (gophermap ;
|
|
|
|
TOC process
|
|
~~~
|