File: spcattr.html

package info (click to toggle)
hsc 0.916-2
  • links: PTS
  • area: main
  • in suites: hamm, slink
  • size: 2,584 kB
  • ctags: 2,277
  • sloc: ansic: 17,375; makefile: 396
file content (269 lines) | stat: -rw-r--r-- 13,155 bytes parent folder | download
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>hsc - Features - Special Attributes</TITLE>
<LINK REV="owns" TITLE="Thomas Aglassinger" HREF="mailto:agi@giga.or.at">
<LINK REL="Next" HREF="strip.html">
<LINK REL="Copyright" HREF="../copy.html">
<LINK REL="Previous" HREF="getsize.html">
<META name="ROBOTS" content="NOINDEX, NOFOLLOW">
</HEAD>
<BODY>
<A HREF="../index.html"><IMG SRC="../image/main.gif" ALT="Contents" ALIGN="middle" WIDTH="70" HEIGHT="16"></A>
<IMG SRC="../image/noindex.gif" ALT="-----" ALIGN="middle" WIDTH="70" HEIGHT="16">
<A HREF="../copy.html"><IMG SRC="../image/copy.gif" ALT="Copyright" ALIGN="middle" WIDTH="70" HEIGHT="16"></A>
<A HREF="../index.html"><IMG SRC="../image/back.gif" ALT="Up" ALIGN="middle" WIDTH="70" HEIGHT="16"></A>
<A HREF="getsize.html"><IMG SRC="../image/prev.gif" ALT="Previous" ALIGN="middle" WIDTH="70" HEIGHT="16"></A>
<A HREF="strip.html"><IMG SRC="../image/next.gif" ALT="Next" ALIGN="middle" WIDTH="70" HEIGHT="16"></A>
<HR>
<H1>Special Attributes</H1>
<P><KBD>Hsc</KBD> adds some special attributes, which can be quite useful to
include special data or configure the parser.</P>
<UL>
<LI><A HREF="#anchor"><CODE>Hsc.Anchor</CODE></A> - destination URI of last anchor
<LI><A HREF="#clickhere"><CODE>Hsc.Click-Here</CODE></A> - keywords for "click here"-syndrome
<LI><A HREF="#colornames"><CODE>Hsc.Color-Names</CODE></A> - values to be used as colors-names
<LI><A HREF="#colornames"><CODE>Hsc.Content</CODE></A> - content text of current container macro
<LI><A HREF="#documentattr"><CODE>Hsc.Document.Name</CODE></A> - filename of html-object
<LI><A HREF="#documentattr"><CODE>Hsc.Document.Path</CODE></A> - directory part of html-object
<LI><A HREF="#documentattr"><CODE>Hsc.Document.URI</CODE></A> - full relative URI of html-object
<LI><A HREF="#exec.result"><CODE>Hsc.Exec.Result</CODE></A> - return-code of command invoked by <A HREF="exec.html"><CODE>&lt;$exec&gt;</CODE></A>
<LI><A HREF="#lf"><CODE>Hsc.LF</CODE></A> - a single linefeed-character
<LI><A HREF="#sourceattr"><CODE>Hsc.Source.Name</CODE></A> - filename of hsc-source
<LI><A HREF="#sourceattr"><CODE>Hsc.Source.Path</CODE></A> - directory part of hsc-source
<LI><A HREF="#sourceattr"><CODE>Hsc.Source.File</CODE></A> - full path and filename of hsc-source
<LI><A HREF="#system"><CODE>Hsc.System</CODE></A> - value depending on operating system
<LI><A HREF="#format.filesize"><CODE>Hsc.Format.Filesize</CODE></A> - how to render <A HREF="expressions.html#getfilesize"><CODE>GetFileSize()</CODE></A>
<LI><A HREF="#format.time"><CODE>Hsc.Format.Time</CODE></A> - how to render <A HREF="expressions.html#gettime"><CODE>GetTime()</CODE></A> and <A HREF="expressions.html#getgmtime"><CODE>GetGMTime()</CODE></A>
<LI><A HREF="#tmp"><CODE>Hsc.TMP.*</CODE></A> - temporary attributes for internal use
</UL>
<H2>Attributes Containing Special Data</H2>
<H3><A NAME="anchor">Hsc.Anchor</A></H3>
<P>This attribute is defined internally during startup and is maintained
by <KBD>hsc</KBD>. It contains the URI of the last anchor referenced to.</P>
<STRONG>Example:</STRONG>

