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.
http://activestate.com/activeperl/
ws-make
and 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.cfg
and here is a simple example:
# ------------------------------------------------------------- # The 'BUILD' part, each of these is a command line to be run # ------------------------------------------------------------- do: perl make-page proto index do: perl make-page proto about-us do: perl make-page proto links do: perl make-page proto thanks do: copy blank.html template # ------------------------------------------------------------ # The info needed to make an FTP connection to the Webserver # Ignored unless 'publish' argument specified. # ------------------------------------------------------------ host: www.yourdomain.com user: yourid password: yourpassword homedir: / # ---------------------------------------------------------------- # The 'PUBLISH' part. # Ignored unless 'publish' argument specified. # ---------------------------------------------------------------- put: about-us.html put: contact-us.html put: links.html put: thanks.html ascii: template changedir: images put: logo-250.png binary: logo.png changedir: changedir: docs put: Instructions.doc put: Instructions.rtf
#
|
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. |
do:
|
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 make-page
script with a couple of arguments. See documentation below.
|
host:
|
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'. |
user:
|
This is the user login ID you use for FTP or for Telnet. |
password:
|
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! |
homedir:
|
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. |
put:
|
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. |
ascii:
|
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. |
binary:
|
This will transmit an exact bit-for-bit copy of the file to the Webserver. |
changedir:
|
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
periods, e.g.
changedir: ..
|
make-page
command, though any valid
command recognized by your operating system is okay too.
make-page
takes 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 -->
fixcr
which 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 fixcr
tool 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)
ws-make
make.cfg
make-page
fixcr
make
make publish
make-page
tool 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 make
by itself then won't do anything, but make publish
will
upload all your files and documents while you go fix another cuppa joe...
Copyright © 2009, by H Marc Lewis. All rights reserved.