io.styles: bailed out on the with-nested-styles combinator
parent
e1979f5ad5
commit
65e9c29a7b
|
@ -117,8 +117,10 @@ M: word set-article-parent swap "help-parent" set-word-prop ;
|
|||
|
||||
: $title ( topic -- )
|
||||
title-style get [
|
||||
[ ($title) ] [ ($navigation) ] bi
|
||||
] with-nested-style nl ;
|
||||
title-style get [
|
||||
[ ($title) ] [ ($navigation) ] bi
|
||||
] with-nesting
|
||||
] with-style nl ;
|
||||
|
||||
: print-topic ( topic -- )
|
||||
>link
|
||||
|
|
|
@ -90,13 +90,6 @@ HELP: with-style
|
|||
{ $notes "Details are in the documentation for " { $link make-span-stream } "." }
|
||||
$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"
|
||||
"The " { $vocab-link "io.styles" } " vocabulary defines a protocol for output streams that support rich text."
|
||||
{ $subsection stream-format }
|
||||
|
|
|
@ -42,9 +42,6 @@ make-cell-stream stream-write-table ;
|
|||
[ output-stream get make-block-stream ] dip
|
||||
with-output-stream ; inline
|
||||
|
||||
: with-nested-style ( style quot -- )
|
||||
over [ with-nesting ] with-style ; inline
|
||||
|
||||
TUPLE: filter-writer stream ;
|
||||
|
||||
CONSULT: output-stream-protocol filter-writer stream>> ;
|
||||
|
|
Loading…
Reference in New Issue