help browser: tweaked the colors based on user feedback.
The USING: line should be easier to read now. I also decided to stop highlighting symbols.db4
							parent
							
								
									6fdd005b5c
								
							
						
					
					
						commit
						e1979f5ad5
					
				| 
						 | 
					@ -99,12 +99,15 @@ M: word set-article-parent swap "help-parent" set-word-prop ;
 | 
				
			||||||
: $navigation-row ( content element label -- )
 | 
					: $navigation-row ( content element label -- )
 | 
				
			||||||
    [ prefix 1array ] dip prefix , ;
 | 
					    [ prefix 1array ] dip prefix , ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					: ($navigation-table) ( element -- )
 | 
				
			||||||
 | 
					    help-path-style get table-style set [ $table ] with-scope ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
: $navigation-table ( topic -- )
 | 
					: $navigation-table ( topic -- )
 | 
				
			||||||
    [
 | 
					    [
 | 
				
			||||||
        [ 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* ]
 | 
				
			||||||
        bi
 | 
					        bi
 | 
				
			||||||
    ] { } make [ $table ] unless-empty ;
 | 
					    ] { } make [ ($navigation-table) ] unless-empty ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
: ($navigation) ( topic -- )
 | 
					: ($navigation) ( topic -- )
 | 
				
			||||||
    help-path-style get [
 | 
					    help-path-style get [
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
! Copyright (C) 2005, 2009 Slava Pestov.
 | 
					! Copyright (C) 2005, 2009 Slava Pestov.
 | 
				
			||||||
! See http://factorcode.org/license.txt for BSD license.
 | 
					! See http://factorcode.org/license.txt for BSD license.
 | 
				
			||||||
USING: io.styles namespaces colors colors.constants ;
 | 
					USING: colors colors.constants io.styles literals namespaces ;
 | 
				
			||||||
IN: help.stylesheet
 | 
					IN: help.stylesheet
 | 
				
			||||||
 | 
					
 | 
				
			||||||
SYMBOL: default-span-style
 | 
					SYMBOL: default-span-style
 | 
				
			||||||
| 
						 | 
					@ -34,12 +34,16 @@ H{
 | 
				
			||||||
    { font-style bold }
 | 
					    { font-style bold }
 | 
				
			||||||
    { wrap-margin 500 }
 | 
					    { wrap-margin 500 }
 | 
				
			||||||
    { foreground COLOR: gray20 }
 | 
					    { foreground COLOR: gray20 }
 | 
				
			||||||
    { page-color COLOR: FactorLightTan }
 | 
					    { page-color COLOR: FactorLightLightTan }
 | 
				
			||||||
    { inset { 5 5 } }
 | 
					    { inset { 5 5 } }
 | 
				
			||||||
} title-style set-global
 | 
					} title-style set-global
 | 
				
			||||||
 | 
					
 | 
				
			||||||
SYMBOL: help-path-style
 | 
					SYMBOL: help-path-style
 | 
				
			||||||
H{ { font-size 10 } } help-path-style set-global
 | 
					H{
 | 
				
			||||||
 | 
					    { font-size 10 }
 | 
				
			||||||
 | 
					    { table-gap { 5 5 } }
 | 
				
			||||||
 | 
					    { table-border $ transparent }
 | 
				
			||||||
 | 
					} help-path-style set-global
 | 
				
			||||||
 | 
					
 | 
				
			||||||
SYMBOL: heading-style
 | 
					SYMBOL: heading-style
 | 
				
			||||||
H{
 | 
					H{
 | 
				
			||||||
| 
						 | 
					@ -71,7 +75,7 @@ H{
 | 
				
			||||||
 | 
					
 | 
				
			||||||
SYMBOL: code-style
 | 
					SYMBOL: code-style
 | 
				
			||||||
H{
 | 
					H{
 | 
				
			||||||
    { page-color COLOR: FactorLightTan }
 | 
					    { page-color COLOR: FactorLightLightTan }
 | 
				
			||||||
    { inset { 5 5 } }
 | 
					    { inset { 5 5 } }
 | 
				
			||||||
    { wrap-margin f }
 | 
					    { wrap-margin f }
 | 
				
			||||||
} code-style set-global
 | 
					} code-style set-global
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -7,27 +7,28 @@ IN: prettyprint.stylesheet
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<PRIVATE
 | 
					<PRIVATE
 | 
				
			||||||
 | 
					
 | 
				
			||||||
CONSTANT: dim-color COLOR: cornsilk4
 | 
					CONSTANT: dim-color COLOR: gray35
 | 
				
			||||||
 | 
					CONSTANT: alt-color COLOR: DarkSlateGray
 | 
				
			||||||
 | 
					
 | 
				
			||||||
: dimly-lit-word? ( word -- ? )
 | 
					: dimly-lit-word? ( word -- ? )
 | 
				
			||||||
    { POSTPONE: USING: POSTPONE: USE: POSTPONE: IN: } memq? ;
 | 
					    { POSTPONE: USING: POSTPONE: USE: POSTPONE: IN: } memq? ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
: parsing-word-color ( word -- color )
 | 
					: parsing-or-delim-word? ( word -- ? )
 | 
				
			||||||
    dimly-lit-word? dim-color COLOR: DarkSlateGray ? ;
 | 
					    [ parsing-word? ] [ delimiter? ] bi or ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					: word-color ( word -- color )
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        { [ dup dimly-lit-word? ] [ drop dim-color ] }
 | 
				
			||||||
 | 
					        { [ dup parsing-or-delim-word? ] [ drop alt-color ] }
 | 
				
			||||||
 | 
					        [ drop COLOR: black ]
 | 
				
			||||||
 | 
					    } cond ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
PRIVATE>
 | 
					PRIVATE>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
: word-style ( word -- style )
 | 
					: word-style ( word -- style )
 | 
				
			||||||
    dup "word-style" word-prop >hashtable [
 | 
					    dup "word-style" word-prop >hashtable [
 | 
				
			||||||
        [
 | 
					        [
 | 
				
			||||||
            [ presented set ] [
 | 
					            [ presented set ] [ word-color foreground set ] bi
 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    { [ dup parsing-word? ] [ parsing-word-color ] }
 | 
					 | 
				
			||||||
                    { [ dup delimiter? ] [ drop COLOR: DarkSlateGray ] }
 | 
					 | 
				
			||||||
                    { [ dup symbol? ] [ drop COLOR: DarkSlateGray ] }
 | 
					 | 
				
			||||||
                    [ drop COLOR: black ]
 | 
					 | 
				
			||||||
                } cond foreground set
 | 
					 | 
				
			||||||
            ] bi
 | 
					 | 
				
			||||||
        ] bind
 | 
					        ] bind
 | 
				
			||||||
    ] keep ;
 | 
					    ] keep ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue