io.styles: bailed out on the with-nested-styles combinator
parent
e1979f5ad5
commit
65e9c29a7b
|
@ -116,9 +116,11 @@ M: word set-article-parent swap "help-parent" set-word-prop ;
|
||||||
] with-style ;
|
] with-style ;
|
||||||
|
|
||||||
: $title ( topic -- )
|
: $title ( topic -- )
|
||||||
|
title-style get [
|
||||||
title-style get [
|
title-style get [
|
||||||
[ ($title) ] [ ($navigation) ] bi
|
[ ($title) ] [ ($navigation) ] bi
|
||||||
] with-nested-style nl ;
|
] with-nesting
|
||||||
|
] with-style nl ;
|
||||||
|
|
||||||
: print-topic ( topic -- )
|
: print-topic ( topic -- )
|
||||||
>link
|
>link
|
||||||
|
|
|
@ -90,13 +90,6 @@ HELP: with-style
|
||||||
{ $notes "Details are in the documentation for " { $link make-span-stream } "." }
|
{ $notes "Details are in the documentation for " { $link make-span-stream } "." }
|
||||||
$io-error ;
|
$io-error ;
|
||||||
|
|
||||||
HELP: with-nested-style
|
|
||||||
{ $values { "style" assoc } { "quot" quotation } }
|
|
||||||
{ $description "Calls the quotation in a new dynamic scope where calls to " { $link write } ", " { $link format } " and other stream output words automatically inherit style settings from " { $snippet "style" } "." }
|
|
||||||
$nl
|
|
||||||
"This word is intended to be used when you have a single style assoc that contains both character and paragraph styles."
|
|
||||||
$io-error ;
|
|
||||||
|
|
||||||
ARTICLE: "formatted-stream-protocol" "Formatted stream protocol"
|
ARTICLE: "formatted-stream-protocol" "Formatted stream protocol"
|
||||||
"The " { $vocab-link "io.styles" } " vocabulary defines a protocol for output streams that support rich text."
|
"The " { $vocab-link "io.styles" } " vocabulary defines a protocol for output streams that support rich text."
|
||||||
{ $subsection stream-format }
|
{ $subsection stream-format }
|
||||||
|
|
|
@ -42,9 +42,6 @@ make-cell-stream stream-write-table ;
|
||||||
[ output-stream get make-block-stream ] dip
|
[ output-stream get make-block-stream ] dip
|
||||||
with-output-stream ; inline
|
with-output-stream ; inline
|
||||||
|
|
||||||
: with-nested-style ( style quot -- )
|
|
||||||
over [ with-nesting ] with-style ; inline
|
|
||||||
|
|
||||||
TUPLE: filter-writer stream ;
|
TUPLE: filter-writer stream ;
|
||||||
|
|
||||||
CONSULT: output-stream-protocol filter-writer stream>> ;
|
CONSULT: output-stream-protocol filter-writer stream>> ;
|
||||||
|
|
Loading…
Reference in New Issue