]> gitweb.factorcode.org Git - factor.git/blob - extra/help/crossref/crossref.factor
Merge branch 'master' of git://factorcode.org/git/factor
[factor.git] / extra / help / crossref / crossref.factor
1 ! Copyright (C) 2005, 2007 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: arrays definitions generic assocs
4 io kernel namespaces prettyprint prettyprint.sections
5 sequences words summary classes help.topics help.markup ;
6 IN: help.crossref
7
8 : article-children ( topic -- seq )
9     article-content { $subsection } collect-elements ;
10
11 M: link uses
12     article-content
13     { $subsection $link $see-also }
14     collect-elements [ \ f or ] map ;
15
16 : help-path ( topic -- seq )
17     [ article-parent ] follow rest ;
18
19 : set-article-parents ( parent article -- )
20     article-children [ set-article-parent ] with each ;
21
22 : xref-article ( topic -- )
23     dup >link xref dup set-article-parents ;
24
25 : unxref-article ( topic -- )
26     >link unxref ;