summaryrefslogtreecommitdiff
path: root/doc/user/char.skb
blob: fe15831a2fecdab78d658a2ea80874fe81ecf055 (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
;*=====================================================================*/
;*    serrano/prgm/project/skribe/doc/user/char.skb                    */
;*    -------------------------------------------------------------    */
;*    Author      :  Manuel Serrano                                    */
;*    Creation    :  Sat Sep  6 16:07:08 2003                          */
;*    Last change :  Mon Feb  2 11:16:57 2004 (serrano)                */
;*    Copyright   :  2003-04 Manuel Serrano                            */
;*    -------------------------------------------------------------    */
;*    Characters, strings and symbols                                  */
;*=====================================================================*/

;*---------------------------------------------------------------------*/
;*    Footnote ...                                                     */
;*---------------------------------------------------------------------*/
(section :title "Characters, Strings and Symbols" :file #t

;*--- characters ------------------------------------------------------*/
(subsection :title "Characters"

(p [The function ,(code "char") introduces a ,(emph "character") in
the produced document. The purpose of this function is to introduce
escape characters or to introduce characters that cannot be typesetted
in the document (for instance because the editors does not support
them). The escapes characters are ,(code (char 91)), ,(code (char 93))
and ,(code (char 59)).])

(doc-markup 'char
	    '((char [The character to be introduced. Specified value can be
a character, a string or an integer]))
	    :common-args '())

(example-produce
 (example :legend "Some characters" (prgm :file "src/api19.skb"))
 (disp (include "src/api19.skb"))))


;*--- Strings ---------------------------------------------------------*/
(subsection :title "Strings"

(p [the function ,(code "!") introduces raw strings in the target.
That is, the strings introduced by ,(code "!") are written ,(emph "as is"),
without any transformation from the engine.])

(doc-markup '!
	    '((format [The format of the command.])
	      (#!rest node... "The arguments."))
	    :common-args '())

(p [The sequences ,(code "$1"), ,(code "$2"), ... in the ,(param 'format)
are replaced with the actual values of the arguments ,(param 'node).])

(let ((file (if (engine-format? "lout")
	        "src/api20-lout.skb"
	        "src/api20-html.skb")))
  (example-produce
   (example :legend "Some characters" (prgm :file file))
   (disp (include file)))))

;*--- Symbols ---------------------------------------------------------*/
(subsection :title "Symbols"

(p [The function ,(code "symbol") introduces special symbols in the
produced file. Note that the rendering of symbols is unportable. It depends
of the capacity of the targeted format.])

(doc-markup 'symbol
	    '((symbol [The symbol to introduce.]))
	    :common-args '())

(p [Here is the list of recognized symbols:])

(center
 (apply table 
	:width *prgm-width*
	(tr :class 'api-symbol-prototype (th "Symbol name") (th "Rendering"))
	(map (lambda (s)
		(tr :bg  *prgm-skribe-color*
		    (td :align 'left s)
		    (td :align 'left (symbol s))))
	     (sort (let ((t (make-hashtable)))
		      (for-each (lambda (e)
				   (for-each (lambda (s)
						(hashtable-put! t (car s) (car s)))
					     (engine-symbol-table e)))
				*api-engines*)
		      (hashtable->list t))
		   string<?))))))