substify(n) 0.1 "Text expander for later use in subst command"

NAME

substify - Text expander for later use in subst command

TABLE OF CONTENTS

    TABLE OF CONTENTS
    SYNOPSIS
    DESCRIPTION
    COMMAND
    EXAMPLES
    SEE ALSO
    KEYWORDS
    COPYRIGHT

SYNOPSIS

package require Tcl 8.4
package require substify::substify ?1.0?

substify::substify string beginstr endstr

DESCRIPTION

This package allows parsing templates that include Tcl code embedded inside non-Tcl information.

The behavior is similar to textutil::expander, but the purpose is that it is converted once and can then be passed to subst multiple times.

COMMAND

substify::substify string beginstr endstr
Converts a string so that it can be passed to subst. It escapes the string outside commands and passes the commands so that the parsing is similar to PHP or ASP/ADP parsers. The behavior is similar to textutil::expander, but the purpose is that it is converted once and can then be passed to subst multiple times. Parameter string is the string to be parsed. Beginstr is the string that begins a command. Endstr is the string that ends a command.

EXAMPLES

 
# small substify example
package require substify

puts [subst [substify::substify {1 + 1 = <%expr {1+1}%>.
Platform is <%=$tcl_platform(platform)%>.} "<%" "%>"]]
1 + 1 = 2.
Platform is windows.

SEE ALSO

substify_browser, substify_configgui

KEYWORDS

log, substify

COPYRIGHT

Copyright © 2006 Wojciech Kocjan <wojciech.kocjan@dq.pl>