InnoTech Consulting Group presents PostPrep & PPCL - the Kixtart BBS script formatter

PostPrep is a tool that prepares your scripts and UDFs for posting to the KORG BBS. 
It reads your code files and wraps HTML tags around the various statements, highlighting 
commands, functions, variables, operators, comments, and other specific components.

PostPrep is a GUI-based utility. With it, you can browse for a file, open it, convert 
it to HTML, preview it, save it as an HTML file, or copy it for pasting directly in 
a KORG BBS post.

PPCL is PostPrep for the Command Line. It works much like PostPrep, but requires at least 
one command-line argument - the name of the file to process. PPCL has two advantages over 
GUI versions of postprep. One is that it can format and copy to the clipboard in one operation, 
the other is its ability to format every kix file in one folder, saving them as .HTM files 
in another folder. This is very useful for pre-formatting an entire library of UDFs automatically.
Both the GUI and Command Line versions use the same configuration files and formatting UDF, so 
they are fully interchangable. In fact, they share much of the core code! PostPrep has extra 
code for the GUI interface, while PPCL uses a few different variables and a command-line 
parsing function.


REQUIREMENTS:

PPCL.KIX requires Kix32.exe, version 4.53 or higher
PostPrep.KXW requires WKix32.exe, version 4.53 or higher, and KixForms Classic 2.3 or higher.


INSTALLATION:
 * Extract the ZIP file to a temporary location
 * Open a command prompt, CD to the folder where you extracted the install files
 * Run SETUP POSTPREP

IMPORTANT NOTE:
Kix32.exe and WKix32.exe are placed in your path. By default, version 4.61 is used. If you
use scripts tokenized with an earlier version and encounter script errors, you have two
choices available to resolve the situation:
 1. CD to the <InstallROOT>\Bin and copy (w)Kix32_4.53.exe to (w)Kix32.exe. This makes
    version 4.53 the default version of Kixtart.
 2. Rename your older scripts to use .K53 extension to run with Kix32_4.53.exe, and/or
    .K53W to launch with WKix32_4.53.exe.
 Your alternative is to re-tokenize the older scripts, although this requires testing and
 potential additional effort.

Both PostPrep.kxw and PPCL.kix will be copied to the <InstallROOT>\Bin folder, along with 
copies of the Kixtart executable. The bin folder will be added to the system path, allowing 
PPCL to be called directly from the command line. A PostPrep shortcut will be added to the 
Start Menu, which will launch the GUI-based PostPrep.

PostPrep GUI is invoked without arguments - you use the GUI to specify your source file, 
output file, and any other processing options.

PPCL can be invoked at the command-line via   PPCL -s:<your_script>   to create 
<your_script>.htm in the current folder. Use the -c switch to copy the resulting 
postprepped code to the clipboard. You will need to enable  "programmatic access 
to the clipboard" in IE's security settings to use this option. 
(IE menu Tools / Internet Options / Security - click "Custom Level" - scroll to Scripting 
and set "Allow Programmatic Clipboard Access" to "Enable" instead of "prompt")

PPCL takes one additional argument to change the name and location of the HTM file. 
Use  -o:<Output_Path>\Output.file  to specify the alternate location and/or name.

PPCL also supports a "-w" switch - all other switches are then ignored. When -W is specified,
the postprep tool finds every .UDF and .KXF file from the defined source folder, postpreps it, and 
generates a corresponding .HTM file in the destination folder. The -W switch is not displayed in the 
usage instructions. The Source and Destination folders are defined in the GLOBAL section of the 
PostPrep.INI file, via the KixSourcePath and HtmDestPath values.

UNINSTALLING:
An automated uninstall process is not available at this time. To uninstall the software and
return your system to its original state, perform the following:
 Delete the <InstallROOT> folder (Program Files\ITCG)
 Edit the System environment variables and remove the entries from PATH and PATHEXT
 Launch RegEdit, browse to HKEY_CLASSES_ROOT and delete the following associations:
	.K53, .K53W, .K61, .K61W, .KIX, .KW, .KX, .KXF, .KXW, and .UDF

CONFIGURATION:

All configuration is done via the PostPrep.ini file. All versions use the same configuration file. 
There are five sections that control operation and formatting of the output. 


GLOBAL
Showstats = Y/N		Should time stats be displayed when complete?
Border = Y/N		Should an HTML border/background be defined around your code?
			If this value is YES, the border format is controled by FieldSet parameters
WordWrap = #		If greater than zero, the column where line wrapping is permitted

These are used only by the PostPrep GUI interface
GUIPathOpen = path	Default path to open source files from, default is "."
GUIPathSave = path	Default path to save HTML files to, default is "."
GUILastSize = H,V	Size of GUI window, in pixels
GUILastLocation = x,y	Coordinates of upper-left window position

These two GLOBAL configuration values are used only by PPCL's -W switch:
KixSourcePath=source path for all Kix files to automatically postprep
HtmDestPath=destination folder for generated HTM files



FORMATTABLE
This section defines the color and Normal/Bold format settings for different data types.
You can use color names or RGB hex values, as per HTML standards. The example INI file 
has two sets of values (one commented out) to illustrate the use of hex and color name values.
CommentsColor=ColorSpec
CommentsBold=Y/N
StringsColor=ColorSpec
StringsBold=Y/N
NumbersColor=ColorSpec
NumbersBold=Y/N
CommandsColor=ColorSpec
CommandsBold=Y/N
MacrosColor=ColorSpec
MacrosBold=Y/N
OperatorsColor=ColorSpec
OperatorsBold=Y/N
VariablesColor=ColorSpec
VariablesBold=Y/N
FunctionsColor=ColorSpec
FunctionsBold=Y/N



FIELDSET
Border-Style = val	HTML argument for the FieldSet tag
Border-Width = #	Width of the border
Background-Color = val	HTML color specificaiton for the background, either Hex RGB or color name
TypeFace = name		Typeface for the text generated. Fixed-width fonts are recommended.
FontSize = #		HTML font size value - 1-7 are valid, 2 or 3 are suggested.


The following sections should not be updated unless Kixtart releases new commands or functions!
Incorrect configuration of these sections could result in improper formatting.



COMMANDS
cmd = #			A list of every Kixtart COMMAND. "#" can simply be 1 (one) or the version in 
			which the command was first available. PPCL ignores this value, but other
			ITCG tools, such as SANITY and KGEN might utilize the version values.
			Any word (outside of comments and strings) matching one of the words in 
			this list will be formatted using COMMAND values.



FUNCTIONS
func = #		A list of every Kixtart built-in FUNCTION, configured exactly as above.
			Any word (outside of comments and strings) matching one of the words in 
			this list will be formatted using FUNCTION values.



