From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/32349 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Julien Dutant Newsgroups: gmane.text.pandoc Subject: Re: help filtering languages Date: Thu, 16 Mar 2023 14:28:35 -0700 (PDT) Message-ID: References: <591336ef-c61e-31a8-3f44-2625551f7e07@web.de> <103a971c-503b-e15e-8e1d-2b9700099138@web.de> <49e8c09d-513a-47e5-a85e-c4cf9ca01d5en@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_28_1177701224.1679002115353" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35812"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBC5Y3356IYIILFGOUADBUBB2WP4YI-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu Mar 16 22:28:40 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-qv1-f63.google.com ([209.85.219.63]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pcv9M-0009BI-41 for gtp-pandoc-discuss@m.gmane-mx.org; Thu, 16 Mar 2023 22:28:40 +0100 Original-Received: by mail-qv1-f63.google.com with SMTP id l18-20020ad44bd2000000b005a9cf5f609esf1787439qvw.15 for ; Thu, 16 Mar 2023 14:28:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; t=1679002119; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:x-original-sender :mime-version:subject:references:in-reply-to:message-id:to:from:date :sender:from:to:cc:subject:date:message-id:reply-to; bh=TX93rOlOEKkxXByacG6FR8z93TE1HWnojm5gsoFvZ+4=; b=IT5ml8uZTZ8/PPjcBdyWC4L5G2vMDL0T8VnIANJvIKoZV905m0rLCueoq0LQupyOz8 vSKfFKzPWfDV7HAc4r1h7eD9XPK9Rttbw5PsVQSdxdqu+Qew5o1EAEyzseDaLm5omxIa ZgfMM/xY4RESwmVFvMB9MXspJbdNQVoWMaUfRiEE0BECRDdnCz1Kjk5hjW0ZL1m31ZmF 3c+xjLTyevbwB+z7S+xwWZbUlURMTcSc9gX591RtmU0rM8Gz4iPmOWqst5bctk/RSALw mbXx2xeWBO1Opsd1GJZHrrpZXlPlDbdbMxWx7UMzL/0ormD3JDWrInCPZpyZ1AScWYtN j1mQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679002119; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:x-original-sender :mime-version:subject:references:in-reply-to:message-id:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=TX93rOlOEKkxXByacG6FR8z93TE1HWnojm5gsoFvZ+4=; b=PI4djhzrEKeAPzRDCHDqGWo2+3rXrLhFUi19CHg+iPOo/pxWdEw00fKQunGoee+cCs 1pZ13DezVQsO1KO8861ViI/+7FLWa0xb76JzpnzBYHTdBaciR+cFsVZiDSu4CP3o3ogd yQ3rWqGRRf1/RJPr/Q+Q+O2aLszdhyabGDfu1PvGXMkX//WKSvLVYlGOZeOm7ffVStjy F9m+kwf4aNxRAVQMy8wkdtjLDTZ2oVdIkBXdhWG1bfgkhTQIREstiLfq4uGwCEDeMliL JGQKZ8obCaI0Rs2sLKGO8jSoZSQ52C7Cv0yx4wljoPqTdXe8lYRk2vE2+eitWCoR+4r/ JhFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679002119; 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-sender:mime-version:subject:references:in-reply-to :message-id:to:from:date:x-gm-message-state:sender:from:to:cc :subject:date:message-id:reply-to; bh=TX93rOlOEKkxXByacG6FR8z93TE1HWnojm5gsoFvZ+4=; b=uBvCEem3CQSSttxB08nljmAioqjj0yk0sclc+d/2DPbf8DQQnx46m2AcgPjvjI+zBw E1X0zi2cUaNBgLa36WjMeFAZsRuO4FgNEWMwVTCM0ZadZBQy5CV/7mAnoJ1dVTxVpYSi aqVn0vCDfZGcXA5W95sDrKflzTzD+mEvCdJAi/dtXmupaYwmBgLl5tR52s8ESEUxIfyH tfD4Rw7iYYn3jK0guL4/5JXQI/jhAnttR5OjrVNU9kC4VwykH4FQGyV8gfi0/YQORsDt 2aXrXUNV0Nvuidq2DwNfgmvT+bXsdHXPVa0hjb/AbJ+mm15ttq+elH5EGByNsyZWZNpw Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AO0yUKWFTubfg6SvGomymaZG+bnCPQD6S8IbqSI6t6bDGwXpxDBjUB7G PK+NlHMQx7EgxH/7+MEpLuw= X-Google-Smtp-Source: AK7set91ouFPn+IKNZW5rb7fKbn1Nz96EHfo3KUJ4/3Rzmh/feWmEOLPK0ZBLaNqoCdzrL26MXC/cQ== X-Received: by 2002:a37:a0f:0:b0:745:e23c:c79a with SMTP id 15-20020a370a0f000000b00745e23cc79amr2111151qkk.8.1679002119031; Thu, 16 Mar 2023 14:28:39 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:ad4:4701:0:b0:56e:9f70:6724 with SMTP id qb1-20020ad44701000000b0056e9f706724ls2218718qvb.8.-pod-prod-gmail; Thu, 16 Mar 2023 14:28:36 -0700 (PDT) X-Received: by 2002:ad4:59c7:0:b0:56f:3e5:850e with SMTP id el7-20020ad459c7000000b0056f03e5850emr4875039qvb.3.1679002116316; Thu, 16 Mar 2023 14:28:36 -0700 (PDT) In-Reply-To: X-Original-Sender: julien.dutant-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org 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:32349 Archived-At: ------=_Part_28_1177701224.1679002115353 Content-Type: multipart/alternative; boundary="----=_Part_29_609906803.1679002115353" ------=_Part_29_609906803.1679002115353 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Ok I think I understand better: you want to add attributes to inlines, as= =20 in djot.=20 https://htmlpreview.github.io/?https://github.com/jgm/djot/blob/master/doc/= syntax.html#inline-attributes=20 . The problem, then, isn't just that language isn't a basic attribute. It's= =20 also that Pandoc's internal representation of documents don't allow=20 attributes *at all* on arbitrary inline elements. See the specification of= =20 the AST elements here: https://pandoc.org/lua-filters.html#type-inline .=20 Code, Span, Image have attributes but Emph doesn't, for instance.=20 So your custom reader would need to convert whatever syntax you use to Span= =20 elements with a "lang=3Dxx" attribute.=20 Re the link hack, you could require a colon, i.e. tag languages with=20 [...](:de): -- langTags.lua function Link (l) if l.target:match('^%a%a$') or l.target:match('$:^%a%a%-%a%a$') then return pandoc.Span(l.content, { lang =3D l.target}) end end =20 Your newbie audience would need to understand that: [this one](https://www.example.org) is a link [that one](:en) is language markup I don't think it's difficult to master for authoring. Of course it the=20 point is rather to teach about markup, the ambiguity isn't great. (Though= =20 you could consider that unambiguous, e.g. declare that all [...](:..) is=20 markup. There's also the issue that you can't combine this language=20 attribute with others. J On Thursday, March 16, 2023 at 5:46:05=E2=80=AFPM UTC Pablo Rodr=C3=ADguez = wrote: > On 3/16/23 10:32, Julien Dutant wrote: > > Hi Pablo, > > > > If simple markdown is key here, why not hack the link syntax? Nobody > > ever links to 'fr' or 'en-gb' so we could write: > > > > [savoir-faire](fr) > > Hi Julien, > > I really appreciate your help, but I=E2=80=99m afraid that lightweight ma= rkup > doesn=E2=80=99t allow such an inconsistency. > > Sorry, I thought that language was a basic attribute (such as identifier > and class). But I seem to be > > This is why I thought I would make sense to have a lightweight syntax. > > I apologize again, imagine explaining that language goes in link > destination to an audience with absolutely no coding background. This > would give anyone a hard time trying to justify it. > > Really appreciate you help, but as Bastien suggested, my proposal for > lightweight language syntax seems to require a custom reader. > > Many thanks for your help again, > > Pablo > --=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/c238d079-4ba5-4f39-8171-c17e1119d4c5n%40googlegroups.com. ------=_Part_29_609906803.1679002115353 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Ok I think I understand better: you want to add attributes to inlines,= as in djot. https://htmlpreview.github.io/?https://github.com/jgm/djot/blo= b/master/doc/syntax.html#inline-attributes . The problem, then, isn't just = that language isn't a basic attribute. It's also that Pandoc's internal rep= resentation of documents don't allow attributes *at all* on arbitrary inlin= e elements. See the specification of the AST elements here: https://pandoc.= org/lua-filters.html#type-inline . Code, Span, Image have attributes but Em= ph doesn't, for instance.

So your custom = reader would need to convert whatever syntax you use to Span elements with = a "lang=3Dxx" attribute.

Re the link hack= , you could require a colon, i.e. tag languages with [...](:de):
=
-- langTags.lua
function Link (l)
if l.target:match('^%a%a$') or = l.target:match('$:^%a%a%-%a%a$') then
end
end
=C2=A0
Your = newbie audience would need to understand that:

[= this one](https://www.example.org)=C2=A0 is a link
[that on= e](:en) is language markup

I don't think i= t's difficult to master for authoring. Of course it the point is rather to = teach about markup, the ambiguity isn't great. (Though you could consider t= hat unambiguous, e.g. declare that all [...](:..) is markup. There's also t= he issue that you can't combine this language attribute with others.
<= /div>

J

On Thursday, March 16, 2023 at 5:46:05= =E2=80=AFPM UTC Pablo Rodr=C3=ADguez wrote:
On 3/16/23 10:32, Julien Dutant wrote:
> Hi Pablo,
>
> If simple markdown is key here, why not hack the link syntax? Nobo= dy
> ever links to 'fr' or 'en-gb' so we could write:
>
> [savoir-faire](fr)

Hi Julien,

I really appreciate your help, but I=E2=80=99m afraid that lightweight = markup
doesn=E2=80=99t allow such an inconsistency.

Sorry, I thought that language was a basic attribute (such as identifie= r
and class). But I seem to be

This is why I thought I would make sense to have a lightweight syntax.

I apologize again, imagine explaining that language goes in link
destination to an audience with absolutely no coding background. This
would give anyone a hard time trying to justify it.

Really appreciate you help, but as Bastien suggested, my proposal for
lightweight language syntax seems to require a custom reader.

Many thanks for your help again,

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 pand= oc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d= /msgid/pandoc-discuss/c238d079-4ba5-4f39-8171-c17e1119d4c5n%40googlegroups.= com.
------=_Part_29_609906803.1679002115353-- ------=_Part_28_1177701224.1679002115353--