[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Weave
- From: Gavin Wraith <gavin@...>
- Date: Fri, 3 May 2002 19:50:41 +0100 (BST)
On Fri 03 May, Philippe Lhoste wrote:
> G.C.Wraith made here an announcement of Weave, a tool to generate Web pages,
> made (or at least scripted) with Lua.
> I don't see an e-mail link on his page, so I write here...
That is because I have been getting a lot of spam.
> I have read the Guide, and Weave seems interesting.
> I have downloaded the weave.arc file, but it doesn't seems to be a regular
> (MS-Dos) Arc archive file. Or at least, I cannot open it with the unzippers I
> Then, I discovered that it is aimed at the Acorn Risk platform.
Sorry to correct you - Acorn does not exist anymore. But the operating
system they created, Risc OS, is still a going concern.
> Something that can be seen only by going up on the site,
> it is not indicated in the Weave page, nor in the announcement.
Sorry about that - explanation below.
> So my question is: is it portable? Written in C[++] and/or Lua? Can I have a
> more standard package (zip or gzip or tar for example)?
> Unless it is available as executable only, in this case I suppose I have to
> give up, or to code it myself using the available documentation...
Weave is written in Lua, alright, but portability is nevertheless not
a completely straightforward matter. Let me give you three reasons
1) Lua's 'dofile' is very convenient for breaking up a Lua program
into separate modules. My Risc OS version of Weave splits up
the task of converting a Weave script to HTML files into a module
that is purely generic, having nothing to do with HTML, and a
module that is specific to HTML - or the fragment of HTML that
one wants. But the argument to a 'dofile' is OS-specific,
depending on filenaming conventions. To provide a portable
version I have to eliminate these 'dofile's and conflate
the program to a single file.
2) The Risc OS version outputs to the files named by the Weave PAGE
commands, then uses the 'execute' command to set the filetypes of
these files. This is an OS-specific notion, so these commands
have to be omitted for a portable version.
3) The Risc OS way of launching an application is to double-click
on something with the left mouse button. The Risc OS version of
Weave is an application, !Weave - that is to say, it is a special
sort of directory, containing files called !Boot, !Run, !Help -
all very OS-specific. This application creates a filetype for
Weave scripts and a run-action for this filetype so that double-
clicking a Weave script will launch the lua interpreter with
the appropriate commandline arguments. It is this application
!Weave that is archived on my site, and clearly it is going to
be of no use to anybody not using Risc OS.
I can provide you with a command-line Unix version straightaway.
I have downloaded a precompiled version of the Lua interpreter
for DOS, and once I had realized that it only understood Unix-style
filenames I was able to get Weave to work in a clumsy command-line
fashion in a DOS window on my wife's laptop (Windows XP).
I would like to be able to make it work at the click of a button,
but my knowledge of Windows is insufficient for this.
Maybe you can coach me on how to do this?
For example, suppose that I wanted double-clicking on filenames
with the extension .wve, to have the effect of executing a DOS
%LUADIR%\lua.exe -f %WEAVEDIR%\Weave.lua %FOODIR%/foo.wve
where %LUADIR% is the directory containing the lua interpreter,
%WEAVEDIR% is the directory containing Weave.lua and the file
which has been double-clicked is foo.wve and %FOODIR% is the
Unix-style name of the directory containing it. How do I set that
In Risc OS no special tools are required for this sort assignment
of commands to mouse-actions - it is part of the OS. I looked
in Windows at associating a filetype to an executable, but
that is not exactly what I want - I need to pass the
file's name, translated to Unix conventions, to a command line.
Sorry to be so ignorant, but I have generally avoided having
to do with Microsoft stuff; one tends to get irritated with
what one is not used to, I suppose.
Gavin Wraith (email@example.com)
Home page: http://www.wraith.u-net.com/