From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/32338 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: BPJ Newsgroups: gmane.text.pandoc Subject: Re: help filtering languages Date: Wed, 15 Mar 2023 09:32:48 +0100 Message-ID: References: <591336ef-c61e-31a8-3f44-2625551f7e07@web.de> <103a971c-503b-e15e-8e1d-2b9700099138@web.de> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000f3e82805f6ec301e" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23349"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCWMVYEK54FRBO4FY2QAMGQEGE2TDKI-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Wed Mar 15 09:33:03 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-pf1-f192.google.com ([209.85.210.192]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pcMZD-0005so-GD for gtp-pandoc-discuss@m.gmane-mx.org; Wed, 15 Mar 2023 09:33:03 +0100 Original-Received: by mail-pf1-f192.google.com with SMTP id y31-20020a056a001c9f00b00623268e040dsf5427102pfw.7 for ; Wed, 15 Mar 2023 01:33:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1678869182; cv=pass; d=google.com; s=arc-20160816; b=x+JwJFzQU+j4mNWE3iDYxHbXsbpNo1ZGldhFlC5QUWzbSKr/FPqKRH/DbXatw3vHSS w/JU2GfrgAXWk0vdk63vGqSekaP7o7q7tjA5bfp7NOsJZwykBv7CpqclgENy0+Dj4kPr S6vJEYYMVa6k1/oXe/P/I5SkWMgt7DpJVA/JJGuvMR4M/7v1CdbylWEd9+yNlknWudr0 dpMUao45+HuKG2C39FcGjSS1ChyGDE7RYHza68tPQ5AvjuBboQi62/e1KoX2oReJF1lj H5vL06B3NyT6TSP0uK3pbge2jpoqnO3JRbDc3kuRnCdiRX3ghYimCmPUSJ1RyfOgygvL BtZA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:to:subject:message-id:date :from:in-reply-to:references:mime-version:sender:dkim-signature :dkim-signature; bh=893xMANUuji0BgKDdf/shlG6W8Oa/pTgxv9oliFJHgU=; b=s0h4JXszBSL4jOzXho47ITSMdfEbqCR6Xvx+bNOdUl9AVTyjP2q3iKr+OkNnXRgMna SD687Vvhz50rHCq2JEOjNvvFgFxRJieaw/fr3TNAfRFDxIqIEPNcuQZ3ZHdpocxPOI/l gicKX3LPyrCJTcLI61wi0t1Vmv+aLHCcplNtSwT2kwaNPmAakzLQROUljLohYtfycRxE e4T12iblu/XMJr3Q5gX/Auz/isGuWZfa0q39cWisG+bspwvg6OvzaytSEJw8+G863k+w EWVxuEE/pr05YmARSrrkU8g8sNAFQZbJaMW8mnIbzyqzI2jH0SJDhw4Itx28350jyc0+ jIHA== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=XpXFawas; spf=pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::b32 as permitted sender) smtp.mailfrom=melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; t=1678869182; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:to:subject :message-id:date:from:in-reply-to:references:mime-version:sender :from:to:cc:subject:date:message-id:reply-to; bh=893xMANUuji0BgKDdf/shlG6W8Oa/pTgxv9oliFJHgU=; b=XBrV8E09juiGBlZXAT9kgjSi13+wncoy9JcLf5W/0wwtjr95maavMvcK7UHz1lRM/B H81B3s1y6OCrMymYRswudqojGiyVw64CKn77aDticr3MTlOP2a0yYBR2EESxDQOcrGnt 6EK/masbPw9yRWYsrErz/6K/eJZMqrFBfnU/ZOZWx14sPgBND8Gs0rXOvLh5ibdLe925 fkJLGu02+4gUi38Fj4NA+RlkSKpZL2pJWE2KElRxrg9QGWat69fHFjADWmTg61g0xxmp GVEl7wekuwrafvJqAIi6NxxsstuO5ecY0mKVxX/gv9ShjCTdrYqTxxDHB3W/VdaAfk5w NbVQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678869182; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:to:subject :message-id:date:from:in-reply-to:references:mime-version:from:to:cc :subject:date:message-id:reply-to; bh=893xMANUuji0BgKDdf/shlG6W8Oa/pTgxv9oliFJHgU=; b=gk7Gdjzt0LijKRr1OyX1XPvF74KbbuggFYTKaFNoPe1Iy4zwvcKZYdUws0SE5uI/tA x3CL5AgCj3wxoAPOux07NyeDjnYD0yiP/RazO742UF1R/6pHItoe1DwtmPqHIhHZxE2c 90KuXZ9njeZrBSmAUUyeiiNLaPGznDjq9Q0B529LsqsUapMS+udd2VOiwYJwC0gU94qx EaI3IxIKoOdBQRHHfa29k4JosB5iXaempnoMpTzqfLFpAGMv/5Mr1TQdKYbpudISkozU Nx0qqrOWAXRtrJm92Zsfklz+KtE70u2hsCItmV/PAbJeI+CU6d9reaPQbU7y1K2ckgL5 /5ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678869182; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:to:subject :message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:sender:from:to:cc:subject:date:message-id :reply-to; bh=893xMANUuji0BgKDdf/shlG6W8Oa/pTgxv9oliFJHgU=; b=Rez/8TfgZWu2Y2hvSxiOat6JU2yOi4WR4Xso+WjL7GhLhoNz2VM7lzajrxAsTJ6N0l ZQXS95kmgxn8D3ZCr24Njjd6QPkSLRBEy0sescjl5Dxzeh12cFrC4QyrGEZoqE+IDQQg LcUYNwRXWdDXpWjMtqQprMqs8N8+tWqncx7PxNJMVPOxFeOLlVcI8RLwGtZo66GZIg4m CE6Z6PGwjyE/iV3EtkVcUyJ13ND8P8vTA+If2k/HXlftt0j0hknU9/OuKr3fWt9xZfDm yijBZcKhZgxS0r1nol9bzOZ62L7QL+Sa Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AO0yUKU/U9SXBxVa2kmrKu67cPkGKWeyZsuz5Nuximsh09eeBa3D1D8f big8Zx8yy2KT+Wy+NukB9X0= X-Google-Smtp-Source: AK7set95LHJsEHYF04BqxFIVvG6ujZQ/gZDG+BZzRRsSc6kA6L7vYI0eU5J4IpbstiImU5XBKbXGKQ== X-Received: by 2002:a17:902:efc1:b0:19f:3b0f:4d97 with SMTP id ja1-20020a170902efc100b0019f3b0f4d97mr817483plb.6.1678869182048; Wed, 15 Mar 2023 01:33:02 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a17:90b:4a01:b0:23c:1f9b:df20 with SMTP id kk1-20020a17090b4a0100b0023c1f9bdf20ls1388298pjb.1.-pod-control-gmail; Wed, 15 Mar 2023 01:32:58 -0700 (PDT) X-Received: by 2002:a17:90b:4001:b0:23d:12fe:712e with SMTP id ie1-20020a17090b400100b0023d12fe712emr8217531pjb.36.1678869178525; Wed, 15 Mar 2023 01:32:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678869178; cv=none; d=google.com; s=arc-20160816; b=pdJ37EdXGkpUgC1iH3y4sOQuCHfU78u6CSuj94Rsyi6jdurC/sRIStpNkCTA1zz1V4 PHExsnHkZWfEQh3p7V8F4NItjNsWd8BIyt32GN86ylJToId8B8cleWcVFkT2GMm8AyuV DXcOCPPlSnXMsl+u0HhUSEXJgtfoE3q1q3UUeKK1hC2dAS9IwjSnIlCaZw8luqBLUI4P jKfhw5xXmfmUPcJS+LaAcvhfzepiQYpev72q3eeKcz2JSIY98yYrIkQXx7tLWBd2gi3I WMQqnOFZ1FIXuA7lvkPU2FRHnbN+Hgi2XO/kQrTx7kHzfyt7WcuujeJG7T/B6HAAyuuU rdoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=p893J05G/4tp3cFWitZYn3t2KglxMsVZz5Ya+Tr57GY=; b=C1Segy1pathS/IxR4vq/qzpuV8vSKLECbUYbrGGgbXfZ9LdYxSbWAIcUThq6c+wzh2 tknnRjyvhQTB6vy6BMrPa2zo5IqLQmKRvq9NvJEQtYmdoeBz9dXfeSSKIKoKXZxWIzI1 gxL+tOfOj7RLdPbB1c7udJI5aDJfjUTDhCuYyF1TNxtY9a198qs5X5VS6yFAJKhOdd8q g47JGhe1XpW+G8D0IQ2eY5AP4vnQ5sCYbn+fBCE0Ehgt8HjL0XpjHJ2By/vAp8L0dLGT 2uaYKmmsIL3S6Rs6ilUfkKNlqLAn9IxS5eAokt42dhoDxb0Ube7DtHmsiS/yNW37+u3H Mp3w== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=XpXFawas; spf=pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::b32 as permitted sender) smtp.mailfrom=melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Original-Received: from mail-yb1-xb32.google.com (mail-yb1-xb32.google.com. [2607:f8b0:4864:20::b32]) by gmr-mx.google.com with ESMTPS id pm18-20020a17090b3c5200b00237782d64basi43566pjb.1.2023.03.15.01.32.58 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 15 Mar 2023 01:32:58 -0700 (PDT) Received-SPF: pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::b32 as permitted sender) client-ip=2607:f8b0:4864:20::b32; Original-Received: by mail-yb1-xb32.google.com with SMTP id v196so10971855ybe.9 for ; Wed, 15 Mar 2023 01:32:58 -0700 (PDT) X-Received: by 2002:a25:9f84:0:b0:8ac:72e3:c743 with SMTP id u4-20020a259f84000000b008ac72e3c743mr13357137ybq.9.1678869177558; Wed, 15 Mar 2023 01:32:57 -0700 (PDT) In-Reply-To: <103a971c-503b-e15e-8e1d-2b9700099138-S0/GAf8tV78@public.gmane.org> X-Original-Sender: melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=XpXFawas; spf=pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::b32 as permitted sender) smtp.mailfrom=melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Precedence: list Mailing-list: list pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; contact pandoc-discuss+owners-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-ID: X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.io gmane.text.pandoc:32338 Archived-At: --000000000000f3e82805f6ec301e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable At least you can abbreviate `[rien]{lang=3Dfr}` to `[rien]{l=3Dfr}` --- a reduction from five to two chars instead of from five to one is at least better than none! (And Pandoc allows you to omit the quotes around the attribute value if the value is a valid name.) ``````lua local function handler(elem) if elem.attributes.l then elem.attributes.lang =3D elem.attributes.l elem.attributes.l =3D nil return elem end return nil end return { { Div =3D handler, Span =3D handler, Link =3D handler, Header =3D handler, } } `````` Den m=C3=A5n 13 mars 2023 21:47Pablo Rodr=C3=ADguez skrev: > On 3/13/23 20:43, Bastien DUMONT wrote: > > {:de} will be parsed as a string, not as an attribute list. > > Attributes are of the form key=3Dvalue. In this case, you can write > > (-f commonmark+attributes): > > > > _Deutsch_{lang=3Dde} > > > > What you propose is a syntax extension > > Many thanks for your reply, Bastien. > > I know there is a way to full attribute specification, since the > original proposal is almost a decade old > (https://github.com/jgm/pandoc/issues/895 [which was superseded by > https://github.com/jgm/pandoc/issues/3451]). > > > and it would be quite difficult to write a filter taking into > > account multiple attributes and cases where the {...} string is > > immediately followed by other characters. > > Well, I see what I was missing here. > > > Maybe a custom reader would be better suited. > > I wouldn=E2=80=99t mind to add this to (a custom version of) djot. But I = clearly > lack the knowledge to do that. > > > But it would be easier to stick to existing conventions! > > I=E2=80=99m used to the convention (although I=E2=80=98d rather avoid it,= since it tend > to mix languages a lot), but when explaining CommonMark/Markdown to > newcomers, this is one important exception to lightweight markup. > > And believe me, it is not easy to explain the key=3D"value" attribute > syntax (it doesn=E2=80=99t make it easier to ignore the quotes) to people= with > practically no computer background at all. Because this goes on top of a > bunch of new things for them (which would make anyone explode). > > Many thanks for your help, > > Pablo > > -- > You received this message because you are subscribed to the Google Groups > "pandoc-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit > https://groups.google.com/d/msgid/pandoc-discuss/103a971c-503b-e15e-8e1d-= 2b9700099138%40web.de > . > --=20 You received this message because you are subscribed to the Google Groups "= pandoc-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an e= mail to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/= pandoc-discuss/CADAJKhDcpBdJxQO7qCbnj2Tk%2BkuxuVrh%2BHGS7eg8JoUoGSuC0w%40ma= il.gmail.com. --000000000000f3e82805f6ec301e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
At least you can abbreviate `[rien]{lang=3Dfr}` to `[rien= ]{l=3Dfr}` --- a reduction from five to two chars instead of from five to o= ne is at least better than none! (And Pandoc allows you to omit the quotes = around the attribute value if the value is a valid name.)
=
``````lua
local function handler(elem)
=C2=A0 if elem.attr= ibutes.l then
=C2=A0 =C2=A0 elem.attributes.lang =3D= elem.attributes.l
=C2=A0 =C2=A0 elem.attributes.l = =3D nil
=C2=A0 =C2=A0 return elem
=C2=A0 end
=C2=A0 return nil
end

return {
<= div dir=3D"auto">=C2=A0 {
=C2=A0 =C2=A0 Div =3D hand= ler,
=C2=A0 =C2=A0 Span =3D handler,
=C2=A0 =C2=A0 Link =3D handler,
=C2=A0 =C2= =A0 Header =3D handler,
=C2=A0 }
}
``````

Den m=C3=A5n 13 mars 2023 21= :47Pablo Rodr=C3=ADguez <oinos-S0/GAf8tV78@public.gmane.org> skrev:
On 3/13/23 20:43, Bast= ien DUMONT wrote:
> {:de} will be parsed as a string, not as an attribute list.
> Attributes are of the form key=3Dvalue. In this case, you can write > (-f commonmark+attributes):
>
> _Deutsch_{lang=3Dde}
>
> What you propose is a syntax extension

Many thanks for your reply, Bastien.

I know there is a way to full attribute specification, since the
original proposal is almost a decade old
(
https://github.com/jgm/pandoc/issues/895 [wh= ich was superseded by
https://github.com/jgm/pandoc/issues/3451]).

> and it would be quite difficult to write a filter taking into
> account multiple attributes and cases where the {...} string is
> immediately followed by other characters.

Well, I see what I was missing here.

> Maybe a custom reader would be better suited.

I wouldn=E2=80=99t mind to add this to (a custom version of) djot. But I cl= early
lack the knowledge to do that.

> But it would be easier to stick to existing conventions!

I=E2=80=99m used to the convention (although I=E2=80=98d rather avoid it, s= ince it tend
to mix languages a lot), but when explaining CommonMark/Markdown to
newcomers, this is one important exception to lightweight markup.

And believe me, it is not easy to explain the key=3D"value" attri= bute
syntax (it doesn=E2=80=99t make it easier to ignore the quotes) to people w= ith
practically no computer background at all. Because this goes on top of a bunch of new things for them (which would make anyone explode).

Many thanks for your help,

Pablo

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to
pandoc-discuss+unsubscribe@googlegroups.= com.
To view this discussion on the web visit https://groups.google.com/d/m= sgid/pandoc-discuss/103a971c-503b-e15e-8e1d-2b9700099138%40web.de.

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pand= oc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://gro= ups.google.com/d/msgid/pandoc-discuss/CADAJKhDcpBdJxQO7qCbnj2Tk%2BkuxuVrh%2= BHGS7eg8JoUoGSuC0w%40mail.gmail.com.
--000000000000f3e82805f6ec301e--