summaryrefslogtreecommitdiff
path: root/doc/user/sectioning.skb
blob: bea8116fb7adba30ccd965a162938c2043cfaa4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
;;; sectioning.skb  --  Sectioning markups
;;;
;;; Copyright 2003, 2004  Manuel Serrano
;;; Copyright 2007  Ludovic Court�s <ludo@gnu.org>
;;;
;;;
;;; This program is free software; you can redistribute it and/or modify
;;; it under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 2 of the License, or
;;; (at your option) any later version.
;;;
;;; This program is distributed in the hope that it will be useful,
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with this program; if not, write to the Free Software
;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
;;; USA.

;*---------------------------------------------------------------------*/
;*    dummy-section-output ...                                         */
;*---------------------------------------------------------------------*/
(define dummy-section-output
   (lambda (n e)
      (let* ((t (markup-option n :title))
	     (b (markup-body n)))
	 (skribe-eval (center (bold t)) e)
	 (output b e))))

;*---------------------------------------------------------------------*/
;*    Sectioning                                                       */
;*---------------------------------------------------------------------*/
(section :title "Sectioning" :file #t

;*--- chapter ---------------------------------------------------------*/
(subsection :title "Chapter" 

(p [The function ,(code "chapter") creates new chapters.])

(doc-markup 'chapter
	    `((:title [The title of the chapter.])
	      (:html-title [The title of window of the HTML browser.])
	      (:number [This argument controls the chapter number.
A value of ,(tt "#t") means that Skribilo computes the chapter
number. A value of ,(tt "#f") means that the chapter has no number.  A
number or string specifies a number to be used in lieu of the
automatically computed number.])
	      (:toc ,[This argument controls if the chapter must
be referenced in the ,(ref :mark "toc" :text "table of contents").])
	      (:file [The argument must be a boolean. A value of
,(tt "#t") tells the Skribe compiler to compile that chapter in a separate
file. A value of ,(tt "#f") tells the Skribe compiler to embed the chapter
in the main target file.])
	      (#!rest node... [The nodes of the chapter.]))
	    :see-also '(document section toc))

(example-produce
 (example :legend "The chapter markup" (prgm :file "src/api4.skb"))
 (disp 
  (processor :combinator 
	     (lambda (e1 e2)
		(let ((e (copy-engine 'document-engine e2)))
		   (markup-writer 'chapter e
				  :options '(:title :file :number :toc)
				  :action dummy-section-output)
		   e))
	     (include "src/api4.skb")))))

;*--- section ---------------------------------------------------------*/
(subsection :title "Sections" 

(p [These functions create new sections.])

(doc-markup 'section 
	    `((:title [The title of the chapter.])
	      (:number [This argument controls the chapter number.
A value of ,(tt "#t") means that Skribilo computes the chapter
number. A value of ,(tt "#f") means that the chapter has no number.  A
number or string specifies a number to be used in lieu of the
automatically computed number.])
	      (:toc ,[This argument controls if the chapter must
be referenced in the ,(ref :mark "toc" :text "table of contents").])
	      (:file [The argument must be a boolean. A value of
,(tt "#t") tells the Skribe compiler to compile that section in a separate
file. A value of ,(tt "#f") tells the Skribe compiler to embed the chapter
in the main target file.])
	      (#!rest node... [The nodes of the section.]))
	    :others '(subsection subsubsection)
	    :see-also '(document chapter paragraph toc))

(example-produce
 (example :legend "The chapter markup" (prgm :file "src/api5.skb"))
 (disp 
  (processor :combinator 
	     (lambda (e1 e2)
		(let ((e (copy-engine 'document-engine e2)))
		   (markup-writer 'chapter e
				  :options '(:title :file :number :toc)
				  :action dummy-section-output)
		   e))
	     (include "src/api5.skb")))))

;*--- paragraph -------------------------------------------------------*/
(subsection :title "Paragraph"

(p [The function ,(code "paragraph") (also aliased ,(code "p")) creates
paragraphs.])

(doc-markup 'paragraph
	    '((#!rest node... "The nodes of the paragraph."))
	    :see-also '(document chapter section p))

(p [The function ,(code "p") is an alias for ,(code "paragraph").])
(doc-markup 'p
	    '((#!rest node... "The nodes of the paragraph."))
	    :source "skribilo/package/base.scm"
	    :see-also '(document chapter section paragraph)))

;*--- blockquote -----------------------------------------------------*/
(subsection :title "Blockquote"

(p [The function ,(code "blockquote") can be used for text
quotations. A text quotation is generally renderd as an indented block
of text.])
(doc-markup 'blockquote
	    '((#!rest node... "The nodes of the quoted text.")))))


;;; Local Variables:
;;; coding: latin-1
;;; End: