~ubuntu-branches/ubuntu/trusty/htp/trusty

« back to all changes in this revision

Viewing changes to homepage/ref/use.htp

  • Committer: Bazaar Package Importer
  • Author(s): Diego Escalante Urrelo
  • Date: 2007-10-21 21:59:40 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20071021215940-90qtozny64s4f1rg
Tags: 1.16-2
* Makefile.config: Hardcode /usr as the PREFIX, it was using /usr/local
  otherwise by unknown reasons.
* src/snprintf.c:
* src/snprintf.h: Remove the asnprintf and asprintf functions since they were
keeping s390 from building and are actually not used, closes: #443616.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
 
2
 
 
3
 
<BLOCK syntax>
 
1
<block syntax>
4
2
<use macroname [parameters ...] [noexpand]>
5
3
<... $macroname ...>
6
4
<... ${macroname} ...>
7
 
</BLOCK>
8
 
 
9
 
<BLOCK synopsis>
10
 
 
11
 
<STRONG>USE</STRONG> will expand macros that have been previously
 
5
</block>
 
6
 
 
7
<block synopsis>
 
8
 
 
9
<strong>USE</strong> will expand macros that have been previously
12
10
declared with either <A HREF="set.html">SET</A> or <A
13
11
HREF="block.html">BLOCK</A>.  USE can only be used outside of other
14
12
markup tags.
15
13
 
16
 
<p> Normally the value of expanded block macros will be further parsed
17
 
by htp.  This is maybe not what you want, for example, if the use is
18
 
inside a block which <a href="expand.html">expands</a> itself. You can
19
 
use the noexpand attribute to prevent further expansion.  </p>
 
14
<p> If you USE a block macro the value of expanded block macros will
 
15
be further parsed by htp.  This is maybe not what you want, for
 
16
example, if the use is inside a block which <a
 
17
href="expand.html">expands</a> itself. You can use the noexpand
 
18
attribute to prevent further expansion.  </p>
20
19
 
21
 
<P> USE will accept additional parameters, which are "local" macros
 
20
<p> USE will accept additional parameters, which are "local" macros
22
21
for the expanded macro.  This is only valid for <A
23
22
HREF="block.html">BLOCK</A> macros.  Macros created using <A
24
23
HREF="set.html">SET</A> cannot have parameters passed.  For
25
 
example:</P>
 
24
example:</p>
26
25
 
27
26
<htpcode option="-n">
28
 
<BLOCK stuff>
29
 
  <A HREF=$email>send email</A>
30
 
</BLOCK>
31
 
 
32
 
<SET morestuff=$email>
33
 
 
34
 
This works:     <USE stuff email="jnelson@crl.com">
35
 
But this fails: <USE email>
36
 
And this fails: <USE morestuff email="jnelson@crl.com">
 
27
<block stuff>
 
28
  <a href=$email>send email</a>
 
29
</block>
 
30
 
 
31
<set morestuff=$email>
 
32
 
 
33
This works:     <use stuff email="jnelson@crl.com">
 
34
But this fails: <use email>
 
35
And this fails: <use morestuff email="jnelson@crl.com">
37
36
</htpcode>
38
37
 
39
38
<P>
46
45
Note that the "email" macro is available to other macros or included
47
46
files called within the "stuff" block.
48
47
<P>
49
 
Inside a markup tag, like <A HREF="img.html">IMG</A>, A (anchor), or any
50
 
other standard HTML or htp tag, the '$' operator should be used.  The '$'
51
 
should be immediately followed by the macro name, which may or may not be
52
 
surrounded by curly braces.
 
48
Inside a markup tag, like <a href="img.html">IMG</a>, A (anchor), or
 
49
any other standard HTML or htp tag, the '$' operator must be used.
 
50
The '$' should be immediately followed by the macro name, which may or
 
51
may not be surrounded by curly braces.  When htp encounters this it
 
52
replaces the macro name by the contents of the macro without further
 
53
processing the contents.
53
54
 
54
55
<htpcode option="-n">
55
56
<a href="mailto:$email">mailto hyperlink</a>
72
73
If the '$' macro is surrounded by other text (as in the two examples above),
73
74
quotation marks are not automatically supplied.
74
75
<P>
75
 
Note that a '$' macro can be placed anywhere in a markup tag.  This is valid:
 
76
Note that a '$' macro can be placed anywhere in a markup tag and can
 
77
be nested.  This is valid:
76
78
 
77
79
<htpcode>
78
 
    <${tagName} ${attrName}=${attrValue}>
 
80
    <${tagName} ${attrName}=${value$ctr}>
79
81
</htpcode>
80
 
<P>
 
82
 
 
83
<P> The tagName macro can contain any tag name, even a self-defined
 
84
metatag.  Note that <code>$ctr</code> is expanded before the valueX
 
85
macro is expanded, so assuming that ctr was set to 1 it will expand
 
86
value1.
81
87
 
82
88
</BLOCK>