]> gitweb.factorcode.org Git - factor.git/commitdiff
Add silly 'tip of the day' feature, and 'recently visited' list to UI browser home...
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Tue, 24 Mar 2009 09:11:08 +0000 (04:11 -0500)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Tue, 24 Mar 2009 09:11:08 +0000 (04:11 -0500)
48 files changed:
basis/bootstrap/help/help.factor
basis/bootstrap/tools/tools.factor
basis/help/apropos/apropos-docs.factor [new file with mode: 0644]
basis/help/apropos/apropos-tests.factor [new file with mode: 0644]
basis/help/apropos/apropos.factor [new file with mode: 0644]
basis/help/handbook/handbook.factor
basis/help/help-docs.factor
basis/help/home/authors.txt [new file with mode: 0644]
basis/help/home/home-docs.factor [new file with mode: 0644]
basis/help/home/home.factor [new file with mode: 0644]
basis/help/html/html.factor
basis/help/tips/authors.txt [new file with mode: 0644]
basis/help/tips/tips-docs.factor [new file with mode: 0644]
basis/help/tips/tips.factor [new file with mode: 0644]
basis/help/vocabs/authors.txt [new file with mode: 0755]
basis/help/vocabs/summary.txt [new file with mode: 0644]
basis/help/vocabs/tags.txt [new file with mode: 0644]
basis/help/vocabs/vocabs-docs.factor [new file with mode: 0644]
basis/help/vocabs/vocabs-tests.factor [new file with mode: 0644]
basis/help/vocabs/vocabs.factor [new file with mode: 0644]
basis/tools/apropos/apropos-docs.factor [deleted file]
basis/tools/apropos/apropos-tests.factor [deleted file]
basis/tools/apropos/apropos.factor [deleted file]
basis/tools/vocabs/browser/authors.txt [deleted file]
basis/tools/vocabs/browser/browser-docs.factor [deleted file]
basis/tools/vocabs/browser/browser-tests.factor [deleted file]
basis/tools/vocabs/browser/browser.factor [deleted file]
basis/tools/vocabs/browser/summary.txt [deleted file]
basis/tools/vocabs/browser/tags.txt [deleted file]
basis/ui/gadgets/editors/editors-docs.factor
basis/ui/tools/browser/browser.factor
basis/ui/tools/deploy/deploy-docs.factor
basis/ui/tools/listener/completion/completion.factor
basis/ui/tools/listener/listener-docs.factor
basis/ui/tools/listener/listener.factor
basis/ui/tools/operations/operations-docs.factor [new file with mode: 0644]
basis/ui/tools/operations/operations.factor
basis/ui/tools/profiler/profiler-docs.factor [new file with mode: 0644]
basis/ui/tools/profiler/profiler.factor
basis/ui/tools/tools-docs.factor
core/parser/parser.factor
core/strings/strings-docs.factor
extra/demos/demos.factor
extra/fuel/help/help.factor
extra/galois-talk/galois-talk.factor
extra/google-tech-talk/google-tech-talk.factor
extra/otug-talk/otug-talk.factor
extra/vpri-talk/vpri-talk.factor

index c3e74f7863eca9b029f8dc078d0d9856193acae5..553b91a6aee084ce85489bf540bcf75646a693eb 100644 (file)
@@ -5,7 +5,7 @@ IN: bootstrap.help
 
 : load-help ( -- )
     "help.lint" require
 
 : load-help ( -- )
     "help.lint" require
-    "tools.vocabs.browser" require
+    "help.vocabs" require
     "alien.syntax" require
     "compiler" require
 
     "alien.syntax" require
     "compiler" require
 
index c6ec7f0b995b159f079348f7cd4df0d9f6e4c9c1..b0afe4a1d9bd0bf01545988b0bdc777a352d61ff 100644 (file)
@@ -14,7 +14,6 @@ IN: bootstrap.tools
     "tools.time"
     "tools.threads"
     "tools.vocabs"
     "tools.time"
     "tools.threads"
     "tools.vocabs"
-    "tools.vocabs.browser"
     "tools.vocabs.monitor"
     "editors"
 } [ require ] each
     "tools.vocabs.monitor"
     "editors"
 } [ require ] each
diff --git a/basis/help/apropos/apropos-docs.factor b/basis/help/apropos/apropos-docs.factor
new file mode 100644 (file)
index 0000000..4d774a7
--- /dev/null
@@ -0,0 +1,8 @@
+IN: help.apropos
+USING: help.markup help.syntax strings help.tips ;
+
+HELP: apropos
+{ $values { "str" string } }
+{ $description "Lists all words, vocabularies and help articles whose name contains a subsequence equal to " { $snippet "str" } ". Results are ranked using a simple distance algorithm." } ;
+
+TIP: "Use " { $link apropos } " to search for words, vocabularies and help articles." ;
\ No newline at end of file
diff --git a/basis/help/apropos/apropos-tests.factor b/basis/help/apropos/apropos-tests.factor
new file mode 100644 (file)
index 0000000..3dbda47
--- /dev/null
@@ -0,0 +1,4 @@
+IN: help.apropos.tests
+USING: help.apropos tools.test ;
+
+[ ] [ "swp" apropos ] unit-test
diff --git a/basis/help/apropos/apropos.factor b/basis/help/apropos/apropos.factor
new file mode 100644 (file)
index 0000000..b241db4
--- /dev/null
@@ -0,0 +1,75 @@
+! Copyright (C) 2008 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: accessors arrays assocs fry help.markup help.topics io
+kernel make math math.parser namespaces sequences sorting
+summary tools.completion tools.vocabs help.vocabs
+vocabs words unicode.case help ;
+IN: help.apropos
+
+: $completions ( seq -- )
+    dup [ word? ] all? [ words-table ] [
+        dup [ vocab-spec? ] all? [
+            $vocabs
+        ] [
+            [ <$pretty-link> 1array ] map $table
+        ] if
+    ] if ;
+
+TUPLE: more-completions seq ;
+
+CONSTANT: max-completions 5
+
+M: more-completions article-title
+    seq>> length number>string " results" append ;
+
+M: more-completions article-name
+    seq>> length max-completions - number>string " more results" append ;
+
+M: more-completions article-content
+    seq>> sort-values keys \ $completions prefix ;
+
+: (apropos) ( str candidates title -- element )
+    [
+        [ completions ] dip '[
+            _ 1array \ $heading prefix ,
+            [ max-completions short head keys \ $completions prefix , ]
+            [ dup length max-completions > [ more-completions boa <$link> , ] [ drop ] if ]
+            bi
+        ] unless-empty
+    ] { } make ;
+
+: word-candidates ( words -- candidates )
+    [ dup name>> >lower ] { } map>assoc ;
+
+: vocab-candidates ( -- candidates )
+    all-vocabs-seq [ dup vocab-name >lower ] { } map>assoc ;
+
+: help-candidates ( seq -- candidates )
+    [ [ >link ] [ article-title >lower ] bi ] { } map>assoc
+    sort-values ;
+
+: $apropos ( str -- )
+    first
+    [ all-words word-candidates "Words" (apropos) ]
+    [ vocab-candidates "Vocabularies" (apropos) ]
+    [ articles get keys help-candidates "Help articles" (apropos) ]
+    tri 3array print-element ;
+
+TUPLE: apropos search ;
+
+C: <apropos> apropos
+
+M: apropos article-title
+    search>> "Search results for “" "”" surround ;
+
+M: apropos article-name article-title ;
+
+M: apropos article-content
+    search>> 1array \ $apropos prefix ;
+
+M: apropos >link ;
+
+INSTANCE: apropos topic
+
+: apropos ( str -- )
+    <apropos> print-topic ;
index e048b66b7c884fea534b8e86608f7e4b743588f8..ed2a14a2f2acf19294ada9ff4b7516a5dda68e92 100644 (file)
@@ -4,7 +4,7 @@ prettyprint.backend prettyprint.custom kernel.private io generic
 math system strings sbufs vectors byte-arrays quotations
 io.streams.byte-array classes.builtin parser lexer
 classes.predicate classes.union classes.intersection
 math system strings sbufs vectors byte-arrays quotations
 io.streams.byte-array classes.builtin parser lexer
 classes.predicate classes.union classes.intersection
-classes.singleton classes.tuple tools.vocabs.browser math.parser
+classes.singleton classes.tuple help.vocabs math.parser
 accessors ;
 IN: help.handbook
 
 accessors ;
 IN: help.handbook
 
@@ -278,11 +278,7 @@ ARTICLE: "handbook-library-reference" "Library reference"
 "This index only includes articles from loaded vocabularies. To explore more vocabularies, see " { $link "vocab-index" } "."
 { $index [ "handbook" orphan-articles remove ] } ;
 
 "This index only includes articles from loaded vocabularies. To explore more vocabularies, see " { $link "vocab-index" } "."
 { $index [ "handbook" orphan-articles remove ] } ;
 
