This allows you to keep the 'Master Copy' of your Website files on your desktop or laptop, edit and test them there, and only when you are confident they are production-ready then you can push them up to your Webserver. Of course this means you need some basic working knowledge of HTML and CSS. If you don't have that, this probably isn't for you and I suggest you use one of the many build-your-own-Website tools available on the 'net via a simple Google search. Your ISP (or the place that hosts your Website) quite likely offers such a tool.
ws-makeand it gets invoked by a 'make' script. On OS/X and Linux you can use the built-in 'make' utility, but you'll have to make some other changes (notably, changing the control file's name and writing your own Makefile). If you know what I'm talking about, you'll know what needs to be tweaked to do it that way. Otherwise, just follow along and I'll tell you how to make it work on any system.
The make tool is invoked by a script as shown below:
|MS Windows||Note the "%1" which allows an argument to the 'make' command (necessary for instances when you want to publish your changes).|
|OS/X & Linux||Here the O/S knows that ws-make is a perl script, so the 'perl' isn't necessary. Note the dollar sign instead of the percent sign.|
ws-make. The control file is called
make.cfgand here is a simple example:
||Any blank line, or line beginning with the '#' character is ignored. You can use this to comment your file (as I have done) or to comment out command lines you don't want executed.|
The rest of the line is a command to be executed. It will ALWAYS be executed, even if you
do a 'publish'. In the example above, the perl interpreter is invoked to run the
||This identifies the domain name where you want your pages published. Leave off the http:// prefix. The four lines concerned with the FTP host are not used unless you specify 'publish'.|
||This is the user login ID you use for FTP or for Telnet.|
||This is the password that goes with your user ID. Sorry, I can't hide it as the script needs it in plain text. Note that passwords are generally case-sensitive!|
||Often, once you get FTP'd into your Web host, you need to change into a subdirectory (e.g. 'html', but without the quotes). If that is the case, do that here. If not, just put a single '/' character here.|
||The rest of this line is the name of a file to be uploaded to the Webserver. The file will be transmitted in binary mode. If you don't know what that means, just use 'put:' for all files, and ignore the 'binary:' and 'ascii:' commands.|
||If you know a file is pure ASCII, you can use this command instead of 'put:' and the line-terminators will be translated appropriately as needed. Beware, both Windows and OS/X tools often generate text files (or HTML files) which contain non-ASCII characters.|
||This will transmit an exact bit-for-bit copy of the file to the Webserver.|
This changes the working directory of the tool to the named directory, which
must exist in the current directory on your local machine. If it doesn't exist
on the Webserver, it will be created there.
Use this to descend into an images directory, for example, to copy your image files.
To return to the parent directory, use the command with no argument, or with two
make-pagecommand, though any valid command recognized by your operating system is okay too.
make-pagetakes two arguments, the first is the name of a 'prototype' file. The second is the name of an ascii file that contains the HTML you want blended into the resulting HTML file. For example:
perl make-page myproto index
<!-- INSERT-HERE -->
fixcrwhich takes a single argument which should be an ascii text file (or HTML file). It converts, if necessary, the line terminator(s) of the orignal file to match the convention of your O/S. OS/X and Linux systems use a single 'newline' character, but Windows uses two characters for that: a 'newline' and a 'carriage-return'. So on Windows systems, if you use Notepad on an ascii file that came from a Mac or a Linux system, it will likely all appear to be one long line with no line breaks. The
fixcrtool corrects that. Just run it on any files you need to like this:
perl fixcr somefile
make (for OS/X and Linux)
make.bat (for Windows)
make-pagetool at all and just create your HTML, images, documents and other files some other way. You can still use my tool to publish the results. Just comment out (or leave out entirely) all the "do:" commands. Running
makeby itself then won't do anything, but
make publishwill upload all your files and documents while you go fix another cuppa joe...
Copyright © 2009, by H Marc Lewis. All rights reserved.