]> gitweb.factorcode.org Git - factor.git/commitdiff
Changed Browser's "Up:" links to a traditional breadcrumbs list.
authorKeith Lazuka <klazuka@gmail.com>
Wed, 9 Sep 2009 14:44:41 +0000 (10:44 -0400)
committerKeith Lazuka <klazuka@gmail.com>
Wed, 9 Sep 2009 14:44:41 +0000 (10:44 -0400)
Tweaked a few colors in the Factor UI.

basis/help/help.factor
basis/help/markup/markup.factor
basis/help/stylesheet/stylesheet.factor
basis/io/styles/styles-docs.factor
basis/io/styles/styles.factor

index 6e09e298f43c7f3652080738fd7b0d95703a559b..c7e7f225dcf631a2993a56a9ee5884f86095eb89 100644 (file)
@@ -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
index 6e75adc8aaaed0c1ed622bb46806badc95fc7a90..c64f315d6d394c411d3ff20e5bd2a104e016912b 100644 (file)
@@ -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 ;
 
index 6c0b18e8e97160c7c487b08640a41c503da795af..7f7975a6522c7dede7751b67fbbf5c9d92dc9d94 100644 (file)
@@ -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
index 8fcf12aae9bb52dcf63d7e24a5a22f15586876fe..a952c05dbf5884dbb05bff21d44c73dddf2d251b 100755 (executable)
@@ -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 }
index 2d25016919cb6ee96971d368590d886593babc29..108d4c9eb04ec4dc4b1621c6a747a8fa6a5dd67d 100644 (file)
@@ -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>> ;