-ARTICLE: "handbook" "Factor documentation"
-"Welcome to Factor."
-$nl
-"Explore the code base:"
-{ $subsection "vocab-index" }
+ARTICLE: "handbook" "Factor handbook"
 "Learn the language:"
 { $subsection "cookbook" }
 { $subsection "first-program" }
 "Learn the language:"
 { $subsection "cookbook" }
 { $subsection "first-program" }
@@ -290,11 +286,13 @@ $nl
 { $subsection "handbook-environment-reference" }
 { $subsection "ui" }
 { $subsection "handbook-library-reference" }
 { $subsection "handbook-environment-reference" }
 { $subsection "ui" }
 { $subsection "handbook-library-reference" }
-"The below indices only include articles from loaded vocabularies. To explore more vocabularies, see " { $link "vocab-index" } "."
+"Explore loaded libraries:"
 { $subsection "article-index" }
 { $subsection "primitive-index" }
 { $subsection "error-index" }
 { $subsection "type-index" }
 { $subsection "article-index" }
 { $subsection "primitive-index" }
 { $subsection "error-index" }
 { $subsection "type-index" }
-{ $subsection "class-index" } ;
+{ $subsection "class-index" }
+"Explore the code base:"
+{ $subsection "vocab-index" } ;
 
 ABOUT: "handbook"
 
 ABOUT: "handbook"
index 733199fc606b97f713a6600ff1ac6cd4b8401c66..547ee871aa74510f06033c48ee5a488f89964ac6 100644 (file)
@@ -127,6 +127,7 @@ ARTICLE: "help" "Help system"
 { $subsection "browsing-help" }
 { $subsection "writing-help" }
 { $subsection "help.lint" }
 { $subsection "browsing-help" }
 { $subsection "writing-help" }
 { $subsection "help.lint" }
+{ $subsection "tips-of-the-day" }
 { $subsection "help-impl" } ;
 
 IN: help
 { $subsection "help-impl" } ;
 
 IN: help
diff --git a/basis/help/home/authors.txt b/basis/help/home/authors.txt
new file mode 100644 (file)
index 0000000..d4f5d6b
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
\ No newline at end of file
diff --git a/basis/help/home/home-docs.factor b/basis/help/home/home-docs.factor
new file mode 100644 (file)
index 0000000..d4d8a62
--- /dev/null
@@ -0,0 +1,19 @@
+IN: help.home
+USING: help.markup help.syntax ;
+
+ARTICLE: "help.home" "Factor documentation"
+{ $heading "Starting points" }
+{ $list
+  { $link "ui-listener" }
+  { $link "handbook" }
+  { $link "vocab-index" }
+}
+{ $heading "Recently visited" }
+{ $table
+  { "Words" "Articles" "Vocabs" }
+  { { $recent recent-words } { $recent recent-articles } { $recent recent-vocabs } }
+} print-element
+{ $heading "Recent searches" }
+{ $recent-searches } ;
+
+ABOUT: "help.home"
\ No newline at end of file
diff --git a/basis/help/home/home.factor b/basis/help/home/home.factor
new file mode 100644 (file)
index 0000000..b1b938c
--- /dev/null
@@ -0,0 +1,40 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: arrays compiler.units fry hashtables help.topics io
+kernel math namespaces sequences sets help.vocabs
+help.apropos vocabs help.markup ;
+IN: help.home
+
+SYMBOLS: recent-words recent-articles recent-vocabs recent-searches ;
+
+CONSTANT: recent-count 10
+
+{ recent-words recent-articles recent-vocabs recent-searches }
+[ [ V{ } clone ] initialize ] each
+
+GENERIC: add-recent-where ( obj -- obj symbol )
+
+M: link add-recent-where recent-articles ;
+M: word-link add-recent-where recent-words ;
+M: vocab-spec add-recent-where recent-vocabs ;
+M: apropos add-recent-where recent-searches ;
+M: object add-recent-where f ;
+
+: $recent ( element -- )
+    first get [ nl ] [ 1array $pretty-link ] interleave ;
+
+: $recent-searches ( element -- )
+    drop recent-searches get [ nl ] [ ($link) ] interleave ;
+
+: redisplay-recent-page ( -- )
+    "help.home" >link dup associate
+    notify-definition-observers ;
+
+: expire ( seq -- )
+    [ length recent-count - [ 0 > ] keep ] keep
+    '[ 0 _ _ delete-slice ] when ;
+
+: add-recent ( obj -- )
+    add-recent-where dup
+    [ get [ adjoin ] [ expire ] bi ] [ 2drop ] if
+    redisplay-recent-page ;
\ No newline at end of file
index cbeb8b362e26e423a7bd9677c27ded830003bec1..66d864b2a04a6e852b40156c85bf189811c34c16 100644 (file)
@@ -3,7 +3,7 @@
 USING: io.encodings.utf8 io.encodings.ascii io.encodings.binary
 io.files io.files.temp io.directories html.streams help kernel
 assocs sequences make words accessors arrays help.topics vocabs
 USING: io.encodings.utf8 io.encodings.ascii io.encodings.binary
 io.files io.files.temp io.directories html.streams help kernel
 assocs sequences make words accessors arrays help.topics vocabs
-tools.vocabs tools.vocabs.browser namespaces prettyprint io
+tools.vocabs help.vocabs namespaces prettyprint io
 vocabs.loader serialize fry memoize unicode.case math.order
 sorting debugger html xml.syntax xml.writer ;
 IN: help.html
 vocabs.loader serialize fry memoize unicode.case math.order
 sorting debugger html xml.syntax xml.writer ;
 IN: help.html
diff --git a/basis/help/tips/authors.txt b/basis/help/tips/authors.txt
new file mode 100644 (file)
index 0000000..d4f5d6b
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
\ No newline at end of file
diff --git a/basis/help/tips/tips-docs.factor b/basis/help/tips/tips-docs.factor
new file mode 100644 (file)
index 0000000..7148b25
--- /dev/null
@@ -0,0 +1,27 @@
+IN: help.tips
+USING: help.markup help.syntax debugger ;
+
+TIP: "To look at the most recent error, run " { $link :error } ". To look at the most recent error's callstack, run " { $link :c } "." ;
+
+TIP: "Learn to use " { $link "dataflow-combinators" } "." ;
+
+TIP: "Learn to use " { $link "editor" } " to be able to jump to the source code for word definitions from the listener." ;
+
+TIP: "Check out " { $url "http://concatenative.org/wiki/view/Factor/FAQ" } " to get answers to frequently-asked questions." ;
+
+TIP: "Drop by the " { $snippet "#concatenative" } " IRC channel on " { $snippet "irc.freenode.net" } " some time." ;
+
+TIP: "You can write documentation for your own code using the " { $link "help" } "." ;
+
+TIP: "You can write graphical applications using the " { $link "ui" } "." ;
+
+ARTICLE: "all-tips-of-the-day" "All tips of the day"
+{ $tips-of-the-day } ;
+
+ARTICLE: "tips-of-the-day" "Tips of the day"
+"The " { $vocab-link "help.tips" } " vocabulary provides a facility for displaying tips of the day in the " { $link "ui-listener" } ". Tips are defined with a parsing word:"
+{ $subsection POSTPONE: TIP: }
+"All tips defined so far:"
+{ $subsection "all-tips-of-the-day" } ;
+
+ABOUT: "tips-of-the-day"
\ No newline at end of file
diff --git a/basis/help/tips/tips.factor b/basis/help/tips/tips.factor
new file mode 100644 (file)
index 0000000..8d173ce
--- /dev/null
@@ -0,0 +1,38 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: parser arrays namespaces sequences random help.markup kernel io
+io.styles colors.constants ;
+IN: help.tips
+
+SYMBOL: tips
+
+tips [ V{ } clone ] initialize
+
+SYNTAX: TIP: parse-definition >array tips get push ;
+
+: a-tip ( -- tip ) tips get random ;
+
+SYMBOL: tip-of-the-day-style
+
+H{
+    { page-color COLOR: lavender }
+    { border-width 5 }
+    { wrap-margin 500 }
+} tip-of-the-day-style set-global
+
+: $tip-of-the-day ( element -- )
+    drop
+    [
+        tip-of-the-day-style get
+        [
+            last-element off
+            "Tip of the day" $heading a-tip print-element nl
+            "— " print-element "all-tips-of-the-day" ($link)
+        ]
+        with-nesting
+    ] ($heading) ;
+
+: tip-of-the-day. ( -- ) { $tip-of-the-day } print-content nl ;
+
+: $tips-of-the-day ( element -- )
+    drop tips get [ nl nl ] [ print-element ] interleave ;
\ No newline at end of file
diff --git a/basis/help/vocabs/authors.txt b/basis/help/vocabs/authors.txt
new file mode 100755 (executable)
index 0000000..e1907c6
--- /dev/null
@@ -0,0 +1,2 @@
+Slava Pestov
+Eduardo Cavazos
diff --git a/basis/help/vocabs/summary.txt b/basis/help/vocabs/summary.txt
new file mode 100644 (file)
index 0000000..28b4850
--- /dev/null
@@ -0,0 +1 @@
+Browsing vocabularies
diff --git a/basis/help/vocabs/tags.txt b/basis/help/vocabs/tags.txt
new file mode 100644 (file)
index 0000000..ef1aab0
--- /dev/null
@@ -0,0 +1 @@
+tools
diff --git a/basis/help/vocabs/vocabs-docs.factor b/basis/help/vocabs/vocabs-docs.factor
new file mode 100644 (file)
index 0000000..5f1a972
--- /dev/null
@@ -0,0 +1,17 @@
+USING: help.markup help.syntax io strings ;
+IN: help.vocabs
+
+ARTICLE: "vocab-tags" "Vocabulary tags"
+{ $all-tags } ;
+
+ARTICLE: "vocab-authors" "Vocabulary authors"
+{ $all-authors } ;
+
+ARTICLE: "vocab-index" "Vocabulary index"
+{ $subsection "vocab-tags" }
+{ $subsection "vocab-authors" }
+{ $vocab "" } ;
+
+HELP: words.
+{ $values { "vocab" "a vocabulary name" } }
+{ $description "Printings a listing of all the words in a vocabulary, categorized by type." } ;
diff --git a/basis/help/vocabs/vocabs-tests.factor b/basis/help/vocabs/vocabs-tests.factor
new file mode 100644 (file)
index 0000000..f03e0b3
--- /dev/null
@@ -0,0 +1,5 @@
+IN: help.vocabs.tests
+USING: help.vocabs tools.test help.markup help vocabs ;
+
+[ ] [ { $vocab "scratchpad" } print-content ] unit-test
+[ ] [ "classes" vocab print-topic ] unit-test
\ No newline at end of file
diff --git a/basis/help/vocabs/vocabs.factor b/basis/help/vocabs/vocabs.factor
new file mode 100644 (file)
index 0000000..13bb0cd
--- /dev/null
@@ -0,0 +1,305 @@
+! Copyright (C) 2007, 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: accessors arrays assocs classes classes.builtin
+classes.intersection classes.mixin classes.predicate
+classes.singleton classes.tuple classes.union combinators
+definitions effects fry generic help help.markup help.stylesheet
+help.topics io io.files io.pathnames io.styles kernel macros
+make namespaces prettyprint sequences sets sorting summary
+tools.vocabs vocabs vocabs.loader words words.symbol definitions.icons ;
+IN: help.vocabs
+
+: $pretty-link ( element -- )
+    [ first definition-icon 1array $image " " print-element ]
+    [ $definition-link ]
+    bi ;
+
+: <$pretty-link> ( definition -- element )
+    1array \ $pretty-link prefix ;
+
+: vocab-row ( vocab -- row )
+    [ <$pretty-link> ] [ vocab-summary ] bi 2array ;
+
+: vocab-headings ( -- headings )
+    {
+        { $strong "Vocabulary" }
+        { $strong "Summary" }
+    } ;
+
+: root-heading ( root -- )
+    [ "Children from " prepend ] [ "Children" ] if*
+    $heading ;
+
+: $vocabs ( seq -- )
+    [ vocab-row ] map vocab-headings prefix $table ;
+
+: $vocab-roots ( assoc -- )
+    [
+        [ drop ] [ [ root-heading ] [ $vocabs ] bi* ] if-empty
+    ] assoc-each ;
+
+TUPLE: vocab-tag name ;
+
+INSTANCE: vocab-tag topic
+
+C: <vocab-tag> vocab-tag
+
+: $tags ( seq -- ) [ <vocab-tag> ] map $links ;
+
+TUPLE: vocab-author name ;
+
+INSTANCE: vocab-author topic
+
+C: <vocab-author> vocab-author
+
+: $authors ( seq -- ) [ <vocab-author> ] map $links ;
+
+: describe-help ( vocab -- )
+    [
+        dup vocab-help
+        [ "Documentation" $heading ($link) ]
+        [ "Summary" $heading vocab-summary print-element ]
+        ?if
+    ] unless-empty ;
+
+: describe-children ( vocab -- )
+    vocab-name all-child-vocabs $vocab-roots ;
+
+: files. ( seq -- )
+    snippet-style get [
+        code-style get [
+            [ nl ] [ [ string>> ] keep write-object ] interleave
+        ] with-nesting
+    ] with-style ;
+
+: describe-files ( vocab -- )
+    vocab-files [ <pathname> ] map [
+        "Files" $heading
+        [
+            files.
+        ] ($block)
+    ] unless-empty ;
+
+: describe-tuple-classes ( classes -- )
+    [
+        "Tuple classes" $subheading
+        [
+            [ <$pretty-link> ]
+            [ superclass <$pretty-link> ]
+            [ "slots" word-prop [ name>> ] map " " join <$snippet> ]
+            tri 3array
+        ] map
+        { { $strong "Class" } { $strong "Superclass" } { $strong "Slots" } } prefix
+        $table
+    ] unless-empty ;
+
+: describe-predicate-classes ( classes -- )
+    [
+        "Predicate classes" $subheading
+        [
+            [ <$pretty-link> ]
+            [ superclass <$pretty-link> ]
+            bi 2array
+        ] map
+        { { $strong "Class" } { $strong "Superclass" } } prefix
+        $table
+    ] unless-empty ;
+
+: (describe-classes) ( classes heading -- )
+    '[
+        _ $subheading
+        [ <$pretty-link> 1array ] map $table
+    ] unless-empty ;
+
+: describe-builtin-classes ( classes -- )
+    "Builtin classes" (describe-classes) ;
+
+: describe-singleton-classes ( classes -- )
+    "Singleton classes" (describe-classes) ;
+
+: describe-mixin-classes ( classes -- )
+    "Mixin classes" (describe-classes) ;
+
+: describe-union-classes ( classes -- )
+    "Union classes" (describe-classes) ;
+
+: describe-intersection-classes ( classes -- )
+    "Intersection classes" (describe-classes) ;
+
+: describe-classes ( classes -- )
+    [ builtin-class? ] partition
+    [ tuple-class? ] partition
+    [ singleton-class? ] partition
+    [ predicate-class? ] partition
+    [ mixin-class? ] partition
+    [ union-class? ] partition
+    [ intersection-class? ] filter
+    {
+        [ describe-builtin-classes ]
+        [ describe-tuple-classes ]
+        [ describe-singleton-classes ]
+        [ describe-predicate-classes ]
+        [ describe-mixin-classes ]
+        [ describe-union-classes ]
+        [ describe-intersection-classes ]
+    } spread ;
+
+: word-syntax ( word -- string/f )
+    \ $syntax swap word-help elements dup length 1 =
+    [ first second ] [ drop f ] if ;
+
+: describe-parsing ( words -- )
+    [
+        "Parsing words" $subheading
+        [
+            [ <$pretty-link> ]
+            [ word-syntax dup [ <$snippet> ] when ]
+            bi 2array
+        ] map
+        { { $strong "Word" } { $strong "Syntax" } } prefix
+        $table
+    ] unless-empty ;
+
+: word-row ( word -- element )
+    [ <$pretty-link> ]
+    [ stack-effect dup [ effect>string <$snippet> ] when ]
+    bi 2array ;
+
+: word-headings ( -- element )
+    { { $strong "Word" } { $strong "Stack effect" } } ;
+
+: words-table ( words -- )
+    [ word-row ] map word-headings prefix $table ;
+
+: (describe-words) ( words heading -- )
+    '[ _ $subheading words-table ] unless-empty ;
+
+: describe-generics ( words -- )
+    "Generic words" (describe-words) ;
+
+: describe-macros ( words -- )
+    "Macro words" (describe-words) ;
+
+: describe-primitives ( words -- )
+    "Primitives" (describe-words) ;
+
+: describe-compounds ( words -- )
+    "Ordinary words" (describe-words) ;
+
+: describe-predicates ( words -- )
+    "Class predicate words" (describe-words) ;
+
+: describe-symbols ( words -- )
+    [
+        "Symbol words" $subheading
+        [ <$pretty-link> 1array ] map $table
+    ] unless-empty ;
+
+: $words ( words -- )
+    [
+        "Words" $heading
+
+        natural-sort
+        [ [ class? ] filter describe-classes ]
+        [
+            [ [ class? ] [ symbol? ] bi and not ] filter
+            [ parsing-word? ] partition
+            [ generic? ] partition
+            [ macro? ] partition
+            [ symbol? ] partition
+            [ primitive? ] partition
+            [ predicate? ] partition swap
+            {
+                [ describe-parsing ]
+                [ describe-generics ]
+                [ describe-macros ]
+                [ describe-symbols ]
+                [ describe-primitives ]
+                [ describe-compounds ]
+                [ describe-predicates ]
+            } spread
+        ] bi
+    ] unless-empty ;
+
+: words. ( vocab -- )
+    last-element off
+    [ require ] [ words $words ] bi nl ;
+
+: describe-metadata ( vocab -- )
+    [
+        [ vocab-tags [ "Tags:" swap \ $tags prefix 2array , ] unless-empty ]
+        [ vocab-authors [ "Authors:" swap \ $authors prefix 2array , ] unless-empty ]
+        bi
+    ] { } make
+    [ "Meta-data" $heading $table ] unless-empty ;
+
+: $vocab ( element -- )
+    first {
+        [ describe-help ]
+        [ describe-metadata ]
+        [ words $words ]
+        [ describe-files ]
+        [ describe-children ]
+    } cleave ;
+
+: keyed-vocabs ( str quot -- seq )
+    [ all-vocabs ] 2dip '[ [ _ swap @ member? ] filter ] assoc-map ; inline
+
+: tagged ( tag -- assoc )
+    [ vocab-tags ] keyed-vocabs ;
+
+: authored ( author -- assoc )
+    [ vocab-authors ] keyed-vocabs ;
+
+: $tagged-vocabs ( element -- )
+    first tagged $vocab-roots ;
+
+: $authored-vocabs ( element -- )
+    first authored $vocab-roots ;
+
+: $all-tags ( element -- )
+    drop "Tags" $heading all-tags $tags ;
+
+: $all-authors ( element -- )
+    drop "Authors" $heading all-authors $authors ;
+
+INSTANCE: vocab topic
+
+INSTANCE: vocab-link topic
+
+M: vocab-spec article-title vocab-name " vocabulary" append ;
+
+M: vocab-spec article-name vocab-name ;
+
+M: vocab-spec article-content
+    vocab-name \ $vocab swap 2array ;
+
+M: vocab-spec article-parent drop "vocab-index" ;
+
+M: vocab-tag >link ;
+
+M: vocab-tag article-title
+    name>> "Vocabularies tagged “" "”" surround ;
+
+M: vocab-tag article-name name>> ;
+
+M: vocab-tag article-content
+    \ $tagged-vocabs swap name>> 2array ;
+
+M: vocab-tag article-parent drop "vocab-tags" ;
+
+M: vocab-tag summary article-title ;
+
+M: vocab-author >link ;
+
+M: vocab-author article-title
+    name>> "Vocabularies by " prepend ;
+
+M: vocab-author article-name name>> ;
+
+M: vocab-author article-content
+    \ $authored-vocabs swap name>> 2array ;
+
+M: vocab-author article-parent drop "vocab-authors" ;
+
+M: vocab-author summary article-title ;
diff --git a/basis/tools/apropos/apropos-docs.factor b/basis/tools/apropos/apropos-docs.factor
deleted file mode 100644 (file)
index b50b51b..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-IN: tools.apropos
-USING: help.markup help.syntax strings ;
-
-HELP: apropos
-{ $values { "str" string } }
-{ $description "Lists all words, vocabularies and help articles whose name contains a subsequence equal to " { $snippet "str" } ". Results are ranked using a simple distance algorithm." } ;
diff --git a/basis/tools/apropos/apropos-tests.factor b/basis/tools/apropos/apropos-tests.factor
deleted file mode 100644 (file)
index 96ce9d3..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-IN: tools.apropos.tests
-USING: tools.apropos tools.test ;
-
-[ ] [ "swp" apropos ] unit-test
diff --git a/basis/tools/apropos/apropos.factor b/basis/tools/apropos/apropos.factor
deleted file mode 100644 (file)
index c7126c1..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-! Copyright (C) 2008 Slava Pestov.
-! See http://factorcode.org/license.txt for BSD license.
-USING: accessors arrays assocs fry help.markup help.topics io
-kernel make math math.parser namespaces sequences sorting
-summary tools.completion tools.vocabs tools.vocabs.browser
-vocabs words unicode.case help ;
-IN: tools.apropos
-
-: $completions ( seq -- )
-    dup [ word? ] all? [ words-table ] [
-        dup [ vocab-spec? ] all? [
-            $vocabs
-        ] [
-            [ <$pretty-link> 1array ] map $table
-        ] if
-    ] if ;
-
-TUPLE: more-completions seq ;
-
-CONSTANT: max-completions 5
-
-M: more-completions article-title
-    seq>> length number>string " results" append ;
-
-M: more-completions article-name
-    seq>> length max-completions - number>string " more results" append ;
-
-M: more-completions article-content
-    seq>> sort-values keys \ $completions prefix ;
-
-: (apropos) ( str candidates title -- element )
-    [
-        [ completions ] dip '[
-            _ 1array \ $heading prefix ,
-            [ max-completions short head keys \ $completions prefix , ]
-            [ dup length max-completions > [ more-completions boa <$link> , ] [ drop ] if ]
-            bi
-        ] unless-empty
-    ] { } make ;
-
-: word-candidates ( words -- candidates )
-    [ dup name>> >lower ] { } map>assoc ;
-
-: vocab-candidates ( -- candidates )
-    all-vocabs-seq [ dup vocab-name >lower ] { } map>assoc ;
-
-: help-candidates ( seq -- candidates )
-    [ [ >link ] [ article-title >lower ] bi ] { } map>assoc
-    sort-values ;
-
-: $apropos ( str -- )
-    first
-    [ all-words word-candidates "Words" (apropos) ]
-    [ vocab-candidates "Vocabularies" (apropos) ]
-    [ articles get keys help-candidates "Help articles" (apropos) ]
-    tri 3array print-element ;
-
-TUPLE: apropos search ;
-
-C: <apropos> apropos
-
-M: apropos article-title
-    search>> "Search results for “" "”" surround ;
-
-M: apropos article-name article-title ;
-
-M: apropos article-content
-    search>> 1array \ $apropos prefix ;
-
-: apropos ( str -- )
-    <apropos> print-topic ;
diff --git a/basis/tools/vocabs/browser/authors.txt b/basis/tools/vocabs/browser/authors.txt
deleted file mode 100755 (executable)
index e1907c6..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-Slava Pestov
-Eduardo Cavazos
diff --git a/basis/tools/vocabs/browser/browser-docs.factor b/basis/tools/vocabs/browser/browser-docs.factor
deleted file mode 100644 (file)
index 723c4ac..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-USING: help.markup help.syntax io strings ;
-IN: tools.vocabs.browser
-
-ARTICLE: "vocab-tags" "Vocabulary tags"
-{ $all-tags } ;
-
-ARTICLE: "vocab-authors" "Vocabulary authors"
-{ $all-authors } ;
-
-ARTICLE: "vocab-index" "Vocabulary index"
-{ $subsection "vocab-tags" }
-{ $subsection "vocab-authors" }
-{ $vocab "" } ;
-
-HELP: words.
-{ $values { "vocab" "a vocabulary name" } }
-{ $description "Printings a listing of all the words in a vocabulary, categorized by type." } ;
diff --git a/basis/tools/vocabs/browser/browser-tests.factor b/basis/tools/vocabs/browser/browser-tests.factor
deleted file mode 100644 (file)
index 385d1b2..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-IN: tools.vocabs.browser.tests
-USING: tools.vocabs.browser tools.test help.markup help vocabs ;
-
-[ ] [ { $vocab "scratchpad" } print-content ] unit-test
-[ ] [ "classes" vocab print-topic ] unit-test
\ No newline at end of file
diff --git a/basis/tools/vocabs/browser/browser.factor b/basis/tools/vocabs/browser/browser.factor
deleted file mode 100644 (file)
index c9ade7a..0000000
+++ /dev/null
@@ -1,306 +0,0 @@
-! Copyright (C) 2007, 2009 Slava Pestov.
-! See http://factorcode.org/license.txt for BSD license.
-USING: accessors arrays assocs classes classes.builtin
-classes.intersection classes.mixin classes.predicate
-classes.singleton classes.tuple classes.union combinators
-definitions effects fry generic help help.markup help.stylesheet
-help.topics io io.files io.pathnames io.styles kernel macros
-make namespaces prettyprint sequences sets sorting summary
-tools.vocabs vocabs vocabs.loader words words.symbol
-combinators.smart definitions.icons ;
-IN: tools.vocabs.browser
-
-: <$pretty-link> ( definition -- element )
-    [
-        [ definition-icon 1array \ $image prefix ]
-        [ drop " " ]
-        [ 1array \ $definition-link prefix ]
-        tri
-    ] output>array ;
-
-: vocab-row ( vocab -- row )
-    [ <$pretty-link> ] [ vocab-summary ] bi 2array ;
-
-: vocab-headings ( -- headings )
-    {
-        { $strong "Vocabulary" }
-        { $strong "Summary" }
-    } ;
-
-: root-heading ( root -- )
-    [ "Children from " prepend ] [ "Children" ] if*
-    $heading ;
-
-: $vocabs ( seq -- )
-    [ vocab-row ] map vocab-headings prefix $table ;
-
-: $vocab-roots ( assoc -- )
-    [
-        [ drop ] [ [ root-heading ] [ $vocabs ] bi* ] if-empty
-    ] assoc-each ;
-
-TUPLE: vocab-tag name ;
-
-INSTANCE: vocab-tag topic
-
-C: <vocab-tag> vocab-tag
-
-: $tags ( seq -- ) [ <vocab-tag> ] map $links ;
-
-TUPLE: vocab-author name ;
-
-INSTANCE: vocab-author topic
-
-C: <vocab-author> vocab-author
-
-: $authors ( seq -- ) [ <vocab-author> ] map $links ;
-
-: describe-help ( vocab -- )
-    [
-        dup vocab-help
-        [ "Documentation" $heading ($link) ]
-        [ "Summary" $heading vocab-summary print-element ]
-        ?if
-    ] unless-empty ;
-
-: describe-children ( vocab -- )
-    vocab-name all-child-vocabs $vocab-roots ;
-
-: files. ( seq -- )
-    snippet-style get [
-        code-style get [
-            [ nl ] [ [ string>> ] keep write-object ] interleave
-        ] with-nesting
-    ] with-style ;
-
-: describe-files ( vocab -- )
-    vocab-files [ <pathname> ] map [
-        "Files" $heading
-        [
-            files.
-        ] ($block)
-    ] unless-empty ;
-
-: describe-tuple-classes ( classes -- )
-    [
-        "Tuple classes" $subheading
-        [
-            [ <$pretty-link> ]
-            [ superclass <$pretty-link> ]
-            [ "slots" word-prop [ name>> ] map " " join <$snippet> ]
-            tri 3array
-        ] map
-        { { $strong "Class" } { $strong "Superclass" } { $strong "Slots" } } prefix
-        $table
-    ] unless-empty ;
-
-: describe-predicate-classes ( classes -- )
-    [
-        "Predicate classes" $subheading
-        [
-            [ <$pretty-link> ]
-            [ superclass <$pretty-link> ]
-            bi 2array
-        ] map
-        { { $strong "Class" } { $strong "Superclass" } } prefix
-        $table
-    ] unless-empty ;
-
-: (describe-classes) ( classes heading -- )
-    '[
-        _ $subheading
-        [ <$pretty-link> 1array ] map $table
-    ] unless-empty ;
-
-: describe-builtin-classes ( classes -- )
-    "Builtin classes" (describe-classes) ;
-
-: describe-singleton-classes ( classes -- )
-    "Singleton classes" (describe-classes) ;
-
-: describe-mixin-classes ( classes -- )
-    "Mixin classes" (describe-classes) ;
-
-: describe-union-classes ( classes -- )
-    "Union classes" (describe-classes) ;
-
-: describe-intersection-classes ( classes -- )
-    "Intersection classes" (describe-classes) ;
-
-: describe-classes ( classes -- )
-    [ builtin-class? ] partition
-    [ tuple-class? ] partition
-    [ singleton-class? ] partition
-    [ predicate-class? ] partition
-    [ mixin-class? ] partition
-    [ union-class? ] partition
-    [ intersection-class? ] filter
-    {
-        [ describe-builtin-classes ]
-        [ describe-tuple-classes ]
-        [ describe-singleton-classes ]
-        [ describe-predicate-classes ]
-        [ describe-mixin-classes ]
-        [ describe-union-classes ]
-        [ describe-intersection-classes ]
-    } spread ;
-
-: word-syntax ( word -- string/f )
-    \ $syntax swap word-help elements dup length 1 =
-    [ first second ] [ drop f ] if ;
-
-: describe-parsing ( words -- )
-    [
-        "Parsing words" $subheading
-        [
-            [ <$pretty-link> ]
-            [ word-syntax dup [ <$snippet> ] when ]
-            bi 2array
-        ] map
-        { { $strong "Word" } { $strong "Syntax" } } prefix
-        $table
-    ] unless-empty ;
-
-: word-row ( word -- element )
-    [ <$pretty-link> ]
-    [ stack-effect dup [ effect>string <$snippet> ] when ]
-    bi 2array ;
-
-: word-headings ( -- element )
-    { { $strong "Word" } { $strong "Stack effect" } } ;
-
-: words-table ( words -- )
-    [ word-row ] map word-headings prefix $table ;
-
-: (describe-words) ( words heading -- )
-    '[ _ $subheading words-table ] unless-empty ;
-
-: describe-generics ( words -- )
-    "Generic words" (describe-words) ;
-
-: describe-macros ( words -- )
-    "Macro words" (describe-words) ;
-
-: describe-primitives ( words -- )
-    "Primitives" (describe-words) ;
-
-: describe-compounds ( words -- )
-    "Ordinary words" (describe-words) ;
-
-: describe-predicates ( words -- )
-    "Class predicate words" (describe-words) ;
-
-: describe-symbols ( words -- )
-    [
-        "Symbol words" $subheading
-        [ <$pretty-link> 1array ] map $table
-    ] unless-empty ;
-
-: $words ( words -- )
-    [
-        "Words" $heading
-
-        natural-sort
-        [ [ class? ] filter describe-classes ]
-        [
-            [ [ class? ] [ symbol? ] bi and not ] filter
-            [ parsing-word? ] partition
-            [ generic? ] partition
-            [ macro? ] partition
-            [ symbol? ] partition
-            [ primitive? ] partition
-            [ predicate? ] partition swap
-            {
-                [ describe-parsing ]
-                [ describe-generics ]
-                [ describe-macros ]
-                [ describe-symbols ]
-                [ describe-primitives ]
-                [ describe-compounds ]
-                [ describe-predicates ]
-            } spread
-        ] bi
-    ] unless-empty ;
-
-: words. ( vocab -- )
-    last-element off
-    [ require ] [ words $words ] bi nl ;
-
-: describe-metadata ( vocab -- )
-    [
-        [ vocab-tags [ "Tags:" swap \ $tags prefix 2array , ] unless-empty ]
-        [ vocab-authors [ "Authors:" swap \ $authors prefix 2array , ] unless-empty ]
-        bi
-    ] { } make
-    [ "Meta-data" $heading $table ] unless-empty ;
-
-: $vocab ( element -- )
-    first {
-        [ describe-help ]
-        [ describe-metadata ]
-        [ words $words ]
-        [ describe-files ]
-        [ describe-children ]
-    } cleave ;
-
-: keyed-vocabs ( str quot -- seq )
-    [ all-vocabs ] 2dip '[ [ _ swap @ member? ] filter ] assoc-map ; inline
-
-: tagged ( tag -- assoc )
-    [ vocab-tags ] keyed-vocabs ;
-
-: authored ( author -- assoc )
-    [ vocab-authors ] keyed-vocabs ;
-
-: $tagged-vocabs ( element -- )
-    first tagged $vocab-roots ;
-
-: $authored-vocabs ( element -- )
-    first authored $vocab-roots ;
-
-: $all-tags ( element -- )
-    drop "Tags" $heading all-tags $tags ;
-
-: $all-authors ( element -- )
-    drop "Authors" $heading all-authors $authors ;
-
-INSTANCE: vocab topic
-
-INSTANCE: vocab-link topic
-
-M: vocab-spec article-title vocab-name " vocabulary" append ;
-
-M: vocab-spec article-name vocab-name ;
-
-M: vocab-spec article-content
-    vocab-name \ $vocab swap 2array ;
-
-M: vocab-spec article-parent drop "vocab-index" ;
-
-M: vocab-tag >link ;
-
-M: vocab-tag article-title
-    name>> "Vocabularies tagged “" "”" surround ;
-
-M: vocab-tag article-name name>> ;
-
-M: vocab-tag article-content
-    \ $tagged-vocabs swap name>> 2array ;
-
-M: vocab-tag article-parent drop "vocab-tags" ;
-
-M: vocab-tag summary article-title ;
-
-M: vocab-author >link ;
-
-M: vocab-author article-title
-    name>> "Vocabularies by " prepend ;
-
-M: vocab-author article-name name>> ;
-
-M: vocab-author article-content
-    \ $authored-vocabs swap name>> 2array ;
-
-M: vocab-author article-parent drop "vocab-authors" ;
-
-M: vocab-author summary article-title ;
diff --git a/basis/tools/vocabs/browser/summary.txt b/basis/tools/vocabs/browser/summary.txt
deleted file mode 100644 (file)
index 28b4850..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Browsing vocabularies
diff --git a/basis/tools/vocabs/browser/tags.txt b/basis/tools/vocabs/browser/tags.txt
deleted file mode 100644 (file)
index ef1aab0..0000000
+++ /dev/null
@@ -1 +0,0 @@
-tools
index 244e36d640753103be747f9491dfe1443708a288..0ad37cb10f8b0bfeb6ad80b90805b33c88637daf 100644 (file)
@@ -1,6 +1,6 @@
 USING: documents help.markup help.syntax ui.gadgets
 ui.gadgets.scrollers models strings ui.commands
 USING: documents help.markup help.syntax ui.gadgets
 ui.gadgets.scrollers models strings ui.commands
