Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Writing websites with !Zonk

18 views
Skip to first unread message

Brian Jordan

unread,
Feb 7, 2024, 11:54:35 AMFeb 7
to
I use a program called !Zonk to produce and edit my websites. It is a 20
year old program that continues to work well with one small problem. I
have used the program with several flavours of RICS OS in the main on VA,
I use it now on this Pi courtesy of Aemulor.

The program allows the creation of template files for the look and feel
of the site along with data files for the content. The templates and data
files are text files containing HTML fom which !Zonk builds HTML files
according to instructions encoded in the templates.

The 'one small problem' is in the naming and location of the finished
files and seems to be related to some Regex content within an editable
system file in !Zonk; the relevant stuff seems to be in this segment...

# these default setups create filenames based on the 'leaf' part of the
# datafile name, add /htm and put them in an 'htm' directory below the
# data directory which *must* already exist

oneout: ((?:[^\.]*\.)*)(\w{1,6})[^\.]*$::htm.\2/htm

I seem, at some time, to have managed to edit the entry perhaps to
accomodate long file names.

oneout: ((?:[^\.]*\.)*)([^/\.]+)[^\.]*$::htm.\2/htm

Under my current setup the output doesn't incorporate the leafname (just
/htm)and puts it one directory level above where is intended. Whether
this is a Pi/Aemulor issue or a Regex one isn't clear to me. I wonder if
anyone can provide any insight?

Thanks

--
_____________________________________________________________________

Brian Jordan
brian....@btinternet.com
RISC OS 5.28 (16-Dec-20) on Raspberry Pi
_____________________________________________________________________

Martin

unread,
Feb 7, 2024, 12:54:05 PMFeb 7
to
In article <5b2f0c4fb2b...@btinternet.com>,
Do you have some examples of the string that is being searched, and
the results?

--
Martin Avison
Note that unfortunately this email address will become invalid
without notice if (when) any spam is received.

Brian Jordan

unread,
Feb 8, 2024, 8:33:26 AMFeb 8
to
In article <5b2f11d2...@avisoft.f9.co.uk>,
Martin <New...@avisoft.f9.co.uk> wrote:

[Snip]

> Do you have some examples of the string that is being searched, and
> the results?

In VA with RISC OS 4.39

<any$Dir>index/txt (the searched string) is combined with
<any$Dir>template/text to produce <any$Dir>.htm.index/html (the output
string).

On this Pi with RO 5.28 and Aemulor

<any$Dir>index/txt is combined with <any$Dir>template/text to produce
<any$Dir>/html (the result). The leaf name hasn't been translated and the
output is in the wrong directory.
B

Martin

unread,
Feb 8, 2024, 12:44:50 PMFeb 8
to
In article <5b2f7dc406b...@btinternet.com>,
Brian Jordan <brian....@btinternet.com> wrote:
> In article <5b2f11d2...@avisoft.f9.co.uk>,
> Martin <New...@avisoft.f9.co.uk> wrote:
> [Snip]

> > Do you have some examples of the string that is being searched,
> > and the results?

> In VA with RISC OS 4.39

> <any$Dir>index/txt (the searched string) is combined with
> <any$Dir>template/text to produce <any$Dir>.htm.index/html (the
> output string).

> On this Pi with RO 5.28 and Aemulor

> <any$Dir>index/txt is combined with <any$Dir>template/text to
> produce <any$Dir>/html (the result). The leaf name hasn't been
> translated and the output is in the wrong directory.

It seems that it may use Regex, but that will AFAIK just produce a
part of the input string which matches the search, or no match. It
does not 'combine' things. There must be other processing doing that.

Does Zonk use the Regex module? If so, which version?
What language is Zonk written in? Is source available?

I do have a no-quite-finished test harness here for the Regex module,
and certainly neither of your search strings seem to match a typical
full filename. But there are many Syntax option bits for the Regex
module, and we would need to know what settings are being used.

Martin

Brian Jordan

unread,
Feb 8, 2024, 2:19:45 PMFeb 8
to
In article <5b2f94bb...@avisoft.f9.co.uk>,
The program is written in C with a small Basic front end <deskzonk> for
RISC OS. The core program does the combining of the data and templates
and finally outputs the combined file ready to FTP. Intrigued by your
comment I RMkilled the Regex module and Zonk works without it so whatever
is going on seems to be entirely within Zonk. There is documentation
which relates to Regex but doesn't explain where and how to use it.
I shall explore further, I have just installed and re-registered an old
VA and will play with the program there, perhaps this is the point to end
the NG discussion for the time being.

Meanwhile it is this program which enabled me to produce and maintain
clubmans.org.uk with its many pages and I'd hate to be without it and
would love to get it running fully on this Pi.

Martin

unread,
Feb 8, 2024, 4:15:05 PMFeb 8
to
In article <5b2f9d84eeb...@btinternet.com>,
Brian Jordan <brian....@btinternet.com> wrote:
> In article <5b2f94bb...@avisoft.f9.co.uk>,
> Martin <New...@avisoft.f9.co.uk> wrote:
> > In article <5b2f7dc406b...@btinternet.com>,

[Snip]

