]> gitweb.factorcode.org Git - factor.git/commitdiff
help.markup: make $example render slightly nicer
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Wed, 17 Feb 2010 12:18:48 +0000 (01:18 +1300)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Wed, 17 Feb 2010 12:18:48 +0000 (01:18 +1300)
basis/help/markup/markup.factor
basis/help/stylesheet/stylesheet.factor

index 75e65382435fa8c60259fe39c6b848e0199a4766..f951f30b2f673f8c156fe37e422bc9e8e884faa6 100644 (file)
@@ -129,8 +129,8 @@ ALIAS: $slot $snippet
     "Examples" $heading print-element ;
 
 : $example ( element -- )
-    1 cut* swap "\n" join dup <input> [
-        input-style get format nl print-element
+    1 cut* [ "\n" join ] bi@ over <input> [
+        [ print ] [ output-style get format ] bi*
     ] ($code) ;
 
 : $unchecked-example ( element -- )
index 8a119823cc367f314b3539e84f35e688646fd302..d5b783fef86534969225afb776dae7b00ed0a8c7 100644 (file)
@@ -80,8 +80,11 @@ H{
     { wrap-margin f }
 } code-style set-global
 
-SYMBOL: input-style
-H{ { font-style bold } } input-style set-global
+SYMBOL: output-style
+H{
+    { font-style bold }
+    { foreground COLOR: dark-red }
+} output-style set-global
 
 SYMBOL: url-style
 H{