diff --git a/Makefile b/Makefile index 3d4864e..5ca3b83 100644 --- a/Makefile +++ b/Makefile @@ -46,10 +46,10 @@ install-strip: build install-data install-docs install-examples install-data: install -m 755 -d -- $(DESTDIR)$(DATADIR) - install -c -m 644 glossary.retro $(DESTDIR)$(DATADIR)/glossary.retro + install -c -m 644 tools/glossary.retro $(DESTDIR)$(DATADIR)/glossary.retro install -c -m 644 ngaImage $(DESTDIR)$(DATADIR)/ngaImage cp -fpR tests $(DESTDIR)$(DATADIR)/ - install -c -m 644 words.tsv $(DESTDIR)$(DATADIR)/words.tsv + install -c -m 644 hoc/words.tsv $(DESTDIR)$(DATADIR)/words.tsv install-docs: install -m 755 -d -- $(DESTDIR)$(DOCSDIR) @@ -77,7 +77,7 @@ test: bin/retro # Targets for development/interactive usage -glossary: doc/Glossary.txt doc/Glossary.html doc/Glossary-Concise.txt doc/Glossary-Names-and-Stack.txt words.tsv +glossary: doc/Glossary.txt doc/Glossary.html doc/Glossary-Concise.txt doc/Glossary-Names-and-Stack.txt doc/words.tsv image: vm/nga-c/image.c @@ -93,8 +93,8 @@ ngaImage: image/rx.muri image/retro.forth bin/retro-muri bin/retro-extend ./bin/retro-muri image/rx.muri ./bin/retro-extend ngaImage image/retro.forth -bin/retro-describe: retro-describe.retro words.tsv - cat tools/retro-describe.retro words.tsv >bin/retro-describe +bin/retro-describe: tools/retro-describe.retro doc/words.tsv + cat tools/retro-describe.retro doc/words.tsv >bin/retro-describe chmod +x bin/retro-describe bin/retro-embedimage: tools/embedimage.c @@ -128,21 +128,21 @@ bin/retro: ngaImage bin/retro-embedimage bin/retro-extend vm/nga-c/retro-image.c bin/retro-unu: tools/unu.c $(CC) $(CFLAGS) $(LDFLAGS) -o bin/retro-unu tools/unu.c -sorted: words.tsv - LC_ALL=C sort -o sorted.tsv words.tsv - mv sorted.tsv words.tsv +sorted: doc/words.tsv + LC_ALL=C sort -o sorted.tsv doc/words.tsv + mv sorted.tsv doc/words.tsv doc/Glossary.txt: bin/retro sorted - ./bin/retro glossary.retro export glossary >doc/Glossary.txt + ./bin/retro tools/glossary.retro export glossary >doc/Glossary.txt doc/Glossary.html: bin/retro sorted - ./bin/retro glossary.retro export html >doc/Glossary.html + ./bin/retro tools/glossary.retro export html >doc/Glossary.html doc/Glossary-Concise.txt: bin/retro sorted - ./bin/retro glossary.retro export concise >doc/Glossary-Concise.txt + ./bin/retro tools/glossary.retro export concise >doc/Glossary-Concise.txt doc/Glossary-Names-and-Stack.txt: bin/retro sorted - ./bin/retro glossary.retro export concise-stack >doc/Glossary-Names-and-Stack.txt + ./bin/retro tools/glossary.retro export concise-stack >doc/Glossary-Names-and-Stack.txt vm/nga-c/image.c: bin/retro-embedimage bin/retro-extend bin/retro-muri image/retro.forth image/rx.muri ./bin/retro-muri image/rx.muri diff --git a/words.tsv b/doc/words.tsv similarity index 100% rename from words.tsv rename to doc/words.tsv diff --git a/retro.blocks.gz b/example/retro.blocks.gz similarity index 100% rename from retro.blocks.gz rename to example/retro.blocks.gz diff --git a/glossary.retro b/tools/glossary.retro similarity index 94% rename from glossary.retro rename to tools/glossary.retro index c5e7231..2ca4c29 100755 --- a/glossary.retro +++ b/tools/glossary.retro @@ -257,7 +257,7 @@ There are five primary roles: :matched? (-f) field:name TARGET s:eq? ; ---reveal--- :find-and-display-entry - 'words.tsv [ s:keep !SourceLine matched? [ display-result ] if ] file:for-each-line ; + 'doc/words.tsv [ s:keep !SourceLine matched? [ display-result ] if ] file:for-each-line ; }} ~~~ @@ -281,7 +281,7 @@ before doing the checks. :restrict-scope 'GLOSSARY-TOOL d:lookup fetch !Dictionary ; :record-name !SourceLine field:name s:keep over &GlossaryNames + store ; - :populate-names #1 'words.tsv [ record-name n:inc ] file:for-each-line + :populate-names #1 'doc/words.tsv [ record-name n:inc ] file:for-each-line n:dec &GlossaryNames store ; :in-set? dup &GlossaryNames a:contains-string? ; ---reveal--- @@ -294,7 +294,7 @@ before doing the checks. ## Add a Word -This just adds a stub to the end of the words.tsv file. You'll +This just adds a stub to the end of the doc/words.tsv file. You'll need to run the edit commands for each field to fully populate it. @@ -302,7 +302,7 @@ it. {{ 'ADD var :template '%s\t-\t-\t-\t{n/a}\t\t\tclass:word\t{n/a}\t{n/a}\t{n/a}\t{n/a}\t{n/a}\n ; - :prepare 'words.tsv file:A file:open !ADD ; + :prepare 'doc/words.tsv file:A file:open !ADD ; :cleanup @ADD file:close ; ---reveal--- :add-word @@ -317,7 +317,7 @@ it. This works by reading each line and writing them to a new file. Entries that match the word to delete are discarded. The new -file then replaces the original `words.tsv`. +file then replaces the original `doc/words.tsv`. ~~~ {{ @@ -329,7 +329,7 @@ file then replaces the original `words.tsv`. ---reveal--- :delete-entry prepare - 'words.tsv [ s:keep !SourceLine matched? [ keep-entry ] -if ] file:for-each-line + 'doc/words.tsv [ s:keep !SourceLine matched? [ keep-entry ] -if ] file:for-each-line cleanup ; }} ~~~ @@ -466,7 +466,7 @@ Next, get the editor from the $EDITOR environment variable. ---reveal--- :handle-edit prepare - 'words.tsv + 'doc/words.tsv [ s:keep !SourceLine field:name TARGET2 s:eq? [ select-field generate-entry ] [ @SourceLine write-line ] choose write-nl @@ -493,15 +493,15 @@ a separator bar between each entry. {{ :horizontal-line #72 [ $- c:put ] times nl nl ; :export-glossary - 'words.tsv + 'doc/words.tsv [ s:keep !SourceLine display-result horizontal-line ] file:for-each-line ; :export-concise - 'words.tsv + 'doc/words.tsv [ s:keep !SourceLine display-concise-result ] file:for-each-line ; :export-concise-stack - 'words.tsv + 'doc/words.tsv [ s:keep !SourceLine display-concise-result ] file:for-each-line ; ~~~ @@ -510,8 +510,8 @@ a separator bar between each entry. ~~~ :export-html - 'words.tsv [ s:keep !SourceLine - display-result '
s:put nl ] file:for-each-line ; + 'doc/words.tsv [ s:keep !SourceLine + display-result '
s:put nl ] file:for-each-line ; ~~~ #### TSV @@ -537,7 +537,7 @@ you edit/save the TSV data with a spreadsheet application. [ call s:put tab ] a:for-each nl ; :export-tsv - 'words.tsv [ s:keep !SourceLine display-fields ] file:for-each-line ; + 'doc/words.tsv [ s:keep !SourceLine display-fields ] file:for-each-line ; ---reveal--- ~~~ @@ -632,7 +632,7 @@ generating the directory line for each. ~~~ :gopher:list-words (-) - 'words.tsv [ s:keep !SourceLine display-entry ] file:for-each-line ; + 'doc/words.tsv [ s:keep !SourceLine display-entry ] file:for-each-line ; ~~~ With the Gopher side of the index taken care of, I turn my @@ -657,7 +657,7 @@ this to build an index. field:name sanitize over '%s
\n s:format s:put ; :http:list-words (-) - #0 'words.tsv [ s:keep !SourceLine display-entry n:inc ] file:for-each-line drop ; + #0 'doc/words.tsv [ s:keep !SourceLine display-entry n:inc ] file:for-each-line drop ; ~~~ Next, words to display a specific word. @@ -667,7 +667,7 @@ Next, words to display a specific word. :matched? (-f) field:name @Target s:eq? ; :gopher:display - 'words.tsv [ s:keep !SourceLine matched? [ display-result ] if ] file:for-each-line ; + 'doc/words.tsv [ s:keep !SourceLine matched? [ display-result ] if ] file:for-each-line ; ~~~ And then the actual top level server. @@ -693,7 +693,7 @@ And then the actual top level server. :entry display-result ; :http:display (-) - #0 'words.tsv [ s:keep !SourceLine dup-pair eq? [ entry ] if n:inc ] file:for-each-line drop-pair ; + #0 'doc/words.tsv [ s:keep !SourceLine dup-pair eq? [ entry ] if n:inc ] file:for-each-line drop-pair ; :send-http-headers 'HTTP/1.0_200_OK\nContent-Type:_text/html\n\n s:format s:put ;