diff --git a/TODO.FACTOR.txt b/TODO.FACTOR.txt index 48a2fa2aac..bea1e6fab4 100644 --- a/TODO.FACTOR.txt +++ b/TODO.FACTOR.txt @@ -8,7 +8,6 @@ + help: -- double 'presented' for the block & char style - refactor style stack code so that nested styles are handled at a lower-level - with-style & with-stream-style - in HTML, we can nest div tags, etc diff --git a/library/help/help.factor b/library/help/help.factor index a9194d0199..67658b2065 100644 --- a/library/help/help.factor +++ b/library/help/help.factor @@ -19,8 +19,8 @@ M: word article-content ] { } make ; : with-default-style ( quot -- ) - default-char-style [ - default-para-style [ last-block on call ] with-nesting + default-style [ + H{ } [ last-block on call ] with-nesting ] with-style ; inline : print-title ( article -- ) diff --git a/library/help/markup.factor b/library/help/markup.factor index e49894cab0..9c68ba614a 100644 --- a/library/help/markup.factor +++ b/library/help/markup.factor @@ -144,7 +144,7 @@ M: link summary "Link: " swap link-name append ; "Notes" $heading print-element ; : $see ( content -- ) - code-style [ dup array? [ first ] when see ] with-nesting ; + code-style [ H{ } [ first see ] with-nesting ] with-style ; : $definition ( content -- ) "Definition" $heading $see ; diff --git a/library/help/stylesheet.factor b/library/help/stylesheet.factor index 2e4a8ecf20..f3bc8f5653 100644 --- a/library/help/stylesheet.factor +++ b/library/help/stylesheet.factor @@ -3,14 +3,10 @@ IN: help USING: styles ; -: default-char-style +: default-style H{ { font "serif" } { font-size 12 } - } ; - -: default-para-style - H{ { wrap-margin 500 } } ; diff --git a/library/io/nested-style.factor b/library/io/nested-style.factor index f53486e90a..4fcb47bf3e 100644 --- a/library/io/nested-style.factor +++ b/library/io/nested-style.factor @@ -30,8 +30,10 @@ M: nested-style-stream stream-write1 >r ch>string r> H{ } swap do-nested-style stream-format ; : do-nested-quot ( quot style stream -- quot style stream ) - do-nested-style - >r [ swap \ with-style 3array >quotation ] keep r> ; + tuck >r >r + nested-style-stream-style swap \ with-style + 3array >quotation + r> r> do-nested-style ; M: nested-style-stream with-nested-stream do-nested-quot with-nested-stream ; diff --git a/library/io/stdio.facts b/library/io/stdio.facts index a11647dde9..1b6f8a34ae 100644 --- a/library/io/stdio.facts +++ b/library/io/stdio.facts @@ -57,8 +57,8 @@ HELP: with-nesting "( style quot -- )" { $notes "Details are in the documentation for " { $link stream-format } "." } $io-error ; -HELP: print "( style quot -- )" -{ $values { "style" "a hashtable" } { "quot" "a quotation" } } +HELP: print "( style -- )" +{ $values { "style" "a hashtable" } } { $description "Writes a newline-terminated string to the " { $link stdio } " stream." } $io-error ; diff --git a/library/test/io/nested-style.factor b/library/test/io/nested-style.factor index e3f4bdfe00..ea008bd649 100644 --- a/library/test/io/nested-style.factor +++ b/library/test/io/nested-style.factor @@ -1,8 +1,6 @@ IN: temporary USING: io kernel math namespaces styles test ; -! Make sure everything here works... - [ ">> + <<" ] [ [ [ @@ -12,3 +10,13 @@ USING: io kernel math namespaces styles test ; ] string-out ] with-scope ] unit-test + +[ "+" ] [ + [ + [ + H{ } [ + H{ { highlight t } } [ "+" write ] with-nesting + ] with-style + ] string-out + ] with-scope +] unit-test