<PRE>For updates, take a look at the
&lt;A HREF="http://www.giga.or.at/~agi/hsc/"&gt;hsc-support-page&lt;/A&gt;
at &lt;STRONG&gt;&lt;(HSC.ANCHOR)&gt;&lt;/STRONG&gt;.
</PRE>
will be converted to:
<BLOCKQUOTE>
For updates, take a look at the
<A HREF="http://www.giga.or.at/~agi/hsc/">hsc-support-page</A>
at <STRONG>http://www.giga.or.at/~agi/hsc/</STRONG>.
</BLOCKQUOTE>
<H3><A NAME="content">Hsc.Content</A></H3>
<P>This attribute is defined internally during startup and is
maintained by <KBD>hsc</KBD>. It contains the the text which will be inserted
if a <CODE>&lt;$content&gt;</CODE> shows up, and is updated at every call to a
container macro.
<H3><A NAME="documentattr"> Hsc.Document.Name, Hsc.Document.Path, Hsc.Document.URI</A></H3>
<P>These attributes are defined internally during startup and are read-only.
They contain the filename, the directory and the whole
relative URI of the to be created html-object.</P>
For example,
<PRE>
    hsc FROM people/hugo.hsc TO html:my_project/
</PRE>
will lead to
<TABLE BORDER="1">
<TR>
<TH>attribute</TH>
<TH>value</TH>
</TR>
<TR>
<TD>Hsc.Document.Name</TD>
<TD>"hugo.html"</TD>
</TR>
<TR>
<TD>Hsc.Document.Path</TD>
<TD>"people/"</TD>
</TR>
<TR>
<TD>Hsc.Document.URI</TD>
<TD>"people/hugo.html"</TD>
</TR>
</TABLE>
Note that <CODE>Hsc.Document.Path</CODE> does not contain the whole
destination directory, but only the relative path.
<H3><A NAME="exec.result">Hsc.Exec.Result</A></H3>
This attribute contains the return-code of the command invoked
using <A HREF="exec.html"><CODE>&lt;$exec&gt;</CODE></A>. It is updated after every call of this hsc-tag.
<H3><A NAME="lf">Hsc.LF</A></H3>
This attribute contains a single linefeed-character
(``<CODE>\n</CODE>'') and can be used to include linefeeds into
attribute-values without <KBD>hsc</KBD> whining about them.
<H3><A NAME="sourceattr">Hsc.Source.Name, Hsc.Source.Path, Hsc.Source.File</A></H3>
<P>These attributes are defined internally during startup and are
read-only. They contain the filename, the directory and the full path
and filename of the hsc-source you have specified when invoking
<KBD>hsc</KBD>.</P>
For example,

