From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/109184 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Sylvain Hubert Newsgroups: gmane.comp.tex.context Subject: A syntax sugar for ConTeXt Date: Tue, 3 Nov 2020 04:50:26 +0100 Message-ID: Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7909194191544091006==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34213"; mail-complaints-to="usenet@ciao.gmane.io" To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Nov 03 04:50:59 2020 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane-mx.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kZnLW-0008kw-Bq for gctc-ntg-context-518@m.gmane-mx.org; Tue, 03 Nov 2020 04:50:58 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 0009B1A9D1E; Tue, 3 Nov 2020 04:50:41 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5MCppdrDk98Q; Tue, 3 Nov 2020 04:50:41 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 10B6F1A9D13; Tue, 3 Nov 2020 04:50:41 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 3384D1A9D03 for ; Tue, 3 Nov 2020 04:50:40 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id l6ZbYgbxGpWI for ; Tue, 3 Nov 2020 04:50:39 +0100 (CET) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.166.43; helo=mail-io1-f43.google.com; envelope-from=champignoom@gmail.com; receiver= Original-Received: from mail-io1-f43.google.com (mail-io1-f43.google.com [209.85.166.43]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 12DF71A9CFE for ; Tue, 3 Nov 2020 04:50:39 +0100 (CET) Original-Received: by mail-io1-f43.google.com with SMTP id r9so17101154ioo.7 for ; Mon, 02 Nov 2020 19:50:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=J0KCcsXyI8U7eRYPm40EnvRVBQ+IGUkbMyoBgY3oQIM=; b=X38htra30l5l+vJWFtCpWIJ0NwJ4j/UmfvTuVppTSHbEQSC52ao+7LHNDNHEUOuL1B W3vm4Dh8hGsszBAFe3/ozktpidj9pnPfJXuOvMunoLLq1TCEP/Jlx6A/WhjbNknE+307 qyfOBMuqYYH4LIYFifwNyQFeGuan4iFW/8YKsMgyCaaxETFIljmvYjwwakr7BShEDHgz b8UkBRLnBBeNYtJI+Ne3AewLPlQeSP+VY4XkV2ElsoXbUXyvpkrx5P7gh6VguaW5mhfF RECmtpLi0SFgNMzwPQPSGuWISSbG2F0G9H+LhmbQVZLnzP7hIxVZztF2Nll7h/bEC322 S5ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=J0KCcsXyI8U7eRYPm40EnvRVBQ+IGUkbMyoBgY3oQIM=; b=D1WmFa9FLnegmJHLUQBkQ3tjpQ6XDmXD04O8NbPxKXlre2KnQlOldgwNNoHzgdTVRP sbanVaqEAd5dd6uDlvk3cXWKBMc8zmr+9tQ5ogsmo3kNUeT18JkfGiySSFwJGzhEu4D/ qzItMeA3uGEdR3HFlzNfGn8o+U56M8OWoUaAmhkTobIxjEgy0f0Xdh67dUMVHMwXi4kK uh5FvIpQwpzxy2X9iGGO4WkoaUg4bRLEot6JkvKH7MDsnqnEEP3CxV30BWwc7DWtEnxY /A31L9gmfTr+vEBza0y7j73E9Gj4Z82YmFfBq4Le2wclZUaZu6SFWdnSO641up555KfC D1wQ== X-Gm-Message-State: AOAM530EUcCbSkwVW+dBQj5Gj6bWOP5heOeAUg+PDmlSy2gwwLY+SUnH 6K5/zBV4CI5fOZtzZ4TiqwBugYGC3tB0jyrYpwTtgFvtmiyG/g== X-Google-Smtp-Source: ABdhPJzzg5xDdgJ4c/O+wQkEYYLJCtIBpgg5hSyw8A2aXSgBvZwyxl8K/INjqV309fyIAIn5doWKnSAgCsmJB413gII= X-Received: by 2002:a02:3f59:: with SMTP id c25mr14612523jaf.17.1604375437681; Mon, 02 Nov 2020 19:50:37 -0800 (PST) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.26 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.io gmane.comp.tex.context:109184 Archived-At: --===============7909194191544091006== Content-Type: multipart/alternative; boundary="0000000000000caa9805b32bc4a4" --0000000000000caa9805b32bc4a4 Content-Type: text/plain; charset="UTF-8" Dear List, I'm experimenting with a new syntax for ConTeXt and would appreciate it a lot if you could give some opinions/advice on it. https://github.com/champignoom/luax Details in the README. Basically it's lua code faking tex, while remaining a decent programming language, and saving keystrokes to the level of tex compared to \ctxlua -only codes A major motivating example is the table. There are multiple implementations of table inside and outside ConTeXt, each of which uses its own ad-hoc syntax, but at the end of the day they're just mimicking 2d arrays with some variations. Here's an example in Context an excursion using xtable sugared with the new syntax: ``` \xtable.setup[ split='yes', header='repeat', offset='4pt', ] \xtable[ head={ align='middle', foregroundstyle='bold', {{nx=6, "Decline of wealth in Dutch florine (Dfl)"}}, {foregroundstyle='bold', {width='1.2cm', 'Year'}, '1.000--2.000', '2.000--3.000', '3.000-5.000', '5.000-10.000', 'over 10.000'}, }, next={ {{nx=6, align='middle', foregroundstyle='bold', "Decline of wealth in Dutch florine (Dfl) / Continued"}}, {foregroundstyle='bold', {'Year', '1.000--2.000', '2.000--3.000', '3.000-5.000', '5.000-10.000', 'over 10.000'}}, }, body={ align='middle', {1675, \{\math{22}}, '~7', '~5', '~4', '~5'}, {1724, '~4', '~4', '--', '~4', '~3'}, }, ] ``` Best, Sylvain --0000000000000caa9805b32bc4a4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Dear List,