-ui.text colors fonts ;
+ui.text colors fonts help.tips ;
 IN: ui.gadgets.editors
 
 HELP: editor
 IN: ui.gadgets.editors
 
 HELP: editor
@@ -109,4 +109,8 @@ ARTICLE: "ui.gadgets.editors" "Editor gadgets"
 "Editors edit " { $emphasis "documents" } ":"
 { $subsection "documents" } ;
 
 "Editors edit " { $emphasis "documents" } ":"
 { $subsection "documents" } ;
 
+TIP: "Editor gadgets support undo and redo; press " { $command editor "editing" com-undo } " and " { $command editor "editing" com-redo } "." ;
+
+TIP: "Learn the keyboard shortcuts used in " { $link "ui.gadgets.editors" } "." ;
+
 ABOUT: "ui.gadgets.editors"
 ABOUT: "ui.gadgets.editors"
index 078ece6546ecc6d82b31f7fe1b696ba865a90ac8..e1dcba99109c85dc8d0ad9ea066e9242f98e9b30 100644 (file)
@@ -1,10 +1,11 @@
 ! Copyright (C) 2006, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 ! Copyright (C) 2006, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: debugger help help.topics help.crossref kernel models compiler.units
-assocs words vocabs accessors fry combinators.short-circuit
-sequences models models.history tools.apropos combinators
-ui.commands ui.gadgets ui.gadgets.panes ui.gadgets.scrollers
-ui.gadgets.tracks ui.gestures ui.gadgets.buttons ui.gadgets.packs
+USING: debugger help help.topics help.crossref help.home kernel
+models compiler.units assocs words vocabs accessors fry
+combinators.short-circuit namespaces sequences models
+models.history help.apropos combinators ui.commands ui.gadgets
+ui.gadgets.panes ui.gadgets.scrollers ui.gadgets.tracks
+ui.gestures ui.gadgets.buttons ui.gadgets.packs
 ui.gadgets.editors ui.gadgets.labels ui.gadgets.status-bar
 ui.gadgets.glass ui.gadgets.borders ui.tools.common
 ui.tools.browser.popups ui ;
 ui.gadgets.editors ui.gadgets.labels ui.gadgets.status-bar
 ui.gadgets.glass ui.gadgets.borders ui.tools.common
 ui.tools.browser.popups ui ;
