First you must have MacPerl. You can find it at your favourite info-mac mirror in
/info-mac/dev/mac-perl-418.hqx
It is recommendable to save this script as System 6 or System 7 runtime from MacPerl. There's a bug in
my MacPerl version (4.1.8 PPC). When you run the script from MacPerl, it won't come up with a
choosefile-dialog to open your setext document, unless you did not save it after a modication.
When you save it as System 6 or System 7 runtime, you can drop text files on it. You will then be asked to choose a name for the new output file. When the script is started without input files, you will be asked to pick one.
If you parse large files, the script can use a large amount of memory. Make sure to adjust memory
requirements.
Do I need to configure it?
By default the script
- creates one output file for each input file it was given.
- runs in verbose mode.
- parses urls and mail addresses.
If you are happy with that you don't have to read further.
How do I configure it?
The script is already setup to be runned on a Mac, however there are some default settings you can change.
I'd rather do this by using an AppleScript but I couldn't find the time to do that yet. If someone else does, I'd realy like to know about it.
You can find the settings after this line in the script:
#_______ OPTIONS _______
Translating email addresses
The script can translate email addresses to the HTML 'mailto:' tag.
This option is enabled by default. If you don't want this, then change the line
$DO_MAIL = 1;
to
$DO_MAIL = 0;
Translating url's
The script can translate urls to HTML url references.
This option is enabled by default. If you don't want this, then change the line
$DO_URL = 1;
to
$DO_URL = 0;
Verbose mode
By default the script runs in verbose mode. If you are not generating multiple output files, there's nothing much to see, so you might want to disable it.
If you are generating multiple output files, the script shows you which chapter is being parsed.
You can disable verbose mode by changing the folowing line in the script
$VERBOSE = 1;
to
$VERBOSE = 0;
Generating multiple output files
If you want to generate multiple output files based on title-tt's, then change
the line
$SPLIT_ON_CHAPTERS=0;
to
$SPLIT_ON_CHAPTERS=1;
title-tt's can be recognized as:
This is a title-tt
==================
Remember, if you want to be able to do this, the first 2 lines in the document must be title-tt.
Specifing the prefixes for output files
When generating multiple output files, an overview file will be created in the same directory as the rest of the output files. This file holds references to these output files. The default prefix is "index", so the overview file becomes "index.html"
You can change "index" in the folowing line in the script to something more suitable for your system.
$INDEX_FILE_PREFIX="index";
The other output files have "ch-" as prefix by default, so output files will be named "ch-1.html", "ch-2.html" etc.
You can change "ch-" in the folowing line in the script to something more suitable for your needs.