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
Keith Lazuka 2009-09-10 09:48:20 -04:00
parent 6fdd005b5c
commit e1979f5ad5
3 changed files with 24 additions and 16 deletions

View File

@ -99,12 +99,15 @@ M: word set-article-parent swap "help-parent" set-word-prop ;
: $navigation-row ( content element label -- )
[ prefix 1array ] dip prefix , ;
: ($navigation-table) ( element -- )
help-path-style get table-style set [ $table ] with-scope ;
: $navigation-table ( topic -- )
[
[ prev-article [ 1array \ $long-link "Prev:" $navigation-row ] when* ]
[ next-article [ 1array \ $long-link "Next:" $navigation-row ] when* ]
bi
] { } make [ $table ] unless-empty ;
] { } make [ ($navigation-table) ] unless-empty ;
: ($navigation) ( topic -- )
help-path-style get [

View File

@ -1,6 +1,6 @@
! Copyright (C) 2005, 2009 Slava Pestov.
! 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
SYMBOL: default-span-style
@ -34,12 +34,16 @@ H{
{ font-style bold }
{ wrap-margin 500 }
{ foreground COLOR: gray20 }
{ page-color COLOR: FactorLightTan }
{ page-color COLOR: FactorLightLightTan }
{ inset { 5 5 } }
} title-style set-global
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
H{
@ -71,7 +75,7 @@ H{
SYMBOL: code-style
H{
{ page-color COLOR: FactorLightTan }
{ page-color COLOR: FactorLightLightTan }
{ inset { 5 5 } }
{ wrap-margin f }
} code-style set-global

View File

@ -7,27 +7,28 @@ IN: prettyprint.stylesheet
<PRIVATE
CONSTANT: dim-color COLOR: cornsilk4
CONSTANT: dim-color COLOR: gray35
CONSTANT: alt-color COLOR: DarkSlateGray
: dimly-lit-word? ( word -- ? )
{ POSTPONE: USING: POSTPONE: USE: POSTPONE: IN: } memq? ;
: parsing-word-color ( word -- color )
dimly-lit-word? dim-color COLOR: DarkSlateGray ? ;
: parsing-or-delim-word? ( word -- ? )
[ 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>
: word-style ( word -- style )
dup "word-style" word-prop >hashtable [
[
[ presented set ] [
{
{ [ dup parsing-word? ] [ parsing-word-color ] }
{ [ dup delimiter? ] [ drop COLOR: DarkSlateGray ] }
{ [ dup symbol? ] [ drop COLOR: DarkSlateGray ] }
[ drop COLOR: black ]
} cond foreground set
] bi
[ presented set ] [ word-color foreground set ] bi
] bind
] keep ;