PerlPoint-Package

 view release on metacpan or  search on metacpan

doc/parser-active-contents.pp  view on Meta::CPAN

\I<embedded> or \I<included> \B<Perl> code \I<at translation time>. Paragraph and input filters
are more types of Active Content.

@|
active part       | description | example
condition         | A paragraph type to control inclusion of all subsequent source parts before the next condition. | \C<\B<?> \$PerlPoint-\>{targetLanguage} eq "HTML">
\I<tag> condition | A special tag option available for all tags which accept options which flags whether the tag should take effect or not.  If Active Contents is \REF{name=Security type=linked}<disabled>, the condition defaults to "false". | \C<\\IM...
embedded Perl     | Perl code embedded into \C<\\EMBED> and \C<\\END_EMBED> tags, marked as Perl by tag option \C<lang> set to \C<"perl">. The code is expected to return a string which will be interpreted as \B<PerlPoint>. | \C<This document was gene...
included Perl     | Perl code read from a file via an \C<\\INCLUDE> tag, marked as Perl by tag option \C<type> set to \C<"perl">. File contents is evaluated like embedded Perl. | \C<\B<\\INCLUDE{type=perl file="included.pl"}>>
input filters     | A special option to \C<\\EMBED> and \C<\\INCLUDE> tags which allows to preprocess embedded code or included files before they are furtherly processed. The filter code may be passed directly or refer to functions defined in \I<embe...
paragraph filters | Calls to functions declared in \I<embedded Perl> (see above) used to modify a complete paragraph and return it for reparsing. Filters are applied by preceeding the target paragraph with the filter call enclosed in \C<\|\|> pairs. ...

  As an introduction example of the active contents feature,
  here is a report about this document: it was generated
  at \EMBED{lang=perl}my @t=(localtime)[3, 4, 5]; sprintf("%d.%d.%d", $t[0], $t[1]+1, $t[2]+1900); \END_EMBED.


==What it is for

Well, honestly spoken, I'm looking forward to the usage people will make of this feature.
But I can already imagine things like

doc/writing-converters-traditional.pp  view on Meta::CPAN

Option files allow to specify Perl script options \I<by files>, so they simply contain what would normally be specified in the commandline. This relieves a user from typing in typical options again and again. It also allows to \I<reuse> options, whic...

  \GREEN<# configure style>
  -style_dir /opt/perlpoint/pp2html/styles
  -style surprise

, to store this file as \C<style.cfg> and to invoke \C<pp2html> as in

  > pp2html \RED<@style.cfg> ...

Option files can be nested and cascaded, and you can use as many of them as you want. It is also possible to use \I<default> option files which do not need to be specified when calling the script but are resolved automatically. They make it very hand...

To provide option file usage, all you have to do is to integrate the following statement.

  \GREEN<# resolve option files>
  argvFile(default=>1, home=>1);

\C<argvFile()> is a function of \C<Getopt::ArgvFile> which was already \XREF{name="Modules to load"}<loaded> and performs three tasks in this call:

# It searches the users home directory for a file named \C<.<converter name\>>, e.g.
  \C<\B<.>pp2sdf>. All options found therein are "unshifted" into \C<@ARGV>. A default



( run in 0.984 second using v1.01-cache-2.11-cpan-49f99fa48dc )