1 ! Copyright (C) 2009 Daniel Ehrenberg
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: help.syntax help.markup strings math ;
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 { $subsection wrap-lines }
11 { $subsection wrap-string }
12 { $subsection wrap-indented-string } ;
15 { $values { "lines" string } { "width" integer } { "newlines" "sequence of strings" } }
16 { $description "Given a 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 { $values { "string" string } { "width" integer } { "newstring" string } }
20 { $description "Given a 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." } ;
22 HELP: wrap-indented-string
23 { $values { "string" string } { "width" integer } { "indent" string } { "newstring" string } }
24 { $description "Given a 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. Before each line, the indent string is added." } ;