From 1c038b611adaa7384d8cc2c8e91426c63bf0fc87 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Fri, 12 Sep 2008 12:08:01 -0500 Subject: [PATCH] add docs for mime-types --- basis/mime-types/mime-types-docs.factor | 35 +++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 basis/mime-types/mime-types-docs.factor diff --git a/basis/mime-types/mime-types-docs.factor b/basis/mime-types/mime-types-docs.factor new file mode 100644 index 0000000000..cf44808725 --- /dev/null +++ b/basis/mime-types/mime-types-docs.factor @@ -0,0 +1,35 @@ +! Copyright (C) 2008 Doug Coleman. +! See http://factorcode.org/license.txt for BSD license. +USING: assocs help.markup help.syntax io.streams.string sequences ; +IN: mime-types + +HELP: mime-db +{ $values + + { "seq" sequence } } +{ $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." } ; + +HELP: mime-type +{ $values + { "path" "a pathname string" } + { "mime-type" "a MIME type string" } } +{ $description "Outputs the MIME type associtated with a path by parsing the path's file extension and looking it up in the table returned by " { $link mime-types } "." } ; + +HELP: mime-types +{ $values + + { "assoc" assoc } } +{ $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." } ; + +HELP: nonstandard-mime-types +{ $values + + { "assoc" assoc } } +{ $description "A list of Factor-specific MIME types that are added to the MIME database loaded from disk." } ; + +ARTICLE: "mime-types" "mime-types" +"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 +"Looking up a MIME type:" +{ $subsection mime-type } ; + +ABOUT: "mime-types"