1
2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3;;
4;; MODULE      : document-doc.scm
5;; DESCRIPTION : documentation for top-level documents
6;; COPYRIGHT   : (C) 2010  Joris van der Hoeven
7;;
8;; This software falls under the GNU general public license version 3 or later.
9;; It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
10;; in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
11;;
12;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
13
14(texmacs-module (generic document-doc)
15  (:use (generic generic-doc)
16        (generic document-menu)))
17
18;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
19;; Top-level document documentation
20;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
21
22(tm-define (focus-doc-top-generalities t)
23  (let* ((st (get-style-list))
24         (style (if (null? st) "none" (car st))))
25    ($block
26      ($para
27	"The " ($tmdoc-link "main/text/man-structure" "current focus")
28	" is on the entire document. "
29	"In this particular situation, the focus toolbar "
30	"displays some important information about your document, "
31	"such as its style (" ($tmstyle style)
32	"), paper size (" (get-init "page-type")
33	") and font size (" (get-init "font-base-size") "pt). "
34	"The toolbar also indicates the current section "
35	"at the position of your cursor.")
36
37      ($para
38	"The above properties and the current section can also "
39	"be changed using the items on the focus toolbar or "
40	"in the " ($menu "Focus") " menu. "
41	"For instance, by clicking on the current style, "
42	"paper size or font size, a pulldown menu will open "
43	"from which you can modify the current setting. "
44	"By clicking on the " ($tmdoc-icon "tm_add.xpm") " icon "
45	"after the document style, you may select additional style packages.")
46
47      ($para
48	"Similarly, when clicking on the current section, "
49	"a pulldown menu with all sections in the document will open, "
50	"which allows you to quickly jump to a particular section. "
51	"In the case when your cursor is at the start of your document, "
52	"and no document title has been entered yet, "
53	"then a " ($menu "Title") " button will appear "
54	"for inserting a title. Similarly, if your cursor is "
55	"just after the title, then an " ($menu "Abstract")
56	" button will appear for entering the abstract."))))
57
58;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
59;; Top-level generalities
60;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
61
62(tm-define (focus-doc t)
63  (:require (tree-is-buffer? t))
64  (let* ((style (get-style-list))
65	 (stdoc (and (nnull? style) (tmdoc-search-style (car style)))))
66    ($tmdoc
67      ($tmdoc-title "Top level contextual help")
68      ($when #t
69	($unfolded-documentation "Top level editing"
70	  (focus-doc-top-generalities t)))
71      ($when #t
72	($unfolded-documentation "Current document style"
73	  ($when stdoc stdoc)
74	  ($when (not stdoc)
75	    ($explain `(tmstyle ,(car style))
76	      "No documentation available."))))
77      ($when (nnull? (cdr style))
78	($unfolded-documentation "Other active style customizations"
79	  ($for (pack (cdr style))
80	    ($with packdoc (tmdoc-search-style pack)
81	      ($when packdoc packdoc)
82	      ($when (not packdoc)
83		($explain `(tmpackage ,pack)
84		  "No documentation available.")))))))))
85