1 USING: help.markup help.syntax sequences strings ;
4 ARTICLE: "vocabs.metadata" "Vocabulary metadata"
5 "Vocabulary directories can contain text files with metadata:"
7 { { $snippet "authors.txt" } " - a series of lines, with one author name per line. These are listed under " { $link "vocab-authors" } "." }
8 { { $snippet "platforms.txt" } " - a series of lines, with one operating system name per line." }
9 { { $snippet "resources.txt" } " - a series of lines, with one file glob pattern per line. Files inside the vocabulary directory whose names match any of these glob patterns will be included with the compiled application as " { $link "deploy-resources" } "." }
10 { { $snippet "summary.txt" } " - a one-line description." }
11 { { $snippet "tags.txt" } " - a series of lines, with one tag per line. Tags help classify the vocabulary. Consult " { $link "vocab-tags" } " for a list of existing tags you can reuse." }
13 "Words for reading " { $snippet "summary.txt" } ":"
17 "Words for reading " { $snippet "authors.txt" } ":"
21 "Words for reading " { $snippet "tags.txt" } ":"
25 "Words for reading " { $snippet "platforms.txt" } ":"
29 "Words for reading " { $snippet "resources.txt" } ":"
33 "Getting and setting arbitrary vocabulary metadata:"
39 ABOUT: "vocabs.metadata"
41 HELP: vocab-file-lines
42 { $values { "vocab" "a vocabulary specifier" } { "name" string } { "lines/f" { $maybe { $sequence "lines" } } } }
43 { $description "Outputs the lines of the file named " { $snippet "name" } " from the vocabulary's directory, or " { $link f } " if the file does not exist." } ;
45 HELP: set-vocab-file-lines
46 { $values { "lines" { $sequence "lines" } } { "vocab" "a vocabulary specifier" } { "name" string } }
47 { $description "Stores a sequence of lines to the file named " { $snippet "name" } " from the vocabulary's directory." } ;
50 { $values { "vocab" "a vocabulary specifier" } { "summary" { $maybe string } } }
51 { $description "Outputs a one-line string description of the vocabulary's intended purpose from the " { $snippet "summary.txt" } " file in the vocabulary's directory. Outputs " { $link f } " if the file does not exist." } ;
54 { $values { "vocab" "a vocabulary specifier" } { "tags" "a sequence of strings" } }
55 { $description "Outputs a list of short tags classifying the vocabulary from the " { $snippet "tags.txt" } " file in the vocabulary's directory. Outputs " { $link f } " if the file does not exist." } ;
58 { $values { "vocab" "a vocabulary specifier" } { "platforms" "a sequence of operating system symbols" } }
59 { $description "Outputs a list of operating systems supported by " { $snippet "vocab" } ", as specified by the " { $snippet "platforms.txt" } " file in the vocabulary's directory. Outputs an empty array if the file doesn't exist." }
60 { $notes "Operating system symbols are defined in the " { $vocab-link "system" } " vocabulary." } ;
63 { $values { "vocab" "a vocabulary specifier" } { "patterns" "a sequence of glob patterns" } }
64 { $description "Outputs a list of glob patterns matching files that will be deployed with an application that includes " { $snippet "vocab" } ", as specified by the " { $snippet "resources.txt" } " file in the vocabulary's directory. Outputs an empty array if the file doesn't exist." }
65 { $notes "The " { $vocab-link "vocabs.metadata.resources" } " vocabulary contains words that will expand the glob patterns and directory names in " { $snippet "patterns" } " and return all the matching files." } ;