@@ -15,8 +16,8 @@ TUPLE: browser-gadget < tool pane scroller search-field popup ;
 { 650 400 } browser-gadget set-tool-dim
 
 : show-help ( link browser-gadget -- )
 { 650 400 } browser-gadget set-tool-dim
 
 : show-help ( link browser-gadget -- )
-    model>> dup add-history
-    [ >link ] dip set-model ;
+    [ >link ] [ model>> ] bi*
+    [ [ add-recent ] [ add-history ] bi* ] [ set-model ] 2bi ;
 
 : <help-pane> ( browser-gadget -- gadget )
     model>> [ '[ _ print-topic ] try ] <pane-control> ;
 
 : <help-pane> ( browser-gadget -- gadget )
     model>> [ '[ _ print-topic ] try ] <pane-control> ;
@@ -96,7 +97,7 @@ M: browser-gadget focusable-child* search-field>> ;
 
 : com-forward ( browser -- ) model>> go-forward ;
 
 
 : com-forward ( browser -- ) model>> go-forward ;
 
-: com-documentation ( browser -- ) "handbook" swap show-help ;
+: com-documentation ( browser -- ) "help.home" swap show-help ;
 
 : browser-help ( -- ) "ui-browser" com-browse ;
 
 
 : browser-help ( -- ) "ui-browser" com-browse ;
 
@@ -113,7 +114,7 @@ browser-gadget "toolbar" f {
     over [ show-help ] [ 2drop ] if ;
 
 : navigate ( browser quot -- )
     over [ show-help ] [ 2drop ] if ;
 
 : navigate ( browser quot -- )
-    '[ control-value @ ] keep ?show-help ;
+    '[ control-value @ ] keep ?show-help ; inline
 
 : com-up ( browser -- ) [ article-parent ] navigate ;
 
 
 : com-up ( browser -- ) [ article-parent ] navigate ;
 
index e625d26c60fd6d7107572492fdafd1b48d5df7ad..b0a2fb6cf96eeba9cc6a9922616d8c88df71dbfa 100644 (file)
@@ -1,4 +1,4 @@
-USING: help.markup help.syntax ;
+USING: help.markup help.syntax help.tips ;
 IN: ui.tools.deploy
 
 HELP: deploy-tool
 IN: ui.tools.deploy
 
 HELP: deploy-tool
@@ -14,4 +14,6 @@ $nl
 "Alternatively, right-click on a vocabulary presentation in the UI and choose " { $strong "Deploy tool" } " from the resulting popup menu."
 { $see-also "tools.deploy" } ;
 
 "Alternatively, right-click on a vocabulary presentation in the UI and choose " { $strong "Deploy tool" } " from the resulting popup menu."
 { $see-also "tools.deploy" } ;
 
+TIP: "Generate stand-alone applications from vocabularies with the " { $link "ui.tools.deploy" } "." ;
+
 ABOUT: "ui.tools.deploy"
 ABOUT: "ui.tools.deploy"
index 0f357cb0afb0c94c32aa299a62a1ffe1dbec5706..022a2daabfc61d4a893aba29c90080ca7348b193 100644 (file)
@@ -3,7 +3,7 @@
 USING: accessors arrays assocs calendar colors colors.constants
 documents documents.elements fry kernel words sets splitting math
 math.vectors models.delay models.arrow combinators.short-circuit
 USING: accessors arrays assocs calendar colors colors.constants
 documents documents.elements fry kernel words sets splitting math
 math.vectors models.delay models.arrow combinators.short-circuit
-parser present sequences tools.completion tools.vocabs.browser generic
+parser present sequences tools.completion help.vocabs generic
 generic.standard.engines.tuple fonts definitions.icons ui.images
 ui.commands ui.operations ui.gadgets ui.gadgets.editors
 ui.gadgets.glass ui.gadgets.scrollers ui.gadgets.tables
 generic.standard.engines.tuple fonts definitions.icons ui.images
 ui.commands ui.operations ui.gadgets ui.gadgets.editors
 ui.gadgets.glass ui.gadgets.scrollers ui.gadgets.tables
index caff45e40ed3c22e992e48ffe74dbd2b278e2062..afe890b9c5264cc997792c243e8a39bca9d3a206 100644 (file)
@@ -1,5 +1,7 @@
 USING: help.markup help.syntax ui.commands ui.operations
 USING: help.markup help.syntax ui.commands ui.operations
-ui.gadgets.editors ui.gadgets.panes listener io words ;
+ui.gadgets.editors ui.gadgets.panes listener io words
+ui.tools.listener.completion ui.tools.common help.tips
+tools.vocabs vocabs ;
 IN: ui.tools.listener
 
 HELP: interactor
 IN: ui.tools.listener
 
 HELP: interactor
@@ -21,11 +23,27 @@ ARTICLE: "ui-listener" "UI listener"
 { $operations \ word }
 { $heading "Vocabulary commands" }
 "These words operate on the vocabulary at the cursor."
 { $operations \ word }
 { $heading "Vocabulary commands" }
 "These words operate on the vocabulary at the cursor."
-{ $operations \ word }
+{ $operations T{ vocab-link f "kernel" } }
 { $command-map interactor "quotation" }
 { $heading "Editing commands" }
 "The text editing commands are standard; see " { $link "gadgets-editors-commands" } "."
 { $heading "Implementation" }
 "Listeners are instances of " { $link listener-gadget } ". The listener consists of an output area (instance of " { $link pane } ") and an input area (instance of " { $link interactor } "). Clickable presentations can also be printed to the listener; see " { $link "ui-presentations" } "." ;
 
 { $command-map interactor "quotation" }
 { $heading "Editing commands" }
 "The text editing commands are standard; see " { $link "gadgets-editors-commands" } "."
 { $heading "Implementation" }
 "Listeners are instances of " { $link listener-gadget } ". The listener consists of an output area (instance of " { $link pane } ") and an input area (instance of " { $link interactor } "). Clickable presentations can also be printed to the listener; see " { $link "ui-presentations" } "." ;
 
+TIP: "You can read documentation by pressing F1." ;
+
+TIP: "The listener tool remembers previous lines of input. Press " { $command interactor "completion" recall-previous } " and " { $command interactor "completion" recall-next } " to cycle through them." ;
+
+TIP: "When you mouse over certain objects, a block border will appear. Left-clicking on such an object will perform the default operation. Right-clicking will show a menu with all operations." ;
+
+TIP: "The status bar displays stack effects of recognized words as they are being typed in." ;
+
+TIP: "Press " { $command interactor "completion" code-completion-popup } " to complete word, vocabulary and Unicode character names. The latter two features become available if the cursor is after a " { $link POSTPONE: USE: } ", " { $link POSTPONE: USING: } " or " { $link POSTPONE: CHAR: } "." ;
+
+TIP: "If a word's vocabulary is loaded, but not in the search path, you can use restarts to add the vocabulary to the search path. Auto-use mode (" { $command listener-gadget "toolbar" com-auto-use } ") invokes restarts automatically if there is only one restart." ;
+
+TIP: "Scroll the listener from the keyboard by pressing " { $command listener-gadget "scrolling" com-page-up } " and " { $command listener-gadget "scrolling" com-page-down } "." ;
+
+TIP: "Press " { $command tool "common" refresh-all } " or run " { $link refresh-all } " to reload changed source files from disk. " ;
+
 ABOUT: "ui-listener"
\ No newline at end of file
 ABOUT: "ui-listener"
\ No newline at end of file
index 5efcd01eecaf00f6883b226e33a2ec3c1dd1b3ce..91448dfe105390cdf77bd6d633f914c32b624bdd 100644 (file)
@@ -2,12 +2,13 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors arrays assocs calendar combinators locals
 colors.constants combinators.short-circuit compiler.units
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors arrays assocs calendar combinators locals
 colors.constants combinators.short-circuit compiler.units
-concurrency.flags concurrency.mailboxes continuations destructors
-documents documents.elements fry hashtables help help.markup io
-io.styles kernel lexer listener math models models.delay models.arrow
-namespaces parser prettyprint quotations sequences strings threads
-tools.vocabs vocabs vocabs.loader vocabs.parser words debugger ui ui.commands
-ui.pens.solid ui.gadgets ui.gadgets.glass ui.gadgets.buttons ui.gadgets.editors
+help.tips concurrency.flags concurrency.mailboxes continuations
+destructors documents documents.elements fry hashtables help
+help.markup io io.styles kernel lexer listener math models
+models.delay models.arrow namespaces parser prettyprint quotations
+sequences strings threads tools.vocabs vocabs vocabs.loader
+vocabs.parser words debugger ui ui.commands ui.pens.solid ui.gadgets
+ui.gadgets.glass ui.gadgets.buttons ui.gadgets.editors
 ui.gadgets.labeled ui.gadgets.panes ui.gadgets.scrollers
 ui.gadgets.status-bar ui.gadgets.tracks ui.gadgets.borders ui.gestures
 ui.operations ui.tools.browser ui.tools.common ui.tools.debugger
 ui.gadgets.labeled ui.gadgets.panes ui.gadgets.scrollers
 ui.gadgets.status-bar ui.gadgets.tracks ui.gadgets.borders ui.gestures
 ui.operations ui.tools.browser ui.tools.common ui.tools.debugger
@@ -354,16 +355,11 @@ interactor "completion" f {
     { T{ key-down f { C+ } "r" } history-completion-popup }
 } define-command-map
 
     { T{ key-down f { C+ } "r" } history-completion-popup }
 } define-command-map
 
-: welcome. ( -- )
-    "If this is your first time with Factor, please read the " print
-    "handbook" ($link) ". To see a list of keyboard shortcuts," print
-    "press F1." print nl ;
-
 : listener-thread ( listener -- )
     dup listener-streams [
         [ com-browse ] help-hook set
         '[ [ _ input>> ] 2dip debugger-popup ] error-hook set
 : listener-thread ( listener -- )
     dup listener-streams [
         [ com-browse ] help-hook set
         '[ [ _ input>> ] 2dip debugger-popup ] error-hook set
-        welcome.
+        tip-of-the-day. nl
         listener
     ] with-streams* ;
 
         listener
     ] with-streams* ;
 
@@ -385,7 +381,7 @@ interactor "completion" f {
         [ wait-for-listener ]
     } cleave ;
 
         [ wait-for-listener ]
     } cleave ;
 
-: listener-help ( -- ) "ui-listener" com-browse ;
+: listener-help ( -- ) "help.home" com-browse ;
 
 \ listener-help H{ { +nullary+ t } } define-command
 
 
 \ listener-help H{ { +nullary+ t } } define-command
 
diff --git a/basis/ui/tools/operations/operations-docs.factor b/basis/ui/tools/operations/operations-docs.factor
new file mode 100644 (file)
index 0000000..455e4f5
--- /dev/null
@@ -0,0 +1,8 @@
+USING: help.tips help.markup help.syntax ui.operations
+tools.walker tools.time tools.profiler ui.tools.operations ;
+
+TIP: "Press " { $operation com-stack-effect } " to print the stack effect of the code in the input field without executing it (" { $link "inference" } ")." ;
+
+TIP: "Press " { $operation walk } " to single-step through the code in the input field (" { $link "ui-walker" } ")." ;
+
+TIP: "Press " { $operation time } " to time execution of the code in the input field (" { $link "timing" } ")." ;
index 6d6cda1dba76af5aaf71a69d2a53b6c7445f6b9c..28781e24bbc2ac9a2e58a70a080bf94c48d5da65 100644 (file)
@@ -9,7 +9,7 @@ compiler.units accessors vocabs.parser macros.expander ui
 ui.tools.browser ui.tools.listener ui.tools.listener.completion
 ui.tools.profiler ui.tools.inspector ui.tools.traceback
 ui.commands ui.gadgets.editors ui.gestures ui.operations
 ui.tools.browser ui.tools.listener ui.tools.listener.completion
 ui.tools.profiler ui.tools.inspector ui.tools.traceback
 ui.commands ui.gadgets.editors ui.gestures ui.operations
-ui.tools.deploy models ;
+ui.tools.deploy models help.tips ;
 IN: ui.tools.operations
 
 ! Objects
 IN: ui.tools.operations
 
 ! Objects
@@ -157,8 +157,6 @@ M: word com-stack-effect 1quotation com-stack-effect ;
     { +listener+ t }
 } define-operation
 
     { +listener+ t }
 } define-operation
 
