The USING: line should be easier to read now.
I also decided to stop highlighting symbols.
: $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 [
! 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
{ 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{
SYMBOL: code-style
H{
- { page-color COLOR: FactorLightTan }
+ { page-color COLOR: FactorLightLightTan }
{ inset { 5 5 } }
{ wrap-margin f }
} code-style set-global
<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 ;