File: imagelib.html

package info (click to toggle)
docbook-dsssl-doc 1.79-7
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 3,724 kB
  • sloc: makefile: 2
file content (287 lines) | stat: -rw-r--r-- 6,006 bytes parent folder | download | duplicates (5)
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
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
<HTML
><HEAD
><TITLE
>Image Library Files</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"></HEAD
><BODY
CLASS="ARTICLE"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="ARTICLE"
><DIV
CLASS="TITLEPAGE"
><H1
CLASS="TITLE"
><A
NAME="AEN2"
>Image Library Files</A
></H1
><H3
CLASS="AUTHOR"
><A
NAME="AEN4"
>Norman Walsh</A
></H3
><P
CLASS="PUBDATE"
>17 Nov 1998<BR></P
><DIV
><DIV
CLASS="ABSTRACT"
><P
></P
><A
NAME="AEN8"
></A
><P
>Additional information about graphics files can be used to improve
the presentation of images. In particular, passing the height and width
of a graphic to a web browser improves layout and alternative text should
always be used. Image library files provide a mechanism for passing this
information to the DocBook DSSSL Stylesheets.</P
><P
></P
></DIV
></DIV
><HR></DIV
><P
>Image library files can be used to pass additional information 
about images to the stylesheet.  The HTML stylesheet uses this information
in the <CODE
CLASS="SGMLTAG"
>IMG</CODE
> tag; the print stylesheet may someday be
able to use this information to get proper spacing around images, but I
don't quite have that worked out yet.</P
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="AEN12"
>Image Library File Format</A
></H1
><P
>Image library files are <SPAN
CLASS="emphasis"
><I
CLASS="EMPHASIS"
>XML</I
></SPAN
> documents conforming
the image library DTD shown in <A
HREF="imagelib.html#FIG.ILIBDTD"
>Figure 1</A
>.</P
><DIV
CLASS="FIGURE"
><A
NAME="FIG.ILIBDTD"
></A
><P
><B
>Figure 1. The Image Library DTD</B
></P
><PRE
CLASS="PROGRAMLISTING"
>&#60;!-- $Id: imagelib.dtd,v 1.1 2001/04/02 21:40:27 nwalsh Exp $

     DTD for the image-library files used by the Modular DocBook
     Stylesheets.

     Common declaration:
   
     &#60;?xml version='1.0'?&#62;
     &#60;!DOCTYPE image-library 
               PUBLIC "-//Norman Walsh//DTD Image Library 1.0//EN" ""&#62;

     Instances of this DTD are usually XML.
--&#62;

&#60;!-- An image-library is a collection of images --&#62;
&#60;!ELEMENT image-library	(image+)&#62;

&#60;!-- Each image has some number of properties and may have a short --&#62;
&#60;!-- text description and a long test description --&#62;
&#60;!ELEMENT image		(properties?, alttext?, altdesc?)&#62;

&#60;!-- The stylesheets resolve the requested graphic to a filename --&#62;
&#60;!-- and search for an image with that filename in the image --&#62;
&#60;!-- library. Images may refer to each other with 'id' and --&#62;
&#60;!-- 'sameas' attributes. --&#62;
&#60;!ATTLIST image
	filename	CDATA	#REQUIRED
	id		ID	#IMPLIED
	sameas		IDREFS	#IMPLIED
&#62;

&#60;!-- A few image properties are universal, the rest are stored --&#62;
&#60;!-- in HTML-style 'meta' elements. --&#62;
&#60;!ELEMENT properties	(meta*)&#62;
&#60;!ATTLIST properties
	format		(gif|jpeg|png|other)	#IMPLIED
	otherformat	CDATA	#IMPLIED
	width		CDATA	#IMPLIED
	height		CDATA	#IMPLIED
&#62;

&#60;!-- Any additional properties that specify 'imgattr="yes"', --&#62;
&#60;!-- will automatically be copied to the attribute list of --&#62;
&#60;!-- the HTML IMG tag. --&#62;
&#60;!ELEMENT meta EMPTY&#62;
&#60;!ATTLIST meta
	name		CDATA	#REQUIRED
	content		CDATA	#REQUIRED
	imgattr		(yes|no)	"no"
&#62;

&#60;!-- The content of this element will be used as the HTML --&#62;
&#60;!-- 'ALT' text, unless the alt text can be found in the --&#62;
&#60;!-- instance. --&#62;
&#60;!ELEMENT alttext	(#PCDATA)&#62;

&#60;!-- The 'altdesc' is a longer description of the image. --&#62;
&#60;!-- It is not used at this time. --&#62;
&#60;!ELEMENT altdesc	(para+)&#62;
&#60;!ELEMENT para		(#PCDATA)&#62;

&#60;!--EOF--&#62;</PRE
></DIV
><P
>The stylesheets use the filename of the graphic file (either the name
entered in the <CODE
CLASS="SGMLTAG"
>fileref</CODE
> attribute
or the system identifier of the entity in the 
<CODE
CLASS="SGMLTAG"
>entityref</CODE
> attribute) to locate
the appropriate image in the library.</P
></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="AEN24"
>Creating Image Library Files</A
></H1
><P
>At present, the files have to be created by hand. It's easy to imagine
a tool that could scan the graphics and build the file (or at least part
of the file) automatically, but none have been written yet.</P
></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="AEN27"
>Image Library File Location</A
></H1
><P
>The default location for image library files is 
<TT
CLASS="FILENAME"
>imagelib/imagelib.xml</TT
>. Using a subdirectory
allows the image library file to be in XML while the documents may be
in SGML.  If you're formatting XML documents, you can move the image
library into the same directory as your documents.</P
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN31"
>The Catalog Trick</A
></H2
><P
>If you're formatting SGML documents, you have to employ a catalog
trick in order to get Jade to properly parse the image library file.
Add a catalog to the <TT
CLASS="FILENAME"
>imagelib</TT
> directory that
contains the single line:
<PRE
CLASS="SCREEN"
>SGMLDECL "<TT
CLASS="REPLACEABLE"
><I
>path/to/xml.dcl</I
></TT
>"</PRE
></P
><P
>Jade will use that declaration to process all the documents in the
<TT
CLASS="FILENAME"
>imagelib</TT
> directory.</P
></DIV
></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="AEN39"
>Using the Image Library</A
></H1
><P
>You can use the image library in one of two ways:
<P
></P
><OL
TYPE="1"
><LI
><P
>Turn on <TT
CLASS="LITERAL"
>image-library</TT
> in your
stylesheet:
<PRE
CLASS="SCREEN"
>(define image-library #t)</PRE
></P
></LI
><LI
><P
>Use the <CODE
CLASS="OPTION"
>-V image-library</CODE
> option when
you run jade.</P
></LI
></OL
></P
></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="AEN50"
>An Example</A
></H1
><P
>See the examples in the <TT
CLASS="FILENAME"
>test</TT
> directory.</P
></DIV
></DIV
></BODY
></HTML
>