Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Nicolas Wavrant
ZODB
Commits
08367e07
Commit
08367e07
authored
Dec 04, 2002
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better explanation of %define.
parent
cc5b417a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
4 deletions
+34
-4
doc/ZConfig/zconfig.tex
doc/ZConfig/zconfig.tex
+34
-4
No files found.
doc/ZConfig/zconfig.tex
View file @
08367e07
...
...
@@ -180,16 +180,46 @@ sections:
\subsection
{
Textual Substitution in Values
}
XXX Explain
\keyword
{
\%
define
}
and
\$
-substitution here.
\module
{
ZConfig
}
provides a limited way to re-use portions of a value
using simple string substitution. To use this facility, define named
bits of replacement text using the
\keyword
{
\%
define
}
directive, and
reference these texts from values.
In this example, the value for the
\code
{
key
}
will evaluate to
The syntax for
\keyword
{
\%
define
}
is:
\begin{alltt}
%define \var{name} \optional{\var{value}}
\end{alltt}
The value of
\var
{
name
}
must be a sequence of letters, digits, and
underscores, and may not start with a digit. If
\var
{
value
}
is
omitted, it will be the empty string. If given, there must be
whitespace between
\var
{
name
}
and
\var
{
value
}
;
\var
{
value
}
will not
include any whitespace on either side, just like values from key-value
pairs.
Names must be defined before they are used, and may not be
re-defined. All names are associated with the source text in which
they are defined, so distinct sources which are referenced using
\keyword
{
\%
import
}
or
\keyword
{
\%
include
}
are not affected by
definitions created by the resource being parsed.
References to defined names from configuration values use the syntax
described for the
\refmodule
{
ZConfig.Substitution
}
module.
Configuration values which include a
\character
{
\$
}
as part of the
actual value will need to use
\code
{
\$\$
}
to get a single
\character
{
\$
}
in the result.
The values of defined names are not processed in any way, and may not
contain references to named definitions.
For example, the value for the
\code
{
key
}
will evaluate to
\code
{
value
}
:
\begin{verbatim}
%define name value
key
$
name
\end
{
verbatim
}
%$
\end
{
verbatim
}
%$
<-- bow to font-lock
\section
{
\module
{
ZConfig
}
---
Basic configuration support
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment