glossary: clean up new entry generation

FossilOrigin-Name: 098404a481875e34b888a2cc255de8a6503854cc5a5c8888098ba2b1aa667bab
This commit is contained in:
crc 2019-01-23 14:08:42 +00:00
parent aa2ab6b7e4
commit 2d20658225

View file

@ -170,6 +170,7 @@ There are five primary roles:
* export data
* list missing words
## Describe a Word
~~~
@ -179,6 +180,7 @@ There are five primary roles:
'words.tsv [ s:keep !SourceLine matched? [ display-result ] if ] file:for-each-line ;
~~~
## Missing Words
~~~
@ -193,6 +195,7 @@ There are five primary roles:
populate-names [ d:name dup &GlossaryNames set:contains-string? [ drop ] [ s:put nl ] choose ] d:for-each ;
~~~
## Add a Word
This just adds a stub to the end of the words.tsv file.
@ -200,15 +203,20 @@ You'll need to run the edit commands for each field to
fully populate it.
~~~
'FADD var
:add-word
'words.tsv file:A file:open !FADD
TARGET '%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 s:format
[ @FADD file:write ] s:for-each
@FADD file:close ;
{{
'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 ;
:cleanup @ADD file:close ;
---reveal---
:add-word
prepare
TARGET template s:format [ @ADD file:write ] s:for-each
cleanup ;
}}
~~~
## Delete a Word
~~~