vocabs.metadata.resources: updating the docs i forgot

char-rename
Björn Lindqvist 2016-09-13 17:10:33 +02:00
parent b40e6cbd6d
commit 3dbec75864
2 changed files with 9 additions and 8 deletions

View File

@ -6,12 +6,13 @@ HELP: copy-vocab-resources
{ $values { "dir" string } { "vocab" string } }
{ $description "Copies all the vocabs resource files to the given directory." } ;
HELP: expand-vocab-resource-files
HELP: match-patterns
{ $values
{ "vocab" "a vocabulary specifier" } { "resource-glob-strings" "a sequence of glob patterns" }
{ "filenames" "a sequence of filenames" }
{ "patterns" "a sequence of glob patterns" }
{ "filenames" "a sequence of filenames" }
{ "filenames'" "a filtered sequence of filenames" }
}
{ $description "Matches all the glob patterns in " { $snippet "resource-glob-strings" } " to the set of files inside " { $snippet "vocab" } "'s directory and outputs a sequence containing the individual files and directories that match. Any matching directories will also have their contents recursively included in the output. The paths in the output will be relative to " { $snippet "vocab" } "'s directory." } ;
{ $description "Matches all the glob patterns in " { $snippet "patterns" } " to the sequence of files in " { $snippet "filenames" } ". If a pattern doesn't match anything, then a " { $link resource-missing } " error will be thrown containing that pattern." } ;
HELP: vocab-resource-files
{ $values
@ -23,8 +24,8 @@ HELP: vocab-resource-files
ARTICLE: "vocabs.metadata.resources" "Vocabulary resource metadata"
"The " { $vocab-link "vocabs.metadata.resources" } " vocabulary contains words to retrieve the full list of files that match the patterns specified in a vocabulary's " { $snippet "resources.txt" } " file."
{ $subsections
vocab-resource-files
expand-vocab-resource-files
match-patterns
vocab-resource-files
} ;
ABOUT: "vocabs.metadata.resources"

View File

@ -24,11 +24,11 @@ PRIVATE>
ERROR: resource-missing pattern ;
: match-pattern ( pattern files -- files' )
: match-pattern ( pattern filenames -- filenames' )
over <glob> '[ _ matches? ] filter
[ resource-missing ] [ nip ] if-empty ;
: match-patterns ( patterns files -- files' )
: match-patterns ( patterns filenames -- filenames' )
'[ _ match-pattern ] map concat members ;
: vocab-resource-files ( vocab -- filenames )