]> gitweb.factorcode.org Git - factor.git/commitdiff
vocabs: Show vocab metadata in help and fix ctrl-e for private vocab
authorDoug Coleman <doug.coleman@gmail.com>
Sat, 20 Mar 2021 21:11:47 +0000 (16:11 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Sun, 21 Mar 2021 20:54:29 +0000 (15:54 -0500)
USE: alien.private [ctrl-e] now works

Listing files for alien.private now lists the files for alien

basis/help/vocabs/vocabs.factor
basis/vocabs/files/files.factor
basis/vocabs/metadata/metadata.factor
core/vocabs/loader/loader.factor

index c0546a46456c93120ca159660e56391ddeaf028f..ee340fd79e8b17533a65629b7c60074a6104b63a 100644 (file)
@@ -82,6 +82,14 @@ C: <vocab-author> vocab-author
         ] ($block)
     ] unless-empty ;
 
+: describe-metadata-files ( vocab -- )
+    vocab-metadata-files [ <pathname> ] map [
+        "Meta-data files" $heading
+        [
+            files.
+        ] ($block)
+    ] unless-empty ;
+
 : describe-tuple-classes ( classes -- )
     [
         "Tuple classes" $subheading
@@ -254,6 +262,7 @@ C: <vocab-author> vocab-author
         [ describe-metadata ]
         [ describe-words ]
         [ describe-files ]
+        [ describe-metadata-files ]
         [ describe-children ]
     } cleave ;
 
index 33af6889c7b06a8048f863325b0d7e8be24ea30d..96bef7788bc568e8a20f49b1e2ee3338f19c9edd 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: combinators io.directories io.files io.pathnames kernel
-make sequences vocabs.loader ;
+make sequences splitting vocabs vocabs.loader ;
 IN: vocabs.files
 
 : vocab-tests-path ( vocab -- path/f )
@@ -16,6 +16,7 @@ IN: vocabs.files
     ] [ f ] if* ;
 
 : vocab-tests ( vocab -- paths )
+    vocab-name ".private" ?tail drop
     [
         [ vocab-tests-path [ dup exists? [ , ] [ drop ] if ] when* ]
         [ vocab-tests-dir % ] bi
index ea085d28524cd702b476c3e4e4dd2f6e91781e4a..160a24f77a22771da8cade8212f865a5a3e5b95b 100644 (file)
@@ -98,6 +98,20 @@ TUPLE: unsupported-platform vocab requires ;
 M: unsupported-platform summary
     drop "Current operating system not supported by this vocabulary" ;
 
+: exists?, ( path -- )
+    [ dup exists? [ , ] [ drop ] if ] when* ;
+
+: vocab-metadata-files ( vocab -- paths )
+    [
+        {
+            [ vocab-summary-path exists?, ]
+            [ vocab-authors-path exists?, ]
+            [ vocab-tags-path exists?, ]
+            [ vocab-platforms-path exists?, ]
+            [ vocab-resources-path exists?, ]
+        } cleave
+    ] { } make ;
+
 [
     dup vocab-platforms dup supported-platform?
     [ 2drop ] [ [ vocab-name ] dip throw-unsupported-platform ] if
index de2770d816889be73cda5203e2f4b8c53acb278f..0be009c10ef3dba1e5fda3cd3feab8d6b0b415d9 100644 (file)
@@ -63,9 +63,11 @@ PRIVATE>
     swap find-vocab-root [ prepend-path ] [ drop f ] if* ;
 
 : vocab-source-path ( vocab -- path/f )
+    vocab-name ".private" ?tail drop
     dup ".factor" append-vocab-dir vocab-append-path ;
 
 : vocab-docs-path ( vocab -- path/f )
+    vocab-name ".private" ?tail drop
     dup "-docs.factor" append-vocab-dir vocab-append-path ;
 
 SYMBOL: load-help?