public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: Julien Dutant <julien.dutant-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Re: help filtering languages
Date: Thu, 16 Mar 2023 14:28:35 -0700 (PDT)	[thread overview]
Message-ID: <c238d079-4ba5-4f39-8171-c17e1119d4c5n@googlegroups.com> (raw)
In-Reply-To: <c54cca0e-6eaf-273b-caaa-882f5d9e1c1e-S0/GAf8tV78@public.gmane.org>


[-- Attachment #1.1: Type: text/plain, Size: 2834 bytes --]

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/blob/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 representation of documents don't allow 
attributes *at all* on arbitrary inline elements. See the specification of 
the AST elements here: https://pandoc.org/lua-filters.html#type-inline . 
Code, Span, Image have attributes but Emph doesn't, for instance. 

So your custom reader would need to convert whatever syntax you use to Span 
elements with a "lang=xx" 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
return pandoc.Span(l.content, { lang = l.target})
end
end
 
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 
point is rather to teach about markup, the ambiguity isn't great. (Though 
you could consider that unambiguous, e.g. declare that all [...](:..) is 
markup. There's also the issue that you can't combine this language 
attribute with others.

J

On Thursday, March 16, 2023 at 5:46:05 PM UTC Pablo Rodríguez 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’m afraid that lightweight markup
> doesn’t 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
>

-- 
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/c238d079-4ba5-4f39-8171-c17e1119d4c5n%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 3767 bytes --]

  parent reply	other threads:[~2023-03-16 21:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-13 19:25 Pablo Rodríguez
     [not found] ` <591336ef-c61e-31a8-3f44-2625551f7e07-S0/GAf8tV78@public.gmane.org>
2023-03-13 19:43   ` Bastien DUMONT
2023-03-13 20:46     ` Pablo Rodríguez
     [not found]       ` <103a971c-503b-e15e-8e1d-2b9700099138-S0/GAf8tV78@public.gmane.org>
2023-03-15  8:32         ` BPJ
     [not found]           ` <CADAJKhDcpBdJxQO7qCbnj2Tk+kuxuVrh+HGS7eg8JoUoGSuC0w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2023-03-15 19:45             ` Pablo Rodríguez
     [not found]               ` <f5687eba-f82c-64c2-21b8-94093a1158f5-S0/GAf8tV78@public.gmane.org>
2023-03-16  9:32                 ` Julien Dutant
     [not found]                   ` <49e8c09d-513a-47e5-a85e-c4cf9ca01d5en-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2023-03-16 17:45                     ` Pablo Rodríguez
     [not found]                       ` <c54cca0e-6eaf-273b-caaa-882f5d9e1c1e-S0/GAf8tV78@public.gmane.org>
2023-03-16 21:28                         ` Julien Dutant [this message]
     [not found]                           ` <c238d079-4ba5-4f39-8171-c17e1119d4c5n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2023-03-20 17:20                             ` Pablo Rodríguez
     [not found]                               ` <68de3cab-a729-7728-2652-774a8ff599f4-S0/GAf8tV78@public.gmane.org>
2023-03-20 21:22                                 ` Julien Dutant

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c238d079-4ba5-4f39-8171-c17e1119d4c5n@googlegroups.com \
    --to=julien.dutant-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).