]> gitweb.factorcode.org Git - factor.git/blob - basis/wrap/strings/strings-docs.factor
factor: clean up whitespace in -docs files
[factor.git] / basis / wrap / strings / strings-docs.factor
1 ! Copyright (C) 2009 Daniel Ehrenberg
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: help.syntax help.markup strings math ;
4 IN: wrap.strings
5
6 ABOUT: "wrap.strings"
7
8 ARTICLE: "wrap.strings" "String word wrapping"
9 "The " { $vocab-link "wrap.strings" } " vocabulary implements word wrapping for simple strings, assumed to be in monospace font."
10 { $subsections
11     wrap-lines
12     wrap-string
13     wrap-indented-string
14 } ;
15
16 HELP: wrap-lines
17 { $values { "string" string } { "width" integer } { "newlines" "sequence of strings" } }
18 { $description "Given a " { $snippet "string" } ", divides it into a sequence of lines where each line has no more than " { $snippet "width" } " characters, unless there is a word longer than " { $snippet "width" } ". Linear whitespace between words is converted to a single space." } ;
19
20 HELP: wrap-string
21 { $values { "string" string } { "width" integer } { "newstring" string } }
22 { $description "Given a " { $snippet "string" } ", alters the whitespace in the string so that each line has no more than " { $snippet "width" } " characters, unless there is a word longer than " { $snippet "width" } ". Linear whitespace between words is converted to a single space." } ;
23
24 HELP: wrap-indented-string
25 { $values { "string" string } { "width" integer } { "indent" "string or integer" } { "newstring" string } }
26 { $description "Given a " { $snippet "string" } ", alters the whitespace in the string so that each line has no more than " { $snippet "width" } " characters, unless there is a word longer than " { $snippet "width" } ". Linear whitespace between words is converted to a single space. The " { $snippet "indent" } " can be either a " { $link string } " or a number of spaces to prepend to each line." } ;