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

2019-12-11 Thread Adrian Grigore
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’)’)’)


...

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

vs



...

#
i = 1
while ...
#!

Also, I think most loops would be on files.

On Wednesday, December 11, 2019, Marc Chantreux  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
>



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

2019-12-11 Thread Marc Chantreux
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



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

2019-12-11 Thread Adrian Grigore
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.

Markdown is simple with pp(1). Just

#!
  smu file.md
#!

https://github.com/Gottox/smu

On Tuesday, December 10, 2019, Laslo Hunhold  wrote:
>
> On Mon, 9 Dec 2019 16:17:55 +0200
> Adrian Grigore  wrote:
>
> Dear Adrian,
>
> > Thanks for answering!
> >
> > Do you still have a link to your m4(1) static site generator?
>
> it was never online and had some design decisions that made it close to
> swerc, including multi-hierarchical menus and a focus on markdown. If I
> get the chance I could dig it up.
>
> With best regards
>
> Laslo