factor/extra/help/crossref/crossref.factor

27 lines
763 B
Factor
Raw Normal View History

2007-09-20 18:09:08 -04:00
! Copyright (C) 2005, 2007 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: arrays definitions generic assocs
io kernel namespaces prettyprint prettyprint.sections
sequences words inspector classes help.topics help.markup ;
IN: help.crossref
: article-children ( topic -- seq )
article-content { $subsection } collect-elements ;
M: link uses
article-content
{ $subsection $link $see-also }
collect-elements [ \ f or ] map ;
: help-path ( topic -- seq )
[ article-parent ] follow rest ;
2007-09-20 18:09:08 -04:00
: set-article-parents ( parent article -- )
2008-01-09 17:36:30 -05:00
article-children [ set-article-parent ] with each ;
2007-09-20 18:09:08 -04:00
: xref-article ( topic -- )
dup >link xref dup set-article-parents ;
: unxref-article ( topic -- )
>link unxref ;