-: com-profile ( quot -- ) profile profiler-window ;
-
 [ quotation? ] \ com-profile H{
     { +keyboard+ T{ key-down f { C+ } "o" } }
     { +listener+ t }
 [ quotation? ] \ com-profile H{
     { +keyboard+ T{ key-down f { C+ } "o" } }
     { +listener+ t }
diff --git a/basis/ui/tools/profiler/profiler-docs.factor b/basis/ui/tools/profiler/profiler-docs.factor
new file mode 100644 (file)
index 0000000..a54a29c
--- /dev/null
@@ -0,0 +1,11 @@
+IN: ui.tools.profiler
+USING: help.markup help.syntax ui.operations help.tips ;
+
+ARTICLE: "ui.tools.profiler" "UI profiler tool"
+"The " { $vocab-link "ui.tools.profiler" } " vocabulary implements a graphical tool for viewing profiling results (see " { $link "tools.profiler" } ")."
+$nl
+"To use the profiler, enter a piece of code in the listener's input area and press " { $operation com-profile } "." ;
+
+TIP: "Press " { $operation com-profile } " to run the code in the input field with profiling enabled (" { $link "ui.tools.profiler" } ")." ;
+
+ABOUT: "ui.tools.profiler"
\ No newline at end of file
index bbd9237c872e256222865cdea0dae1f62a1c51db..6bca4b40c4a0bd217ea6e96985c716324e85c78e 100644 (file)
@@ -208,4 +208,6 @@ profiler-gadget "toolbar" f {
 : profiler-window ( -- )
     <profiler-gadget> "Profiling results" open-status-window ;
 
 : profiler-window ( -- )
     <profiler-gadget> "Profiling results" open-status-window ;
 
+: com-profile ( quot -- ) profile profiler-window ;
+
 MAIN: profiler-window
\ No newline at end of file
 MAIN: profiler-window
\ No newline at end of file
index d3078cc1788de9027f7dc3908fb8e0064d531fde..c591775429aa2f6fe24a574431ac6f1ccc69d0d8 100644 (file)
@@ -1,7 +1,8 @@
 USING: editors help.markup help.syntax summary inspector io io.styles
 listener parser prettyprint tools.profiler tools.walker ui.commands
 ui.gadgets.panes ui.gadgets.presentations ui.operations
 USING: editors help.markup help.syntax summary inspector io io.styles
 listener parser prettyprint tools.profiler tools.walker ui.commands
 ui.gadgets.panes ui.gadgets.presentations ui.operations
-ui.tools.operations ui.tools.profiler ui.tools.common vocabs see ;
+ui.tools.operations ui.tools.profiler ui.tools.common vocabs see
+help.tips ;
 IN: ui.tools
 
 ARTICLE: "starting-ui-tools" "Starting the UI tools"
 IN: ui.tools
 
 ARTICLE: "starting-ui-tools" "Starting the UI tools"
@@ -67,4 +68,6 @@ $nl
 "Platform-specific features:"
 { $subsection "ui-cocoa" } ;
 
 "Platform-specific features:"
 { $subsection "ui-cocoa" } ;
 
+TIP: "All UI developer tools support a common set of " { $link "ui-shortcuts" } ". Each individual tool has its own shortcuts as well; the F1 key is context-sensitive." ;
+
 ABOUT: "ui-tools"
 ABOUT: "ui-tools"
index 871f7c5321444b4d64f7420aec542fc3d790d4f1..b71f6ed3be7d6714e85cb45c391f6afc9f818af6 100644 (file)
@@ -166,6 +166,7 @@ SYMBOL: interactive-vocabs
     "definitions"
     "editors"
     "help"
     "definitions"
     "editors"
     "help"
+    "help.apropos"
     "help.lint"
     "inspector"
     "io"
     "help.lint"
     "inspector"
     "io"
@@ -186,7 +187,6 @@ SYMBOL: interactive-vocabs
     "strings"
     "syntax"
     "tools.annotations"
     "strings"
     "syntax"
     "tools.annotations"
-    "tools.apropos"
     "tools.crossref"
     "tools.disassembler"
     "tools.memory"
     "tools.crossref"
     "tools.disassembler"
     "tools.memory"
index 2aa8ef421c0175656a5e708b05e20da5b16700f7..22e8bfcb62a5361af6dc81b36255e389afeaa186 100644 (file)
@@ -1,6 +1,6 @@
 USING: arrays byte-arrays help.markup help.syntax
 kernel kernel.private strings.private sequences vectors
 USING: arrays byte-arrays help.markup help.syntax
 kernel kernel.private strings.private sequences vectors
-sbufs math tools.vocabs.browser ;
+sbufs math help.vocabs ;
 IN: strings
 
 ARTICLE: "strings" "Strings"
 IN: strings
 
 ARTICLE: "strings" "Strings"
index fd7aafb60120e40423c91fe1a2985dfd235a2a52..8c55945105bce4d266a70bb4ad0eb01a740252ef 100644 (file)
@@ -1,6 +1,6 @@
 
 USING: kernel fry sequences
 
 USING: kernel fry sequences
-       vocabs.loader tools.vocabs.browser
+       vocabs.loader help.vocabs
        ui ui.gadgets ui.gadgets.buttons ui.gadgets.packs ui.gadgets.scrollers
        ui.tools.listener
        accessors ;
        ui ui.gadgets ui.gadgets.buttons ui.gadgets.packs ui.gadgets.scrollers
        ui.tools.listener
        accessors ;
index 6368e542a78c19319bb8c2c2354fde3bcd64e991..30d6845a9b3413afcc4fb0732a4c94c22bbc5080 100644 (file)
@@ -3,7 +3,7 @@
 
 USING: accessors arrays assocs combinators help help.crossref
 help.markup help.topics io io.streams.string kernel make namespaces
 
 USING: accessors arrays assocs combinators help help.crossref
 help.markup help.topics io io.streams.string kernel make namespaces
-parser prettyprint sequences summary tools.vocabs tools.vocabs.browser
+parser prettyprint sequences summary tools.vocabs help.vocabs
 vocabs vocabs.loader words see ;
 
 IN: fuel.help
 vocabs vocabs.loader words see ;
 
 IN: fuel.help
index ccba90fb6f603bcc6b27467c37d308287292d3a2..be713542eddaa7b8d7dfb4975a61331afe8cdad4 100644 (file)
@@ -2,7 +2,7 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: slides help.markup math arrays hashtables namespaces
 sequences kernel sequences parser memoize io.encodings.binary
 ! See http://factorcode.org/license.txt for BSD license.
 USING: slides help.markup math arrays hashtables namespaces
 sequences kernel sequences parser memoize io.encodings.binary
-locals kernel.private tools.vocabs.browser assocs quotations
+locals kernel.private help.vocabs assocs quotations
 urls peg.ebnf tools.vocabs tools.annotations tools.crossref
 help.topics math.functions compiler.tree.optimizer
 compiler.cfg.optimizer fry ;
 urls peg.ebnf tools.vocabs tools.annotations tools.crossref
 help.topics math.functions compiler.tree.optimizer
 compiler.cfg.optimizer fry ;
index 4d4e3b0507d51cec4f55073fedab901488c83da1..ab8e72fc76bb58cdf1712dc121381caaee0a38ea 100644 (file)
@@ -2,7 +2,7 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: slides help.markup math arrays hashtables namespaces
 sequences kernel sequences parser memoize io.encodings.binary
 ! See http://factorcode.org/license.txt for BSD license.
 USING: slides help.markup math arrays hashtables namespaces
 sequences kernel sequences parser memoize io.encodings.binary
-locals kernel.private tools.vocabs.browser assocs quotations
+locals kernel.private help.vocabs assocs quotations
 urls peg.ebnf tools.vocabs tools.annotations tools.crossref
 help.topics math.functions compiler.tree.optimizer
 compiler.cfg.optimizer fry ;
 urls peg.ebnf tools.vocabs tools.annotations tools.crossref
 help.topics math.functions compiler.tree.optimizer
 compiler.cfg.optimizer fry ;
index 2ce307ce207b45fdea574d5aa87ae36b6ae1e39f..b7256246fe378b66ea428d5f7808f6130e985956 100644 (file)
@@ -2,7 +2,7 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: slides help.markup math arrays hashtables namespaces sequences
 kernel sequences parser memoize io.encodings.binary locals
 ! See http://factorcode.org/license.txt for BSD license.
 USING: slides help.markup math arrays hashtables namespaces sequences
 kernel sequences parser memoize io.encodings.binary locals
-kernel.private tools.vocabs.browser assocs quotations tools.vocabs
+kernel.private help.vocabs assocs quotations tools.vocabs
 tools.annotations tools.crossref help.topics math.functions
 compiler.tree.optimizer compiler.cfg.optimizer fry ui.gadgets.panes
 tetris tetris.game combinators generalizations multiline
 tools.annotations tools.crossref help.topics math.functions
 compiler.tree.optimizer compiler.cfg.optimizer fry ui.gadgets.panes
 tetris tetris.game combinators generalizations multiline
index 5d7620101fea1b0eda49af5178c5f07d2066160b..1e5c9602b98b500757213f519dafff050910b108 100644 (file)
@@ -2,7 +2,7 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: slides help.markup math arrays hashtables namespaces
 sequences kernel sequences parser memoize io.encodings.binary
 ! See http://factorcode.org/license.txt for BSD license.
 USING: slides help.markup math arrays hashtables namespaces
 sequences kernel sequences parser memoize io.encodings.binary
-locals kernel.private tools.vocabs.browser assocs quotations
+locals kernel.private help.vocabs assocs quotations
 urls peg.ebnf tools.vocabs tools.annotations tools.crossref
 help.topics math.functions compiler.tree.optimizer
 compiler.cfg.optimizer fry ;
 urls peg.ebnf tools.vocabs tools.annotations tools.crossref
 help.topics math.functions compiler.tree.optimizer
 compiler.cfg.optimizer fry ;