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."
17 { $values { "lines" string } { "width" integer } { "newlines" "sequence of strings" } }
18 { $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." } ;
21 { $values { "string" string } { "width" integer } { "newstring" string } }
22 { $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." } ;
24 HELP: wrap-indented-string
25 { $values { "string" string } { "width" integer } { "indent" string } { "newstring" string } }
26 { $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." } ;