Update io.styles docs
parent
612e84d34d
commit
8728891876
|
@ -1,5 +1,5 @@
|
|||
USING: help.markup help.syntax io.streams.plain io strings
|
||||
hashtables kernel quotations ;
|
||||
hashtables kernel quotations colors ;
|
||||
IN: io.styles
|
||||
|
||||
HELP: stream-format
|
||||
|
@ -142,7 +142,7 @@ ARTICLE: "presentations" "Presentations"
|
|||
"The " { $link presented } " style can be used to emit clickable objects. A utility word for outputting this style:"
|
||||
{ $subsection write-object } ;
|
||||
|
||||
ARTICLE: "styles" "Styled text"
|
||||
ARTICLE: "styles" "Text styles"
|
||||
"The " { $link stream-format } ", " { $link with-style } ", " { $link with-nesting } " and " { $link tabular-output } " words take a hashtable of style attributes. Output stream implementations are free to ignore style information."
|
||||
$nl
|
||||
"Style hashtables are keyed by symbols from the " { $vocab-link "io.styles" } " vocabulary."
|
||||
|
@ -172,24 +172,23 @@ HELP: bold-italic
|
|||
{ $description "A value for the " { $link font-style } " character style denoting boldface italicized text." } ;
|
||||
|
||||
HELP: foreground
|
||||
{ $description "Character style. Text color, denoted by a sequence of four numbers between 0 and 1 (red, green, blue and alpha)." }
|
||||
{ $description "Character style. An instance of " { $link color } ". See " { $link "colors" } "." }
|
||||
{ $examples
|
||||
{ $code
|
||||
"10 ["
|
||||
" \"Hello world\" swap"
|
||||
" { 0.1 0.1 0.2 1 } n*v { 1 1 1 1 } vmin"
|
||||
" foreground associate format nl"
|
||||
" \"Hello world\\n\""
|
||||
" swap 10 / 1 <gray> foreground associate format"
|
||||
"] each"
|
||||
}
|
||||
} ;
|
||||
|
||||
HELP: background
|
||||
{ $description "Character style. Background color, denoted by a sequence of four numbers between 0 and 1 (red, green, blue and alpha)." }
|
||||
{ $description "Character style. An instance of " { $link color } ". See " { $link "colors" } "." }
|
||||
{ $examples
|
||||
{ $code
|
||||
"10 ["
|
||||
" \"Hello world\" swap"
|
||||
" { 0.1 0.4 0.1 } n*v { 1 1 1 } vmin { 1 } append"
|
||||
" \"Hello world\\n\""
|
||||
" swap 10 / 1 1 over - over 1 <rgba>"
|
||||
" background associate format nl"
|
||||
"] each"
|
||||
}
|
||||
|
@ -222,19 +221,19 @@ HELP: presented
|
|||
{ $description "Character and paragraph style. An object associated with the text. In the Factor UI, this is shown as a clickable presentation of the object; left-clicking invokes a default command, and right-clicking shows a menu of commands." } ;
|
||||
|
||||
HELP: page-color
|
||||
{ $description "Paragraph style. Background color of the paragraph block, denoted by a sequence of four numbers between 0 and 1 (red, green, blue and alpha)." }
|
||||
{ $description "Paragraph style. An instance of " { $link color } ". See " { $link "colors" } "." }
|
||||
{ $examples
|
||||
{ $code "H{ { page-color { 1 0.8 0.5 1 } } }\n[ \"A background\" write ] with-nesting nl" }
|
||||
{ $code "H{ { page-color T{ rgba f 1 0.8 0.5 1 } } }\n[ \"A background\" write ] with-nesting nl" }
|
||||
} ;
|
||||
|
||||
HELP: border-color
|
||||
{ $description "Paragraph style. Border color of the paragraph block, denoted by a sequence of four numbers between 0 and 1 (red, green, blue and alpha)." }
|
||||
{ $description "Paragraph style. An instance of " { $link color } ". See " { $link "colors" } "." }
|
||||
{ $examples
|
||||
{ $code "H{ { border-color { 1 0 0 1 } } }\n[ \"A border\" write ] with-nesting nl" }
|
||||
{ $code "H{ { border-color T{ rgba f 1 0 0 1 } } }\n[ \"A border\" write ] with-nesting nl" }
|
||||
} ;
|
||||
|
||||
HELP: border-width
|
||||
{ $description "Paragraph style. Pixels between edge of text and border color, an integer." }
|
||||
{ $description "Paragraph style. Pixels between edge of text and border, an integer." }
|
||||
{ $examples
|
||||
{ $code "H{ { border-width 10 } }\n[ \"Some inset text\" write ] with-nesting nl" }
|
||||
} ;
|
||||
|
@ -250,7 +249,7 @@ HELP: table-gap
|
|||
{ table-gap table-border stream-write-table tabular-output } related-words
|
||||
|
||||
HELP: table-border
|
||||
{ $description "Table style. Color of the border drawn between cells, denoted by a sequence of four numbers between 0 and 1 (red, green, blue and alpha)." } ;
|
||||
{ $description "Table style. An instance of " { $link color } ". See " { $link "colors" } "." } ;
|
||||
|
||||
HELP: input
|
||||
{ $class-description "Class of input text presentations. Instances can be used passed to " { $link write-object } " to output a clickable piece of input. Input text presentations are created by calling " { $link <input> } "." }
|
||||
|
|
Loading…
Reference in New Issue