| 
									
										
										
										
											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 )
 | 
					
						
							| 
									
										
										
										
											2007-11-04 18:06:34 -05:00
										 |  |  |     [ dup ] [ [ article-parent ] keep ] [ ] unfold nip 1 tail ;
 | 
					
						
							| 
									
										
										
										
											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 ;
 |