stephenbrooks.orgThe ArchivePPML 2.0 Parser

PPML 2.0 Parser

PPML stands for "Pre-Processed Markup Language".  The idea behind it is to make writing web pages easier by allowing the user to define their own new tags in terms of old ones with the <tag> tag.  Other features include the ability to include one file into another and search-and-replace.  Brief summaries of what the tags do are given below.  You can also download a PPML version of this site (just the pages - no images or data files) so you can see it in action - if you have any further questions please e-mail me.  This program is commandline-based, so you can run it from an MS-DOS window or a batch file.  It is even fairly easy to add an option on the rightclick context menu to process these files, if you copy the EXE to your Windows directory.

PPML versionTag usageDescription
0.1 <include filename> Includes and parses the file "filename" at the point indicated.  The second part of this tag currently only works as shown: adding quotes around the filename or a trailing slash will cause an error.  However, a # symbol can optionally precede the "include".  This is true of all PPML preprocessed tags. Also, if no filename extension is given, ".ppml" will be assumed first, and then any other match if no PPML files are present.  If no directory path is given, the parser will search the same directory as the file is in.  Both relative and absolute paths are allowed.
1.0 <tag tagname> ...tag definition...  </tag>
<tag name="tagname"> ...tag definition...  </tag>
Defines the new tag <tagname> (where "tagname" can be any name you decide) to be the contents of the "tag definition" section.  Parameters can be used so if &param; appears inside the tag definition section, then that will be replaced by the value of that parameter when <tagname param=value/> is used later on in the file.  The special sequence &; is used to denote the interior of the tag in the definition, so <tagname>Interior</tagname> will be expanded to something containing a copy of "Interior" wherever &; appeared in the definition string.
1.0 <output filename>
<output filename> ...output range...  </output>
(PPML 1.5 or above) <output file="filename">...
Specifies a file to which part of, or the entire rest of the file is written.  A PPML file will typically need at least one such tag.  The same format restrictions apply as with <include> except that when a filename does not contain an extension, it is assumed to be the extension of the output filename, so <output txt> will start outputting the rest of the file to a text file of the same name in the same directory.  Overlapping or nesting these tags will probably not work.
1.5 <replace 1 by="2"> ...replace range...  </replace>
<replace string="1" by="2"> ...replace range...  </replace>
<replace string="1" by="2">
Replaces string "1" by string "2", either in the replacement range, or the entire rest of the file if no closing tag is found.
1.5 <shell> script...  </shell> Executes the lines found in the "shell script" section, executing each command when the parser reaches the end of that line.  This and all other tags may contain user-defined tags which are expanded before the outer tag is processed, so e.g. shell scripts with parameters are possible.
1.6 <ppml:c> ...C code...  «/ppml:c» Because C and other programming languages use the < and > characters for comparing numeric values, this tag changes the characters used for the starts and ends of tags so that PPML will look for tags like «this» and not <this> inside a <ppml:c> region.  Closing tag is not mandatory, but when present must be enclosed in double-chevrons rather than normal angle brackets, or it will be ignored.
1.61 <ppml:php> ...PHP code...  «/ppml:php» Works just like the C code tag, except inserts <?php and ?> where the begin and end tags are.  You may switch out of PHP with ?>...<?php as normal while in the middle of this tag.
2.0 <for (init;cond;incr)>...</for> <while (cond)>...</while> <if (cond)>...</if> <else>...</else> <parse> C statement </parse> <eval> C statement </eval> PPML 2.0 offers some basic programming-style scripting features.  You can declare and set a variable simply by writing <parse>Varname=123</parse> and from then on, any occurrence of 'Varname' in the plain text will be replaced by its value, so choose fairly long names not liable to collisions with other content.
This version also supports appending to an output file using the notation <output file.html mode='append'>.  Other values such as the C/fopen-style 'r+b' are allowed for the string too.

- - - [Download] - - -

PPML 2.0 Parser (.7z file, 11KB; zip file, 15KB).
Use 7-Zip to open .7z files, WinZip files (less compression) provided for compatibility.

PPML source for this site (.7z file, 16KB; zip file, 21KB)., quite an old version.

- - - [Files] - - -

: contact : - - -
E-mail: sbstrudel characterstephenbrooks.orgTwitter: stephenjbrooksMastodon: strudel charactersjbstrudel RSS feed26.06millionaccesses