]> gitweb.factorcode.org Git - factor.git/commitdiff
Make vocab-usage and vocab-uses more useful
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Tue, 15 Jul 2008 21:17:13 +0000 (16:17 -0500)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Tue, 15 Jul 2008 21:17:13 +0000 (16:17 -0500)
extra/help/markup/markup.factor
extra/tools/vocabs/browser/browser.factor

index 692255bdd543efc245ff609d62e8852ab1bccb49..0f2de467f9120e11d6d36e3284aaf000084088fb 100755 (executable)
@@ -188,6 +188,9 @@ M: f print-element drop ;
 : $links ( topics -- )
     [ [ ($link) ] textual-list ] ($span) ;
 
+: $vocab-links ( vocabs -- )
+    [ vocab ] map $links ;
+
 : $see-also ( topics -- )
     "See also" $heading $links ;
 
index afbb936df1e720bccebddb6c760ed5647c186e42..55a96c8b7d06ce2d280ecf591ed95f505c97a8a6 100755 (executable)
@@ -3,7 +3,7 @@
 USING: accessors kernel combinators vocabs vocabs.loader
 tools.vocabs io io.files io.styles help.markup help.stylesheet
 sequences assocs help.topics namespaces prettyprint words
-sorting definitions arrays summary sets ;
+sorting definitions arrays summary sets generic ;
 IN: tools.vocabs.browser
 
 : vocab-status-string ( vocab -- string )
@@ -104,9 +104,9 @@ C: <vocab-author> vocab-author
     ] unless drop ;
 
 : vocab-xref ( vocab quot -- vocabs )
-    >r dup vocab-name swap words r> map
+    >r dup vocab-name swap words [ generic? not ] filter r> map
     [ [ word? ] filter [ vocabulary>> ] map ] gather natural-sort
-    remove sift [ vocab ] map ; inline
+    remove sift ; inline
 
 : vocab-uses ( vocab -- vocabs ) [ uses ] vocab-xref ;
 
@@ -115,13 +115,13 @@ C: <vocab-author> vocab-author
 : describe-uses ( vocab -- )
     vocab-uses dup empty? [
         "Uses" $heading
-        dup $links
+        dup $vocab-links
     ] unless drop ;
 
 : describe-usage ( vocab -- )
     vocab-usage dup empty? [
         "Used by" $heading
-        dup $links
+        dup $vocab-links
     ] unless drop ;
 
 : $describe-vocab ( element -- )