• Writing websites with !Zonk

    From Brian Jordan@21:1/5 to All on Wed Feb 7 16:53:19 2024
    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
    [email protected]
    RISC OS 5.28 (16-Dec-20) on Raspberry Pi _____________________________________________________________________

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Martin@21:1/5 to Brian Jordan on Wed Feb 7 17:53:33 2024
    In article <[email protected]>,
    Brian Jordan <[email protected]> wrote:
    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

    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Brian Jordan@21:1/5 to Martin on Thu Feb 8 13:32:32 2024
    In article <[email protected]>,
    Martin <[email protected]> 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

    --
    _____________________________________________________________________

    Brian Jordan
    [email protected]
    RISC OS 5.28 (16-Dec-20) on Raspberry Pi _____________________________________________________________________

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Martin@21:1/5 to Brian Jordan on Thu Feb 8 17:43:23 2024
    In article <[email protected]>,
    Brian Jordan <[email protected]> wrote:
    In article <[email protected]>,
    Martin <[email protected]> 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

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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Brian Jordan@21:1/5 to Martin on Thu Feb 8 19:19:22 2024
    In article <[email protected]>,
    Martin <[email protected]> wrote:
    In article <[email protected]>,
    Brian Jordan <[email protected]> wrote:
    In article <[email protected]>,
    Martin <[email protected]> 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.

    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.

    B

    --
    _____________________________________________________________________

    Brian Jordan
    [email protected]
    RISC OS 5.28 (16-Dec-20) on Raspberry Pi _____________________________________________________________________

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Martin@21:1/5 to Brian Jordan on Thu Feb 8 21:01:01 2024
    In article <[email protected]>,
    Brian Jordan <[email protected]> wrote:
    In article <[email protected]>,
    Martin <[email protected]> wrote:
    In article <[email protected]>,

    [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!

    Martin

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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Matthew Phillips@21:1/5 to All on Fri Feb 9 21:58:07 2024
    In message <[email protected]>
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Brian Jordan@21:1/5 to Matthew Phillips on Sat Feb 10 11:09:11 2024
    In article <[email protected]>,
    Matthew Phillips <[email protected]> wrote:
    In message <[email protected]>
    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...

    Thanks

    --
    _____________________________________________________________________

    Brian Jordan
    [email protected]
    RISC OS 5.28 (16-Dec-20) on Raspberry Pi _____________________________________________________________________

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Martin@21:1/5 to Brian Jordan on Sat Feb 10 12:23:27 2024
    In article <[email protected]>,
    Brian Jordan <[email protected]> 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.

    Martin

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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)