<PRE>hsc FROM people/hugo.hsc TO html:my_project/</PRE>
will lead to
<TABLE BORDER="1">
<TR>
<TH>attribute</TH>
<TH>value</TH>
</TR>
<TR>
<TD>Hsc.Source.Name</TD>
<TD>"hugo.hsc"</TD>
</TR>
<TR>
<TD>Hsc.Source.Path</TD>
<TD>"people/"</TD>
</TR>
<TR>
<TD>Hsc.Source.File</TD>
<TD>"people/hugo.hsc"</TD>
</TR>
</TABLE>
<H3><A NAME="system">Hsc.System</A></H3>
<P>This attribute is defined internally during startup and is
read-only. It contains a value depending on the operating
system <KBD>hsc</KBD> is running on.</P>
<TABLE BORDER="1">
<TR>
<TH>OS</TH>
<TH><CODE>Hsc.System</CODE></TH>
</TR>
<TR>
<TD>AmigaOS</TD>
<TD>AMIGA</TD>
</TR>
<TR>
<TD>RiscOS</TD>
<TD>RISCOS</TD>
</TR>
<TR>
<TD>BeOS</TD>
<TD>BEOS</TD>
</TR>
<TR>
<TD>NextStep</TD>
<TD>NEXTSTEP</TD>
</TR>
<TR>
<TD>Unixoid</TD>
<TD>UNIX</TD>
</TR>
</TABLE>
This can be useful if you are executing a shell-command during
conversion. See <A HREF="exec.html"><CODE>&lt;$exec&gt;</CODE></A> for an example how to include a
listing of the current directory, working with more then only
a specific OS.
<H3><A NAME="tmp">Hsc.TMP.*</A></H3>
<P>For several tasks, <KBD>hsc</KBD> declares it's own temporary attributes for
internal use. Most of them you can not use inside your own
expressions. The only reason why I list them here is, that some of
them might show up in messages.</P>
<P>For example, if you are using the special tag <A
HREF="spctags.html#expression">&lt;(...)&gt;</A> (insert expression),
<KBD>hsc</KBD> creates an attribute <CODE>Hsc.TMP.insert.expression</CODE> to
assign the value of the expression you passed between the brackets. If
this expression contains errors, you will achieve a message mentioning
the attribute <CODE>Hsc.TMP.insert.expression</CODE>.</P>
<H2>Attributes for configuration</H2>
<H3><A NAME="colornames">Hsc.Color-Names</A></H3>
<P>This attribute is defined in <I>hsc.prefs</I> and can be altered to the
user's needs. However, it's value is scanned only once (immediately
after processing <I>hsc.prefs</I> and later changes will not be recognised
by <KBD>hsc</KBD>.</P>
<P>For attributes of type
<A HREF="../macro/attrib.html#type"><CODE>COLOR</CODE></A>,
you can not only use the
cryptic <CODE>#rrggbb</CODE>-style, but also use some predefined
values. With this attribute you can declare which values <KBD>hsc</KBD> should
know about, each separated by a vertical bar (``<CODE>|</CODE>'').</P>
<STRONG>Example:</STRONG>
&lt;$define Hsc.Color-Names:string/c="aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|purple|red|silver|teal|white|yellow"&gt;
<P>This one contains all values recommended for html-0.32 and is in
the <I>hsc.prefs</I> that came with this distribution.</P>
<H3><A NAME="clickhere">Hsc.Click-Here</A></H3>
<P>This attribute is defined in <I>hsc.prefs</I> and can be altered to the
user's needs. However, it's value is only scanned once and later
changes will not be recognised by <KBD>hsc</KBD>.</P>
Inside an anchor tag (<CODE>&lt;A HREF="..."&gt;</CODE>), the normal text is
scanned for special keywords indicating a ``click here''-syndrome.
With this attribute you can declare these keywords,
each separated by a vertical bar (``<CODE>|</CODE>'').
<STRONG>Example:</STRONG>
<PRE>&lt;$define Hsc.Click-Here:string/c="click|here"&gt;</PRE>
<P>When processing German documents, probably this one would
fit better:</P>
<PRE>&lt;$define Hsc.Click-Here:string/c="klicken|hier"&gt;</PRE>
<H3><A NAME="format.filesize">Hsc.Format.Filesize</A></H3>
This attribute contains a template that descibes how the result
of <A HREF="expressions.html#getfilesize"><CODE>GetFileSize()</CODE></A> should be rendered. Conversion specifications:

<PRE>
    <STRONG>%b</STRONG>    is replaced by the filesize in bytes.
    <STRONG>%k</STRONG>    is replaced by the filesize in kilo-bytes.
    <STRONG>%m</STRONG>    is replaced by the filesize in mega-bytes.
    <STRONG>%g</STRONG>    is replaced by the filesize in giga-bytes.
    <STRONG>%a</STRONG>    is replaced by the filesize, with a reasonable unit computed automatically
    <STRONG>%u</STRONG>    is replaced by the unit for <STRONG>%a</STRONG>
</PRE>
This attribute is defined internally during startup, and contains the
value <CODE>"%a%u"</CODE>, leading to results like <CODE>"123K"</CODE> or
<CODE>"12M"</CODE>. It can be changed by the user at any time.
<H3><A NAME="format.time">Hsc.Format.Time</A></H3>
This attribute contains a template that describes how the result
of <A HREF="expressions.html#gettime"><CODE>GetTime()</CODE></A> and <A HREF="expressions.html#getgmtime"><CODE>GetGMTime()</CODE></A> should be rendered.
Conversion specifications
(Techn. Note: These are the same as for ANSI-C's <CODE>strftime()</CODE>):
<PRE>
    <STRONG>%A</STRONG>    is replaced by the full weekday name.
    <STRONG>%a</STRONG>    is replaced by the abbreviated weekday name, where the abbreviation
           is the first three characters.
    <STRONG>%B</STRONG>    is replaced by the full month name.
    <STRONG>%b or %h</STRONG>
           is replaced by the abbreviated month name, where the abbreviation
           is the first three characters.
    <STRONG>%C</STRONG>    is equivalent to ``%a %b %e %H:%M:%S %Y''
    <STRONG>%c</STRONG>    is equivalent to ``%m/%d/%y''.
    <STRONG>%D</STRONG>    is replaced by the date in the format ``mm/dd/yy''.
    <STRONG>%d</STRONG>    is replaced by the day of the month as a decimal number (01&shy;31).
    <STRONG>%e</STRONG>    is replaced by the day of month as a decimal number (1&shy;31); single
           digits are preceded by a blank.
    <STRONG>%H</STRONG>    is replaced by the hour (24&shy;hour clock) as a decimal number
           (00&shy;23).
    <STRONG>%I</STRONG>    is replaced by the hour (12&shy;hour clock) as a decimal number
           (01&shy;12).
    <STRONG>%j</STRONG>    is replaced by the day of the year as a decimal number (001&shy;366).
    <STRONG>%k</STRONG>    is replaced by the hour (24&shy;hour clock) as a decimal number (0&shy;23);
           single digits are preceded by a blank.
    <STRONG>%l</STRONG>    is replaced by the hour (12&shy;hour clock) as a decimal number (1&shy;12);
           single digits are preceded by a blank.
    <STRONG>%M</STRONG>    is replaced by the minute as a decimal number (00&shy;59).
    <STRONG>%m</STRONG>    is replaced by the month as a decimal number (01&shy;12).
    <STRONG>%n</STRONG>    is replaced by a newline.
    <STRONG>%p</STRONG>    is replaced by either ``AM'' or ``PM'' as appropriate.
    <STRONG>%R</STRONG>    is equivalent to ``%H:%M''
    <STRONG>%r</STRONG>    is equivalent to ``%I:%M:%S %p''.
    <STRONG>%t</STRONG>    is replaced by a tab.
    <STRONG>%S</STRONG>    is replaced by the second as a decimal number (00&shy;60).
    <STRONG>%s</STRONG>    is replaced by the number of seconds since the Epoch, UCT.
    <STRONG>%T or %X</STRONG>    
           is equivalent to ``%H:%M:%S''.
    <STRONG>%U</STRONG>    is replaced by the week number of the year (Sunday as the first day
           of the week) as a decimal number (00&shy;53).
    <STRONG>%W</STRONG>    is replaced by the week number of the year (Monday as the first day
           of the week) as a decimal number (00&shy;53).
    <STRONG>%w</STRONG>    is replaced by the weekday (Sunday as the first day of the week) as
           a decimal number (0&shy;6).
    <STRONG>%x</STRONG>    is equivalent to ``%m/%d/%y %H:%M:%S''.
    <STRONG>%Y</STRONG>    is replaced by the year with century as a decimal number.
    <STRONG>%y</STRONG>    is replaced by the year without century as a decimal number
           (00&shy;99).
    <STRONG>%Z</STRONG>    is replaced by the time zone name.
    <STRONG>%%</STRONG>    is replaced by ``%''.
</PRE>
This attribute is defined internally during startup, and contains the
value ``<CODE>%d-%b-%Y, %H:%M</CODE>'', leading to results like
<CODE>"12-Jan-1998, 04:39</CODE>".
<BR>
</BODY></HTML>