]> gitweb.factorcode.org Git - factor.git/blob - basis/wrap/strings/strings-docs.factor
e20780d3ac4f0dd255b0edf988f546e344fd5a3c
[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 { $subsection wrap-lines }
11 { $subsection wrap-string }
12 { $subsection wrap-indented-string } ;
13
14 HELP: wrap-lines
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." } ;
17
18 HELP: wrap-string
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." } ;
21
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." } ;
25