diff --git a/doc/handbook/changes.facts b/doc/handbook/changes.facts index 85b024def3..1c237db82b 100644 --- a/doc/handbook/changes.facts +++ b/doc/handbook/changes.facts @@ -24,7 +24,7 @@ ARTICLE: "changes" "Changes in the latest release" } { $subtopic "Help system" { $list - { "Help cross-referencing implemented - the " { $link links-in. } " and " { $snippet "links-out." } " words are analogous to " { $link usage. } " and " { $snippet "uses." } } + { "Help cross-referencing implemented - the " { $snippet "links-in." } " and " { $snippet "links-out." } " words are analogous to " { $link usage. } " and " { $snippet "uses." } } { "New documentation covers development tools and C library interface" } } } diff --git a/doc/handbook/help.facts b/doc/handbook/help.facts index 921c051316..0f23833be0 100644 --- a/doc/handbook/help.facts +++ b/doc/handbook/help.facts @@ -12,9 +12,7 @@ ARTICLE: "browsing-help" "Browsing documentation" "Help topics are identified by article name strings, or words. You can request a specific help topic:" { $subsection help } "You can also view a word's documentation and definition at once:" -{ $subsection see-help } -"You can request a list of topics linking to a specific topic:" -{ $subsection links-in. } ; +{ $subsection see-help } ; ARTICLE: "searching-help" "Searching documentation" "The help system maintains a full-text term index. The easiest way to search the help is from the help browser tool in the UI, however you can also search in the listener." @@ -92,5 +90,4 @@ ARTICLE: "markup-utils" "Markup element utilities" "Utility words to assist in defining new elements:" { $subsection simple-element } { $subsection ($span) } -{ $subsection ($block) } -{ $subsection ?terpri } ; +{ $subsection ($block) } ; diff --git a/library/bootstrap/boot-stage2.factor b/library/bootstrap/boot-stage2.factor index d719b1037b..c9f59aa5be 100644 --- a/library/bootstrap/boot-stage2.factor +++ b/library/bootstrap/boot-stage2.factor @@ -9,7 +9,6 @@ parser sequences sequences-internals words ; [ "Cross-referencing..." print flush H{ } clone crossref set-global xref-words - H{ } clone link-graph set-global H{ } clone parent-graph set-global xref-articles "compile" get [ diff --git a/library/bootstrap/image.factor b/library/bootstrap/image.factor index 7f04095e4f..862307cbd8 100644 --- a/library/bootstrap/image.factor +++ b/library/bootstrap/image.factor @@ -291,7 +291,7 @@ M: hashtable ' ( hashtable -- pointer ) [ { vocabularies typemap builtins c-types crossref - articles link-graph parent-graph + articles parent-graph } [ dup get swap bootstrap-word set ] each ] make-hash ' global-offset fixup ; diff --git a/library/bootstrap/primitives.factor b/library/bootstrap/primitives.factor index 9c50ad3514..56eaff537d 100644 --- a/library/bootstrap/primitives.factor +++ b/library/bootstrap/primitives.factor @@ -21,7 +21,6 @@ H{ } clone vocabularies set vocabularies get [ "syntax" set ] bind H{ } clone articles set -link-graph off parent-graph off crossref off diff --git a/library/help/crossref.factor b/library/help/crossref.factor index 4ced901759..711c7f47af 100644 --- a/library/help/crossref.factor +++ b/library/help/crossref.factor @@ -28,16 +28,6 @@ M: array elements* ] each-with ] make-hash hash-keys ; -SYMBOL: link-graph - -: links-out ( article -- seq ) - article-content { $link $see-also } collect-elements ; - -: ?link dup link? [ link-name ] when ; - -: links-in ( article -- seq ) - ?link link-graph get in-edges ; - SYMBOL: parent-graph DEFER: $subsection @@ -45,10 +35,8 @@ DEFER: $subsection : children ( article -- seq ) article-content { $subsection } collect-elements ; -: ?link dup link? [ link-name ] when ; - : parents ( article -- seq ) - ?link parent-graph get in-edges ; + dup link? [ link-name ] when parent-graph get in-edges ; : (where) ( article -- ) dup , parents [ word? not ] subset dup empty? @@ -69,18 +57,10 @@ DEFER: $subsection ] if ; : xref-article ( article -- ) - dup - [ links-out ] link-graph get add-vertex [ children ] parent-graph get add-vertex ; : unxref-article ( article -- ) - dup [ links-out ] link-graph get remove-vertex [ children ] parent-graph get remove-vertex ; : xref-articles ( -- ) - all-articles dup - [ links-out ] link-graph get build-graph - [ children ] parent-graph get build-graph ; - -: links-in. ( article -- ) - links-in [ links-in. ] help-outliner ; + all-articles [ children ] parent-graph get build-graph ; diff --git a/library/help/crossref.facts b/library/help/crossref.facts index bef827090b..5943b85054 100644 --- a/library/help/crossref.facts +++ b/library/help/crossref.facts @@ -11,19 +11,7 @@ HELP: elements "( elt-type element -- seq )" HELP: collect-elements "( element seq -- )" { $values { "element" "a markup element" } { "seq" "a sequence of words" } { "elements" "a new sequence" } } { $description "Collects the arguments of all sub-elements of " { $snippet "element" } " whose markup element type occurs in " { $snippet "seq" } "." } -{ $notes "Used to implement " { $link links-out } " and " { $link children } "." } ; - -HELP: link-graph f -{ $description "Variable. A graph whose vertices are help articles and edges are links. See " { $link "graphs" } "." } -{ $see-also links-out links-in xref-articles } ; - -HELP: links-out "( topic -- seq )" -{ $values { "topic" "an article name or a word" } { "seq" "a new sequence" } } -{ $description "Outputs a sequence of all help articles and words linked to from " { $snippet "article" } "." } ; - -HELP: links-in "( topic -- seq )" -{ $values { "topic" "an article name or a word" } { "seq" "a new sequence" } } -{ $description "Outputs a sequence of all help articles and words which link to " { $snippet "article" } "." } ; +{ $notes "Used to implement " { $link children } "." } ; HELP: parent-graph f { $description "Variable. A graph whose vertices are help articles and edges are subsections. See " { $link "graphs" } "." } @@ -56,7 +44,3 @@ $low-level-note ; HELP: xref-articles "( -- )" { $description "Update the " { $link link-graph } " and " { $link parent-graph } " graphs. Usually this is done automatically." } ; - -HELP: links-in. "( topic -- )" -{ $values { "topic" "an article name or a word" } } -{ $description "Prints an outliner listing all help articles linking to " { $snippet "article" } "." } ; diff --git a/library/help/help.facts b/library/help/help.facts index 3a0d110e23..1fd5a3c6c3 100644 --- a/library/help/help.facts +++ b/library/help/help.facts @@ -1,7 +1,7 @@ IN: help USING: io prettyprint ; -HELP: print-title "( topic -- )" +HELP: $title "( topic -- )" { $values { "topic" "a help article name or a word" } } { $description "Prints a help article's title, or a word's " { $link synopsis } ", depending on the type of " { $snippet "topic" } "." } ; diff --git a/library/help/markup.facts b/library/help/markup.facts index b13586dd22..de626606fc 100644 --- a/library/help/markup.facts +++ b/library/help/markup.facts @@ -8,9 +8,6 @@ HELP: ($span) "( content style -- )" { $values { "content" "a markup element" } { "style" "a hashtable" } } { $description "Prints an inline markup element." } ; -HELP: ?terpri "( -- )" -{ $description "Prints a newline if the last element which was output is not a block." } ; - HELP: ($block) "( quot -- )" { $values { "quot" "a quotation" } } { $description "Prints a block markup element with newlines before and after." } ; diff --git a/library/help/topics.facts b/library/help/topics.facts index 4fc45c4c2d..2059b7d405 100644 --- a/library/help/topics.facts +++ b/library/help/topics.facts @@ -24,6 +24,3 @@ HELP: add-article "( name title element -- )" { $values { "name" "a string" } { "title" "a string" } { "element" "a markup element" } } { $description "Adds a help article to the " { $link articles } " hashtable." } { $notes "This word is used to implement " { $link POSTPONE: ARTICLE: } "." } ; - -HELP: last-block f -{ $description "Variable. Set by " { $link print-element } " if the last element output was a block element, thus if the next element is a block element no newline needs to be output." } ; diff --git a/library/syntax/parse-syntax.facts b/library/syntax/parse-syntax.facts index fe5c1b6878..b6fda39ef4 100644 --- a/library/syntax/parse-syntax.facts +++ b/library/syntax/parse-syntax.facts @@ -226,7 +226,7 @@ $terpri { $see-also define-tuple } ; HELP: C: "class definition... ;" -{ $values { "class" "a class word" } { "generic" "a generic word" } { "definition" "a constructor definition" } } +{ $values { "class" "a class word" } { "definition" "a constructor definition" } } { $description "Define a constructor word for a tuple class. The constructor definition receives a new instance of the class on the stack, with all slots initially set to " { $link f } "." $terpri "Constructors are named after the tuple class surrounded in angle brackets: " { $snippet "<" } " and " { $snippet ">" } "." } diff --git a/library/ui/tools/browser.factor b/library/ui/tools/browser.factor index 993d13788a..62fb92a78c 100644 --- a/library/ui/tools/browser.factor +++ b/library/ui/tools/browser.factor @@ -54,7 +54,6 @@ DEFER: show-vocab { "Definition" [ see ] } { "Documentation" [ help ] } { "Calls in" [ usage. ] } - { "Links in" [ links-in. ] } { "Properties" [ word-props describe ] } } ; diff --git a/library/ui/tools/help.factor b/library/ui/tools/help.factor index 472378b5db..65e7b19f31 100644 --- a/library/ui/tools/help.factor +++ b/library/ui/tools/help.factor @@ -30,12 +30,14 @@ C: help-sidebar ( -- gadget ) { [ ] set-help-sidebar-search 1/2 } } { 0 1 0 } make-track* ; -TUPLE: help-gadget showing sidebar tabs ; +TUPLE: help-gadget showing sidebar scroller ; + +: help-gadget-pane help-gadget-scroller scroller-gadget ; C: help-gadget ( -- gadget ) { { [ ] set-help-gadget-sidebar 1/4 } - { [ ] set-help-gadget-tabs 3/4 } + { [ ] set-help-gadget-scroller 3/4 } } { 1 0 0 } make-track* ; M: help-gadget gadget-title @@ -50,11 +52,10 @@ M: help-gadget focusable-child* [ over history-seq push-new update-history ] [ 2drop ] if ; : show-help ( link help -- ) - dup add-history [ set-help-gadget-showing ] 2keep - dup update-title { - { "Article" [ help ] } - { "Links in" [ links-in. ] } - } swap help-gadget-tabs set-pages ; + dup add-history + [ set-help-gadget-showing ] 2keep + dup update-title + help-gadget-pane [ help ] with-pane ; : help-tool [ help-gadget? ]