> The program is written in C with a small Basic front end <deskzonk>
> for RISC OS. The core program does the combining of the data and
> templates and finally outputs the combined file ready to FTP.
> Intrigued by your comment I RMkilled the Regex module and Zonk
> works without it so whatever is going on seems to be entirely
> within Zonk. There is documentation which relates to Regex but
> doesn't explain where and how to use it. I shall explore further, I
> have just installed and re-registered an old VA and will play with
> the program there, perhaps this is the point to end the NG
> discussion for the time being.

Probably uses some Regex library - possibly the one used by the Regex
module, which there are StrongHelp manual for, if they are any help.
See http://kappa.me.uk/regex.htm for downloads.

> Meanwhile it is this program which enabled me to produce and
> maintain clubmans.org.uk with its many pages and I'd hate to be
> without it and would love to get it running fully on this Pi.

I suspect the difference is some subtle difference in the filing
systems - HostFS is not fully 'normal' I think - but at least it works
on it!

Matthew Phillips

unread,
Feb 9, 2024, 4:56:20 PMFeb 9
to
In message <5b2f0c4fb2b...@btinternet.com>
on 7 Feb 2024 Brian Jordan wrote:

> I use a program called !Zonk to produce and edit my websites.

[snip]

> The 'one small problem' is in the naming and location of the finished
> files and seems to be related to some Regex content within an editable
> system file in !Zonk; the relevant stuff seems to be in this segment...

> # these default setups create filenames based on the 'leaf' part of the
> # datafile name, add /htm and put them in an 'htm' directory below the
> # data directory which *must* already exist

> oneout: ((?:[^\.]*\.)*)(\w{1,6})[^\.]*$::htm.\2/htm

> I seem, at some time, to have managed to edit the entry perhaps to
> accomodate long file names.

> oneout: ((?:[^\.]*\.)*)([^/\.]+)[^\.]*$::htm.\2/htm

> Under my current setup the output doesn't incorporate the leafname (just
> /htm)and puts it one directory level above where is intended. Whether
> this is a Pi/Aemulor issue or a Regex one isn't clear to me. I wonder if
> anyone can provide any insight?

Those regular expressions look like they're written in Perl-compatible
syntax. Try looking up PCRE, an open source library which has been
incorporated in PHP and a number of other languages to provide advanced
regular expression support. (PCRE was developed by the same person as the
RISC OS music typesetting system PMS.)

From what you have above, it looks like the part before the "::" is the
pattern to match, and the part after is what to do with it.

The part that goes
((?:[^\.]*\.)*)
will match any a sequence of strings consisting of
[^\.]* -- any number of non-full-stop characters (including zero)
\. -- a full stop

So it would match, for example:
ADFS::HardDisc4.$.This.That.Other.

The second part differs in your two examples. In the first, it matches
between 1 and 6 "word character", i.e. A-Z, a-z, 0-9 or underscore. In the
rewritten example it matches as many characters as possible (minimum 1)
that are not full stop or slash. This part is captured and becomes \2 in
the replacement text.

The final part matches any number of non-full-stop characters, with an
insistence that we reach the end of the string.

The effect is that \2 will match the leafname, excluding any part at the
end of it (if any) introduced with a slash.

I am afraid I have no idea why the program would work differently on the
Pi from on VA. You could try simplifying the expression a bit and see if
that helps. For example:

oneout: ^(.*\.)?([^/\.]+)[^\.]*$::htm.\2/htm

should have the same effect.

--
Matthew Phillips
Durham

Brian Jordan

unread,
Feb 10, 2024, 6:10:34 AMFeb 10
to
In article <6ee32f305...@sinenomine.co.uk>,
Matthew Phillips <spam...@yahoo.co.uk> wrote:
> In message <5b2f0c4fb2b...@btinternet.com>
> on 7 Feb 2024 Brian Jordan wrote:

> > I use a program called !Zonk to produce and edit my websites.

[Snip]

> Those regular expressions look like they're written in Perl-compatible
> syntax. Try looking up PCRE, an open source library which has been
> incorporated in PHP and a number of other languages to provide advanced
> regular expression support. (PCRE was developed by the same person as
> the RISC OS music typesetting system PMS.)

It seems you are right, digging through the documentation I have found
the,long forgotten by me, relevant document, see it at
<www.bjordan.org.uk/docs/regex.htm>. It looks like I have some revision
to do!

[Snip your insights into Regex]

> I am afraid I have no idea why the program would work differently on
> the Pi from on VA.

It seems RISC OS 5.28 on the Pi has a Regex module whereas RISC OS 4.39
on VA doesn't. Maybe some sort of clash on the Pi? I'm going to
investigate further.

> You could try simplifying the expression a bit and see if that helps.
> For example:

> oneout: ^(.*\.)?([^/\.]+)[^\.]*$::htm.\2/htm

> should have the same effect.

Oooh. This is helpful, although the output is /htm it is now in the
expected folder. Off to investigate...

Martin

unread,
Feb 10, 2024, 7:23:57 AMFeb 10
to
In article <5b3078502ab...@btinternet.com>,
Brian Jordan <brian....@btinternet.com> wrote:
> > I am afraid I have no idea why the program would work differently
> > on the Pi from on VA.

> It seems RISC OS 5.28 on the Pi has a Regex module whereas RISC OS
> 4.39 on VA doesn't. Maybe some sort of clash on the Pi? I'm going
> to investigate further.

As you seem to have previously proved Zonk works without the Regex
module loaded, I think whether it is on the machine or not is
irrelevant. Zonk seems to have the Regex processing code within
itself.
0 new messages