Remove the 'links-in' feature

darcs
slava 2006-06-21 03:05:26 +00:00
parent 117aef414f
commit 895a38fe5a
13 changed files with 17 additions and 64 deletions

View File

@ -24,7 +24,7 @@ ARTICLE: "changes" "Changes in the latest release"
} }
{ $subtopic "Help system" { $subtopic "Help system"
{ $list { $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" } { "New documentation covers development tools and C library interface" }
} }
} }

View File

@ -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:" "Help topics are identified by article name strings, or words. You can request a specific help topic:"
{ $subsection help } { $subsection help }
"You can also view a word's documentation and definition at once:" "You can also view a word's documentation and definition at once:"
{ $subsection see-help } { $subsection see-help } ;
"You can request a list of topics linking to a specific topic:"
{ $subsection links-in. } ;
ARTICLE: "searching-help" "Searching documentation" 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." "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:" "Utility words to assist in defining new elements:"
{ $subsection simple-element } { $subsection simple-element }
{ $subsection ($span) } { $subsection ($span) }
{ $subsection ($block) } { $subsection ($block) } ;
{ $subsection ?terpri } ;

View File

@ -9,7 +9,6 @@ parser sequences sequences-internals words ;
[ [
"Cross-referencing..." print flush "Cross-referencing..." print flush
H{ } clone crossref set-global xref-words H{ } clone crossref set-global xref-words
H{ } clone link-graph set-global
H{ } clone parent-graph set-global xref-articles H{ } clone parent-graph set-global xref-articles
"compile" get [ "compile" get [

View File

@ -291,7 +291,7 @@ M: hashtable ' ( hashtable -- pointer )
[ [
{ {
vocabularies typemap builtins c-types crossref vocabularies typemap builtins c-types crossref
articles link-graph parent-graph articles parent-graph
} [ dup get swap bootstrap-word set ] each } [ dup get swap bootstrap-word set ] each
] make-hash ' ] make-hash '
global-offset fixup ; global-offset fixup ;

View File

@ -21,7 +21,6 @@ H{ } clone vocabularies set
vocabularies get [ "syntax" set ] bind vocabularies get [ "syntax" set ] bind
H{ } clone articles set H{ } clone articles set
link-graph off
parent-graph off parent-graph off
crossref off crossref off

View File

@ -28,16 +28,6 @@ M: array elements*
] each-with ] each-with
] make-hash hash-keys ; ] 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 SYMBOL: parent-graph
DEFER: $subsection DEFER: $subsection
@ -45,10 +35,8 @@ DEFER: $subsection
: children ( article -- seq ) : children ( article -- seq )
article-content { $subsection } collect-elements ; article-content { $subsection } collect-elements ;
: ?link dup link? [ link-name ] when ;
: parents ( article -- seq ) : parents ( article -- seq )
?link parent-graph get in-edges ; dup link? [ link-name ] when parent-graph get in-edges ;
: (where) ( article -- ) : (where) ( article -- )
dup , parents [ word? not ] subset dup empty? dup , parents [ word? not ] subset dup empty?
@ -69,18 +57,10 @@ DEFER: $subsection
] if ; ] if ;
: xref-article ( article -- ) : xref-article ( article -- )
dup
[ links-out ] link-graph get add-vertex
[ children ] parent-graph get add-vertex ; [ children ] parent-graph get add-vertex ;
: unxref-article ( article -- ) : unxref-article ( article -- )
dup [ links-out ] link-graph get remove-vertex
[ children ] parent-graph get remove-vertex ; [ children ] parent-graph get remove-vertex ;
: xref-articles ( -- ) : xref-articles ( -- )
all-articles dup all-articles [ children ] parent-graph get build-graph ;
[ links-out ] link-graph get build-graph
[ children ] parent-graph get build-graph ;
: links-in. ( article -- )
links-in [ links-in. ] help-outliner ;

View File

@ -11,19 +11,7 @@ HELP: elements "( elt-type element -- seq )"
HELP: collect-elements "( element seq -- )" HELP: collect-elements "( element seq -- )"
{ $values { "element" "a markup element" } { "seq" "a sequence of words" } { "elements" "a new sequence" } } { $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" } "." } { $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 } "." } ; { $notes "Used to implement " { $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" } "." } ;
HELP: parent-graph f HELP: parent-graph f
{ $description "Variable. A graph whose vertices are help articles and edges are subsections. See " { $link "graphs" } "." } { $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 "( -- )" HELP: xref-articles "( -- )"
{ $description "Update the " { $link link-graph } " and " { $link parent-graph } " graphs. Usually this is done automatically." } ; { $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" } "." } ;

View File

@ -1,7 +1,7 @@
IN: help IN: help
USING: io prettyprint ; USING: io prettyprint ;
HELP: print-title "( topic -- )" HELP: $title "( topic -- )"
{ $values { "topic" "a help article name or a word" } } { $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" } "." } ; { $description "Prints a help article's title, or a word's " { $link synopsis } ", depending on the type of " { $snippet "topic" } "." } ;

View File

@ -8,9 +8,6 @@ HELP: ($span) "( content style -- )"
{ $values { "content" "a markup element" } { "style" "a hashtable" } } { $values { "content" "a markup element" } { "style" "a hashtable" } }
{ $description "Prints an inline markup element." } ; { $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 -- )" HELP: ($block) "( quot -- )"
{ $values { "quot" "a quotation" } } { $values { "quot" "a quotation" } }
{ $description "Prints a block markup element with newlines before and after." } ; { $description "Prints a block markup element with newlines before and after." } ;

View File

@ -24,6 +24,3 @@ HELP: add-article "( name title element -- )"
{ $values { "name" "a string" } { "title" "a string" } { "element" "a markup element" } } { $values { "name" "a string" } { "title" "a string" } { "element" "a markup element" } }
{ $description "Adds a help article to the " { $link articles } " hashtable." } { $description "Adds a help article to the " { $link articles } " hashtable." }
{ $notes "This word is used to implement " { $link POSTPONE: ARTICLE: } "." } ; { $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." } ;

View File

@ -226,7 +226,7 @@ $terpri
{ $see-also define-tuple } ; { $see-also define-tuple } ;
HELP: C: "class definition... ;" 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 } "." { $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 $terpri
"Constructors are named after the tuple class surrounded in angle brackets: " { $snippet "<" } " and " { $snippet ">" } "." } "Constructors are named after the tuple class surrounded in angle brackets: " { $snippet "<" } " and " { $snippet ">" } "." }

View File

@ -54,7 +54,6 @@ DEFER: show-vocab
{ "Definition" [ see ] } { "Definition" [ see ] }
{ "Documentation" [ help ] } { "Documentation" [ help ] }
{ "Calls in" [ usage. ] } { "Calls in" [ usage. ] }
{ "Links in" [ links-in. ] }
{ "Properties" [ word-props describe ] } { "Properties" [ word-props describe ] }
} <pages> ; } <pages> ;

View File

@ -30,12 +30,14 @@ C: help-sidebar ( -- gadget )
{ [ <help-search> ] set-help-sidebar-search 1/2 } { [ <help-search> ] set-help-sidebar-search 1/2 }
} { 0 1 0 } make-track* ; } { 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 ) C: help-gadget ( -- gadget )
{ {
{ [ <help-sidebar> ] set-help-gadget-sidebar 1/4 } { [ <help-sidebar> ] set-help-gadget-sidebar 1/4 }
{ [ <tabs> ] set-help-gadget-tabs 3/4 } { [ <pane> <scroller> ] set-help-gadget-scroller 3/4 }
} { 1 0 0 } make-track* ; } { 1 0 0 } make-track* ;
M: help-gadget gadget-title M: help-gadget gadget-title
@ -50,11 +52,10 @@ M: help-gadget focusable-child*
[ over history-seq push-new update-history ] [ 2drop ] if ; [ over history-seq push-new update-history ] [ 2drop ] if ;
: show-help ( link help -- ) : show-help ( link help -- )
dup add-history [ set-help-gadget-showing ] 2keep dup add-history
dup update-title { [ set-help-gadget-showing ] 2keep
{ "Article" [ help ] } dup update-title
{ "Links in" [ links-in. ] } help-gadget-pane [ help ] with-pane ;
} swap help-gadget-tabs set-pages ;
: help-tool : help-tool
[ help-gadget? ] [ help-gadget? ]