[dev] Re: My take at a static site generator

From: Adrian Grigore <adrian.emil.grigore_AT_gmail.com>
Date: Wed, 11 Dec 2019 21:02:00 +0200

That was my issue, the need to implement things. Along my HTML code, I
also have to implement or include libraries for common functionality.

define(loop,
‘ifelse($2,0,,
‘define(‘$1’,$2)$3‘’loop(‘$1’,decr($2),‘$3’)’)’)
<!doctype html>
<html lang=en>
...

loop(‘i’,10,‘Counter is i’)

vs

<!doctype html>
<html lang=en>
...

#
i = 1
while ...
#!

Also, I think most loops would be on files.

On Wednesday, December 11, 2019, Marc Chantreux <eiro_AT_phear.org> wrote:
>
> On Wed, Dec 11, 2019 at 01:39:38PM +0200, Adrian Grigore wrote:
> > Regarding m4(1) I remember I wasn't a big fan of the dnl macro, no
> > loops and also other goodies sh(1) has to offer.
>
> this paper is worth reading:
>
>     http://www.cs.stir.ac.uk/~kjt/research/pdf/expl-m4.pdf
>
> it demonstrate how to:
>
> * implement loops
> * use divert to avoid lot of dnl usages
>
> regards
> marc
>
Received on Wed Dec 11 2019 - 20:02:00 CET

This archive was generated by hypermail 2.3.0 : Wed Dec 11 2019 - 23:12:09 CET