aboutsummaryrefslogtreecommitdiff
path: root/doc/user/package.skb
blob: eed0b09f028569ff7ab8a3eab297ca90baca1631 (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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
;;; package.skb  --  Packages
;;; -*- coding: iso-8859-1 -*-
;;;
;;; Copyright 2007, 2008, 2009  Ludovic Court�s <ludo@gnu.org>
;;; Copyright 2001, 2004, 2005  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/>.

;*---------------------------------------------------------------------*/
;*    Standard packages                                                */
;*---------------------------------------------------------------------*/
(chapter :title "Standard Packages"
   
   (p [This chapter describes the standard packages that come with
Skribilo.  Additional packages may be found from the ,(ref :url
*skribe-url* :text "Skribe web page"), but they may require slight
modifications to work correctly with Skribilo.])
   
   (p [In order to use the facilities described in the following
sections, the Skribilo source file must contains statements such as:]

(prgm "(use-modules (skribilo package THE-PACKAGE))")

[where ,(tt "THE-PACKAGE") is the desired package.  GNU Guile users will
recognize that this is Guile's standard way to use Scheme modules.  The
effect of the ,(tt [use-modules]) clause is to insert the bindings
exported by ,(tt "THE-PACKAGE") into the current module's name space.
Note that third-party Skribilo packages can have arbitrary Guile module
names.  And of course, the ,(tt [use-modules]) clause can be used to
import ,(emph [any]) Guile module, not just Skribilo packages.])

;*---------------------------------------------------------------------*/
;*    jfp                                                              */
;*---------------------------------------------------------------------*/
(section :title "Articles"

   (subsection :title (tt "acmproc") :ident "acmproc"

      (index :index *package-index* "acmproc" :note "package")
      (p [
This package enables producing LaTeX documents conforming to the
,(emph "ACM proceeding") (ACMPROC) style. It introduces the
markup ,(code "abstract"):])
      (doc-markup 'abstract
	 `((:class "The node class.")
	   (:postscript [The URL of the PostScript version of the paper.]))
	 :ident "abstract(acmproc)"
	 :common-args '()
	 :idx-note "acmproc"
	 :idx-suffix " (acmproc)"
	 :force-engines *api-engines*
	 :source "skribilo/package/acmproc.scm"))

   (subsection :title (tt "jfp") :ident "jfp"
      (index :index *package-index* "jfp" :note "package")
      (p [
This package enables producing LaTeX documents conforming to the
,(emph "Journal of Functional Programming") (JFP) style. It introduces the
markup ,(code "abstract"):])
      (doc-markup 'abstract
	 `((:postscript [The URL of the PostScript version of the paper.]))
	 :ident "abstract(jfp)"
	 :common-args '()
	 :idx-note "jfp"
	 :idx-suffix " (jfp)"
	 :force-engines *api-engines*
	 :source "skribilo/package/jfp.scm"))

   (subsection :title (tt "lncs") :ident "lncs"
      (index :index *package-index* "lncs" :note "package")
      (p [
This package enables producing LaTeX documents conforming to the
,(emph "Lecture Notes on Computer Science") (LNCS) style. It introduces the
markups ,(code "abstract") and ,(code "references"):])

      (doc-markup 'abstract
	 `((:postscript [The URL of the PostScript version of the paper.]))
	 :common-args '()
	 :idx-note "lncs"
	 :idx-suffix " (lncs)"
	 :force-engines *api-engines*
	 :source "skribilo/package/lncs.scm")

      (doc-markup 'references
	 `((:sort [A sort procedure, as for ,(code "the-bibliography").]))
	 :common-args '()
	 :idx-note "lncs"
	 :idx-suffix " (lncs)"
	 :force-engines *api-engines*
	 :source "skribilo/package/lncs.scm"
	 :see-also '(the-bibliography bib-sort/authors))

      ))

;*---------------------------------------------------------------------*/
;*    french                                                           */
;*---------------------------------------------------------------------*/
(section :title "Languages"

   ;; FIXME: Provide proper i18n.

   (p [Currently, native language support in Skribilo is rudimentary,
limited to the following package.  In the future, it should be possible
to specify a document's language so that the output engine behaves
accordingly, e.g., by choosing the right typographical rules and the
right phrases.])

   (subsection :title (tt "french")
      (index :index *package-index* "french" :note "package")
      (p [
Enables French typesetting and typographical rules.])))

;*---------------------------------------------------------------------*/
;*    letter                                                           */
;*---------------------------------------------------------------------*/
(section :title (tt "letter")
   (index :index *package-index* "letter" :note "package")
   (p [
This package is to be used to authoring simple letters. It redefines the
,(markup-ref "document") markup.])
   
   (doc-markup 'document
      `((:where [The location where the letter is posted.])
	(:date [The date of the letter.])
	(:author [The author of the letter.]))
      :ident "document/letter"
      :idx-note "letter"
      :idx-suffix " (letter)"
      :force-engines *api-engines*
      :source "skribilo/package/letter.scm"))

;*---------------------------------------------------------------------*/
;*    Web                                                              */
;*---------------------------------------------------------------------*/
(section :title "Web"
   
   #;(subsection :title (tt "web-article")
      (index :index *package-index* "web-article" :note "package")

      (p [This module provides a convenient mode for rendering articles
(i.e., documents made of sections) in HTML.])
      
      ;; FIXME: We don't have any clean way to pass load options through
      ;; `use-modules'.
      (p [The ,(tt [web-article]) package supports two ,(markup-ref
"skribe-load") user options: ,(param :style) and ,(param :css). The
,(param :style) option can either be ,(code "'traditional") which forces
traditional HTML code emission or ,(code "'css") which forces HTML code
emission using CSS annotations. The CSS style used is specified in the
(code "css") HTML engine ,(ref :subsection "The HTML customization"
:text "custom").  The ,(param :css) is a shorthand for ,(param
:style). For instance:]
(prgm [(skribe-load "web-article.skr" :css "style.css")])
[is equivalent to:]
(prgm [(skribe-load "web-article.skr" :style 'css)
(engine-custom-set! (find-engine 'html) :css "style.css")]))
      )
   
   (subsection :title (tt "web-book")
      (index :index *package-index* "web-book" :note "package")

      (p [This package provides a convenient mode for rendering books
(i.e., documents made of chapters and sections) in HTML.  It modifies
the ,(tt [left-margin]) custom of the HTML engine (see ,(ref :text [HTML
customs] :ident "html-engine")) such that the left margin of each HTML
file produced contains a menu allowing for quick navigation within the
HTML document.]))
   
   (subsection :title (tt "web-book2")
      (index :index *package-index* "web-book2" :note "package")
      
      (p [This package provides a different way to render books in HTML.
Concretely, it prepends a small table of contents to each chapter,
section, etc., that appears in an HTML file of its own, making it easy
to move around the various HTML files of the document.  Compared to ,(tt
[web-book]), it does not clutter the left margin of the HTML pages.])

      (p [Unlike ,(tt [web-book]), this package is ``purely functional''
in that it does not modify the HTML engine customs and writers.]))
   
   (subsection :title (tt [html-navtabs])

      (p [The ,(tt [html-navtabs]) package enables quick navigation
inside HTML documents by means of tabs.  The produced HTML code uses CSS
declarations.  The ,(tt [html-navtabs]) package does not introduce any
new markups.  It is configured via additional ,(ref :text [engine
customs.] :chapter "Engines")])
      
      (subsubsection :title [HTML Engine Customization]
   
	 (p [,(tt [html-navtabs]) is to be used in conjunction with the
,(ref :text (code "html-engine") :mark "html-engine")
engine.  Specifically, it adds the following new customization to this
engine:])

     (doc-engine 'html
		 `((html-navtabs [The tabs.])
		   (html-navtabs-padding [Padding above tabs.])
		   (html-navtabs-bar-background [Bar background color.]))
		 :def `(make-engine 'html
			  :custom '((html-navtabs ,(it [Containers whose
  option ,(param :file) is ,(code "#t")]))
				    (html-navtabs-padding 20.)
				    (html-navtabs-bar-background 
				     ,(engine-custom (find-engine 'html)
					 'left-margin-background))))))

      (subsubsection :title [Additional Container Options]

	 (p [,(tt [html-navtabs]) introduces two new ,(ref :text
"containers" :section "Sectioning") (i.e., a ,(ref :text (code
"document") :mark "document") ,(ref :text (code "chapter") :mark
"chapter") ,(ref :text (code "section") :mark "subsection"), ...)
attributes: ,(param :html-tabs-bar) and ,(param :no-tabs).  The
attribute ,(param :html-tabs-bar) may contain any Skribe expression. It
controls the content of the navtabs sub-bar (i.e., a small line above
the tabs). The attribute ,(param :no-tabs) disable tabs for this
container.]))

      (subsubsection :title [Example]
	             :info-node [Package Example]

	 (resolve (lambda (n e env)
	            ;; XXX: In Lout, the sample code is unbreakable for
		    ;; some reason, which breaks the whole document.
	            (if (engine-format? "html" e)
		        (list
	 (p [Below is a full example using ,(tt [html-navtabs]).])
	 (prgm :file "src/html-navtabs.skb"))
	                [Please see the HTML version of the manual
                         for an example.])))))))

;*---------------------------------------------------------------------*/
;*    Emacs indentation                                                */
;*---------------------------------------------------------------------*/
;; @indent: (put 'doc-markup 'skribe-indent 'skribe-indent-function)@*