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 -- )
 | 
			
		||||
    [
 | 
			
		||||
        [ 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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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 ;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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 }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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>> ;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue