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"
{ $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" }
}
}

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:"
{ $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) } ;

View File

@ -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 [

View File

@ -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 ;

View File

@ -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

View File

@ -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 ;

View File

@ -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" } "." } ;

View File

@ -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" } "." } ;

View File

@ -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." } ;

View File

@ -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." } ;

View File

@ -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 ">" } "." }

View File

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

View File

@ -30,12 +30,14 @@ C: help-sidebar ( -- gadget )
{ [ <help-search> ] 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 )
{
{ [ <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* ;
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? ]