]> gitweb.factorcode.org Git - factor.git/blob - basis/mime/types/types-docs.factor
76594168b43a9402c5eb26cfab723fea525b5ed3
[factor.git] / basis / mime / types / types-docs.factor
1 ! Copyright (C) 2008 Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: assocs help.markup help.syntax io.streams.string sequences ;
4 IN: mime.types
5
6 HELP: mime-db
7 { $values
8
9      { "seq" sequence } }
10 { $description "Outputs an array where the first element is a MIME type and the rest of the array is file extensions that have that MIME type." } ;
11
12 HELP: mime-type
13 { $values
14     { "filename" "a filename" }
15     { "mime-type" "a MIME type string" } }
16 { $description "Outputs the MIME type associated with a path by parsing the path's file extension and looking it up in the table returned by " { $link mime-types } "." } ;
17
18 HELP: mime-types
19 { $values
20
21      { "assoc" assoc } }
22 { $description "Outputs an " { $snippet "assoc" } " made from the data in the " { $link mime-db } " word where the keys are file extensions and the values are the corresponding MIME types." } ;
23
24 HELP: nonstandard-mime-types
25 { $values
26
27      { "assoc" assoc } }
28 { $description "A list of Factor-specific MIME types that are added to the MIME database loaded from disk." } ;
29
30 ARTICLE: "mime.types" "MIME types"
31 "The " { $vocab-link "mime.types" } " vocabulary loads a file of MIME types and provides a word to look up the MIME type based on a file extension." $nl
32 "Looking up a MIME type:"
33 { $subsections mime-type } ;
34
35 ABOUT: "mime.types"