diff --git a/basis/help/help.factor b/basis/help/help.factor index 6e09e298f4..c7e7f225dc 100644 --- a/basis/help/help.factor +++ b/basis/help/help.factor @@ -101,19 +101,21 @@ M: word set-article-parent swap "help-parent" set-word-prop ; : $navigation-table ( topic -- ) [ - [ help-path [ \ $links "Up:" $navigation-row ] unless-empty ] [ prev-article [ 1array \ $long-link "Prev:" $navigation-row ] when* ] [ next-article [ 1array \ $long-link "Next:" $navigation-row ] when* ] - tri + bi ] { } make [ $table ] unless-empty ; +: ($navigation) ( topic -- ) + help-path-style get [ + [ help-path [ reverse $breadcrumbs ] unless-empty ] + [ $navigation-table ] bi + ] with-style ; + : $title ( topic -- ) title-style get [ - title-style get [ - [ ($title) ] - [ help-path-style get [ $navigation-table ] with-style ] bi - ] with-nesting - ] with-style nl ; + [ ($title) ] [ ($navigation) ] bi + ] with-nested-style nl ; : print-topic ( topic -- ) >link diff --git a/basis/help/markup/markup.factor b/basis/help/markup/markup.factor index 6e75adc8aa..c64f315d6d 100644 --- a/basis/help/markup/markup.factor +++ b/basis/help/markup/markup.factor @@ -205,8 +205,11 @@ ALIAS: $slot $snippet "Vocabulary" $heading nl dup ($vocab-link) ] when* ; +: (textual-list) ( seq quot sep -- ) + '[ _ print-element ] swap interleave ; inline + : textual-list ( seq quot -- ) - [ ", " print-element ] swap interleave ; inline + ", " (textual-list) ; inline : $links ( topics -- ) [ [ ($link) ] textual-list ] ($span) ; @@ -214,6 +217,9 @@ ALIAS: $slot $snippet : $vocab-links ( vocabs -- ) [ vocab ] map $links ; +: $breadcrumbs ( topics -- ) + [ [ ($link) ] " > " (textual-list) ] ($span) ; + : $see-also ( topics -- ) "See also" $heading $links ; diff --git a/basis/help/stylesheet/stylesheet.factor b/basis/help/stylesheet/stylesheet.factor index 6c0b18e8e9..7f7975a652 100644 --- a/basis/help/stylesheet/stylesheet.factor +++ b/basis/help/stylesheet/stylesheet.factor @@ -30,10 +30,10 @@ H{ { font-style bold } } strong-style set-global SYMBOL: title-style H{ { font-name "sans-serif" } - { font-size 18 } + { font-size 20 } { font-style bold } { wrap-margin 500 } - { foreground COLOR: FactorDarkSlateBlue } + { foreground COLOR: gray20 } { page-color COLOR: FactorLightTan } { border-width 5 } } title-style set-global @@ -46,6 +46,7 @@ H{ { font-name "sans-serif" } { font-size 16 } { font-style bold } + { foreground COLOR: FactorDarkSlateBlue } } heading-style set-global SYMBOL: subsection-style diff --git a/basis/io/styles/styles-docs.factor b/basis/io/styles/styles-docs.factor index 8fcf12aae9..a952c05dbf 100755 --- a/basis/io/styles/styles-docs.factor +++ b/basis/io/styles/styles-docs.factor @@ -90,6 +90,13 @@ 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 } diff --git a/basis/io/styles/styles.factor b/basis/io/styles/styles.factor index 2d25016919..108d4c9eb0 100644 --- a/basis/io/styles/styles.factor +++ b/basis/io/styles/styles.factor @@ -42,6 +42,9 @@ 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>> ;