Changed Browser's "Up:" links to a traditional breadcrumbs list.
Tweaked a few colors in the Factor UI.db4
parent
e2fa28a727
commit
1bb48ec9ea
|
@ -101,19 +101,21 @@ M: word set-article-parent swap "help-parent" set-word-prop ;
|
||||||
|
|
||||||
: $navigation-table ( topic -- )
|
: $navigation-table ( topic -- )
|
||||||
[
|
[
|
||||||
[ help-path [ \ $links "Up:" $navigation-row ] unless-empty ]
|
|
||||||
[ prev-article [ 1array \ $long-link "Prev:" $navigation-row ] when* ]
|
[ prev-article [ 1array \ $long-link "Prev:" $navigation-row ] when* ]
|
||||||
[ next-article [ 1array \ $long-link "Next:" $navigation-row ] when* ]
|
[ next-article [ 1array \ $long-link "Next:" $navigation-row ] when* ]
|
||||||
tri
|
bi
|
||||||
] { } make [ $table ] unless-empty ;
|
] { } make [ $table ] unless-empty ;
|
||||||
|
|
||||||
|
: ($navigation) ( topic -- )
|
||||||
|
help-path-style get [
|
||||||
|
[ help-path [ reverse $breadcrumbs ] unless-empty ]
|
||||||
|
[ $navigation-table ] bi
|
||||||
|
] with-style ;
|
||||||
|
|
||||||
: $title ( topic -- )
|
: $title ( topic -- )
|
||||||
title-style get [
|
title-style get [
|
||||||
title-style get [
|
[ ($title) ] [ ($navigation) ] bi
|
||||||
[ ($title) ]
|
] with-nested-style nl ;
|
||||||
[ help-path-style get [ $navigation-table ] with-style ] bi
|
|
||||||
] with-nesting
|
|
||||||
] with-style nl ;
|
|
||||||
|
|
||||||
: print-topic ( topic -- )
|
: print-topic ( topic -- )
|
||||||
>link
|
>link
|
||||||
|
|
|
@ -205,8 +205,11 @@ ALIAS: $slot $snippet
|
||||||
"Vocabulary" $heading nl dup ($vocab-link)
|
"Vocabulary" $heading nl dup ($vocab-link)
|
||||||
] when* ;
|
] when* ;
|
||||||
|
|
||||||
|
: (textual-list) ( seq quot sep -- )
|
||||||
|
'[ _ print-element ] swap interleave ; inline
|
||||||
|
|
||||||
: textual-list ( seq quot -- )
|
: textual-list ( seq quot -- )
|
||||||
[ ", " print-element ] swap interleave ; inline
|
", " (textual-list) ; inline
|
||||||
|
|
||||||
: $links ( topics -- )
|
: $links ( topics -- )
|
||||||
[ [ ($link) ] textual-list ] ($span) ;
|
[ [ ($link) ] textual-list ] ($span) ;
|
||||||
|
@ -214,6 +217,9 @@ ALIAS: $slot $snippet
|
||||||
: $vocab-links ( vocabs -- )
|
: $vocab-links ( vocabs -- )
|
||||||
[ vocab ] map $links ;
|
[ vocab ] map $links ;
|
||||||
|
|
||||||
|
: $breadcrumbs ( topics -- )
|
||||||
|
[ [ ($link) ] " > " (textual-list) ] ($span) ;
|
||||||
|
|
||||||
: $see-also ( topics -- )
|
: $see-also ( topics -- )
|
||||||
"See also" $heading $links ;
|
"See also" $heading $links ;
|
||||||
|
|
||||||
|
|
|
@ -30,10 +30,10 @@ H{ { font-style bold } } strong-style set-global
|
||||||
SYMBOL: title-style
|
SYMBOL: title-style
|
||||||
H{
|
H{
|
||||||
{ font-name "sans-serif" }
|
{ font-name "sans-serif" }
|
||||||
{ font-size 18 }
|
{ font-size 20 }
|
||||||
{ font-style bold }
|
{ font-style bold }
|
||||||
{ wrap-margin 500 }
|
{ wrap-margin 500 }
|
||||||
{ foreground COLOR: FactorDarkSlateBlue }
|
{ foreground COLOR: gray20 }
|
||||||
{ page-color COLOR: FactorLightTan }
|
{ page-color COLOR: FactorLightTan }
|
||||||
{ border-width 5 }
|
{ border-width 5 }
|
||||||
} title-style set-global
|
} title-style set-global
|
||||||
|
@ -46,6 +46,7 @@ H{
|
||||||
{ font-name "sans-serif" }
|
{ font-name "sans-serif" }
|
||||||
{ font-size 16 }
|
{ font-size 16 }
|
||||||
{ font-style bold }
|
{ font-style bold }
|
||||||
|
{ foreground COLOR: FactorDarkSlateBlue }
|
||||||
} heading-style set-global
|
} heading-style set-global
|
||||||
|
|
||||||
SYMBOL: subsection-style
|
SYMBOL: subsection-style
|
||||||
|
|
|
@ -90,6 +90,13 @@ 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,6 +42,9 @@ 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