aboutsummaryrefslogtreecommitdiff
path: root/doc/user/document.skb
blob: 477b972ac4567487e0a01c241756bc91f0fb3e98 (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
;;; document.skb  --  Document and author
;;; -*- coding: iso-8859-1 -*-
;;;
;;; Copyright 2008, 2020  Ludovic Court�s <ludo@gnu.org>
;;; Copyright 2003, 2004  Manuel Serrano
;;; Copyright 2008  Christopher Allan Webber <cwebber@dustycloud.org>
;;;
;;;
;;; This file is part of Skribilo.
;;;
;;; Skribilo 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 3 of the License, or
;;; (at your option) any later version.
;;;
;;; Skribilo 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 Skribilo.  If not, see <http://www.gnu.org/licenses/>.

;*---------------------------------------------------------------------*/
;*    dummy-document-output ...                                        */
;*---------------------------------------------------------------------*/
(define dummy-document-output
   (lambda (n e)
      (let* ((a (markup-option n :author))
	     (t (markup-option n :title))
	     (b (markup-body n))
	     (ta (table (tr (map (lambda (n) 
				    (td :valign 'top :align 'center n))
	                         (if (list? a) a (list a)))))))
	 (evaluate-document (center (bold t)) e)
	 (evaluate-document (center ta) e)
	 (output b e))))

;*---------------------------------------------------------------------*/
;*    Document                                                         */
;*---------------------------------------------------------------------*/
(section :title "Building documents" :file #t

;*--- document --------------------------------------------------------*/
(subsection :title "Document"

(p [The ,(tt "document") function defines a Skribe document.])

(doc-markup 'document
	    '((:title "The title of the document.")
	      (:html-title "The title of window of the HTML browser.")
	      (:author "The authors of the document.")
	      (:ending "An ending text.")
	      (:keywords "A list of keywords which may be plain strings
or markups.  The keywords will not appear in the final document but only
as meta-information (e.g., using the HTML `meta' tag) if the engine used
supports it.")
	      (:env "A counter environment.")
	      (:info-dir-category "The name of a category for the
\"directory\" mechanism of the GNU Info documentation system.")
	      (:info-dir-entry "Name of the entry for the GNU Info
directory.")
	      (#!rest node... "The document nodes."))
	    :see-also '(author chapter toc))

(example-produce
 (example :legend "The document markup" (prgm :file "src/api2.skb"))
 (disp 
  (processor :combinator 
	     (lambda (e1 e2)
		(let ((e (copy-engine 'document-engine e2)))
		   (markup-writer 'document e
				  :options '(:title :author :ending)
				  :action dummy-document-output)
		   e))
	     (include "src/api2.skb")))))
	       
;*---------------------------------------------------------------------*/
;*    Author ...                                                       */
;*---------------------------------------------------------------------*/
(subsection :title "Author"

(p [The ,(tt "author") function is used to specify the authors of a Skribe
document.])

(doc-markup 'author
	    '((:name "The name of the author.")
	      (:title "Their title.")
	      (:affiliation "Their affiliation.")
	      (:email "Their email.")
	      (:url "Their web page.")
	      (:address "Their address.")
	      (:phone "Their phone number.")
	      (:photo "Their photograph.")
	      (:align "The author item alignment."))
	    :see-also '(mailto ref))

(example-produce 
 (example :legend "The author markup" (prgm :file "src/api3.skb"))
 (disp (include "src/api3.skb")))))

;;; Local Variables:
;;; ispell-local-dictionary: "american"
;;; End: