aboutsummaryrefslogtreecommitdiff
path: root/doc/user/char.skb
blob: 1760434c589ba37bd2bf99feddb4d76ff9a8106e (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
;;; char.skb  --  Characters, strings and symbols
;;; -*- coding: iso-8859-1 -*-
;;;
;;; Copyright 2008  Ludovic Court�s <ludo@gnu.org>
;;; Copyright 2003, 2004  Manuel Serrano
;;;
;;;
;;; 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/>.

;*---------------------------------------------------------------------*/
;*    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"
   :ident "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:])

(apply ctrtable
       :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-hash-table)))
                     (for-each (lambda (e)
                                  (for-each (lambda (s)
                                               (hash-set! t (car s) (car s)))
                                            (engine-symbol-table e)))
                               *api-engines*)
                     (hash-fold (lambda (key value result)
		                  (cons key result))
				'()
				t))
                  string<?)))))


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