]> gitweb.factorcode.org Git - factor.git/commitdiff
Merge branch 'arm64-bootstrap2'
authorDoug Coleman <doug.coleman@gmail.com>
Sun, 19 Jun 2022 16:03:22 +0000 (11:03 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Sun, 19 Jun 2022 16:03:22 +0000 (11:03 -0500)
basis/help/html/html.factor
core/sequences/sequences-tests.factor
core/sequences/sequences.factor
extra/fuel/remote/remote.factor
extra/mason/build/build.factor
extra/webapps/help/help.factor
extra/webapps/help/search.css

index c5bf485ea312f9573f4c4ce27a4278e9dbb91d8d..6b3cfa9d52bef87df71ab4ce534b8836df3deac3 100644 (file)
@@ -303,8 +303,15 @@ MEMO: load-index ( name -- index )
 : article-apropos ( string -- results )
     "articles.idx" offline-apropos ;
 
-: word-apropos ( string -- results )
-    "words.idx" offline-apropos ;
-
 : vocab-apropos ( string -- results )
     "vocabs.idx" offline-apropos ;
+
+: qualified-index ( str index -- str index' )
+    over ":" split1 [
+        drop vocab-apropos values [ "," ".html" surround ] map
+        '[ drop _ [ tail? ] with any? ] dupd assoc-filter
+        [ over ".html" ?tail drop "," split1-last nip swap ":" glue ] assoc-map append
+    ] [ drop ] if* ;
+
+: word-apropos ( string -- results )
+    "words.idx" load-index qualified-index completions ;
index 4528ff6d26ae6db207e8c56216792425abb61431..bc88d8c02e81977d25673aef9bb37f811e383a8a 100644 (file)
@@ -414,6 +414,8 @@ M: bogus-hashcode hashcode* 2drop 0 >bignum ;
 { { 0 } } [ 1 0 <repetition> >array ] unit-test
 { { 0 0 0 } } [ 3 0 <repetition> >array ] unit-test
 
+{ "ABCD" } [ "AAAA" [ + ] map-index ] unit-test
+
 {
     { 11 23 35 }
 } [ { 11 22 33 } [ + ] map-index ] unit-test
index 634d1464166f9b98ab29a27224ffd6e8857e61de..6605e6f88e2dda355f308d1d970d3715d3dfe325 100644 (file)
@@ -633,7 +633,7 @@ PRIVATE>
     [ dup length <iota> ] 2dip 2map-as ; inline
 
 : map-index ( ... seq quot: ( ... elt index -- ... newelt ) -- ... newseq )
-    { } map-index-as ; inline
+    over map-index-as ; inline
 
 : interleave ( ... seq between quot: ( ... elt -- ... ) -- ... )
     pick empty? [ 3drop ] [
index b9cb3d139db6c92e5f70ce5b36c806c01b5ccfb9..4e55f10de5956acfa824271305aff47e9aed1585 100644 (file)
@@ -13,7 +13,7 @@ IN: fuel.remote
 PRIVATE>
 
 : fuel-start-remote-listener ( port/f -- )
-    print-banner integer? [ 9000 ] unless* <tty-server> start-server drop ;
+    print-banner [ 9000 ] unless* <tty-server> start-server drop ;
 
 : fuel-start-remote-listener* ( -- ) f fuel-start-remote-listener ;
 
index 217d22626948222970865cb0680834f5c2f53f23..c4e023e0286afdd054ce38811e5973d17926fc85 100644 (file)
@@ -1,9 +1,10 @@
 ! Copyright (C) 2008, 2011 Eduardo Cavazos, Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: arrays calendar combinators continuations io.directories
-io.pathnames kernel mason.child mason.cleanup mason.common
-mason.config mason.docs mason.git mason.notify mason.platform
-mason.release mason.updates namespaces sequences ;
+USING: arrays calendar combinators continuations io.backend
+io.directories io.pathnames kernel mason.child mason.cleanup
+mason.common mason.config mason.docs mason.git mason.notify
+mason.platform mason.release mason.updates namespaces sequences
+;
 IN: mason.build
 
 : create-build-dir ( -- )
@@ -16,7 +17,7 @@ IN: mason.build
 
 : clone-source ( -- )
     "Cloning GIT repository" print-timestamp
-    "git" "clone" builds-dir get "factor" append-path 3array
+    "git" "clone" builds-dir get "factor" append-path normalize-path 3array
     short-running-process ;
 
 : copy-image ( -- )
index d6f46f31669b255502878df5c446d273466aeb99..73066f5ec7446e30395f34dd6a9cabd8ec4dd940 100644 (file)
@@ -4,13 +4,19 @@ USING: accessors assocs furnace.actions furnace.boilerplate
 furnace.redirection help.html help.topics html.components
 html.forms http.server http.server.dispatchers
 http.server.static io.directories io.files.temp io.servers
-kernel namespaces sequences unicode urls ;
+kernel namespaces sequences splitting unicode urls ;
 IN: webapps.help
 
 TUPLE: help-webapp < dispatcher ;
 
+: fixup-words ( title href -- title' href' )
+    dup "word-" head? [
+        dup ".html" ?tail drop "," split1-last nip dup ":" append
+        '[ " (" _ 3append ")" append _ ?head drop ] dip
+    ] when ;
+
 : links ( apropos -- seq )
-    [ swap <simple-link> ] { } assoc>map ;
+    [ swap fixup-words <simple-link> ] { } assoc>map ;
 
 : ?links ( has-links? apropos -- has-links? seq/f )
     links [ f ] [ nip t swap ] if-empty ;
index 8857a1b70a72dbb77eaa3fe006626547983911dd..58eb0300de5441c8e0da067e59c5a2d277bbf766 100644 (file)
@@ -12,7 +12,6 @@
 .label {
   width: 100%;
   padding: 5px;
-  background: white;
   cursor: pointer;
   font-weight: bold;
   font-size: 14pt;
 .panel {
   display: none;
   width: 100%;
+  border-top: 1px solid #ccc;
 }
 
 .radiotab:checked + .label + .panel {
   display: block;
 }
 
+@media (prefers-color-scheme: dark) {
+
+  .panel {
+    border-top: 1px solid #666;
+  }
+
+  .label {
+    color: #bdc1c6;
+    border: 1px solid #666;
+  }
+
+  .label:hover {
+    background: #373e48;
+    border: 1px solid #666;
+  }
+
+  .radiotab:checked + .label {
+    border: 1px solid #666;
+    background: #373e48;
+    color: white;
+  }
+}
+
+@media (max-width: 599px) {
+
+  .panel {
+    border-top: none;
+  }
+}
+
 @media (min-width: 600px) {
 
   .panel {
     order: 99;
-    border-top: 1px solid #ccc;
   }
 
   .label {
     width: 33.33%;
-    border: 1px solid white;
+    border: 1px solid transparent;
     border-bottom: none;
   }