I'm experimen= ting with a new syntax for ConTeXt and would appreciate it a lot if you cou= ld give some opinions/advice on it.

https://github.com/champignoom/luax

Details in the README. Basically it's lua code = faking tex, while remaining a decent programming language, and saving keyst= rokes to the level of tex compared to \ctxlua -only codes
A major motivating example is the table. There are multiple imp= lementations of table inside and outside ConTeXt, each of which uses its ow= n ad-hoc syntax, but at the end of the day they're just mimicking 2d ar= rays with some variations. Here's an example in Context an excursion using = xtable sugared with the new syntax:
```
=C2=A0 \xtable.= setup[
=C2=A0 =C2=A0 split=3D'yes',
=C2=A0 =C2=A0 header=3D&#= 39;repeat',
=C2=A0 =C2=A0 offset=3D'4pt',
=C2=A0 ]
=C2=A0 \xtable[
=C2=A0 =C2=A0 head=3D{
=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0align=3D'middle', foregroundstyle=3D'bold',
=C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0{{nx=3D6, "Decline of wealth in Dutch flor= ine (Dfl)"}},
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{foregroundstyle=3D= 'bold', {width=3D'1.2cm', 'Year'}, '1.000--2.00= 0', '2.000--3.000', '3.000-5.000', '5.000-10.000= 9;, 'over 10.000'},
=C2=A0 =C2=A0 },
=C2=A0 =C2=A0 next=3D{=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{{nx=3D6, align=3D'middle', for= egroundstyle=3D'bold', "Decline of wealth in Dutch florine (Df= l) / Continued"}},
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{foregroundsty= le=3D'bold', {'Year', '1.000--2.000', '2.000--3= .000', '3.000-5.000', '5.000-10.000', 'over 10.000&= #39;}},
=C2=A0 =C2=A0 },
=C2=A0 =C2=A0 body=3D{
=C2=A0 =C2=A0 ali= gn=3D'middle',
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{1675, \{\math{= 22}}, '~7', '~5', '~4', '~5'},
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0{1724, '~4', '~4', '--',= '~4', '~3'},
=C2=A0 =C2=A0 },
=C2=A0 ]
```=

Best,
Sylvain
--0000000000000caa9805b32bc4a4-- --===============7909194191544091006== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCg== --===============7909194191544091006==--