From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/20819 Path: news.gmane.org!.POSTED!not-for-mail From: Samuele Pilleri Newsgroups: gmane.text.pandoc Subject: Re: Thoughts trying to write a Lua filter Date: Mon, 20 Aug 2018 12:47:15 -0700 (PDT) Message-ID: <9da35dc5-3eec-446b-8464-889ec1eb26f4@googlegroups.com> References: <6e09bd71-ee77-4de7-a002-953a62325234@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_1535_392966441.1534794435948" X-Trace: blaine.gmane.org 1534794312 23368 195.159.176.226 (20 Aug 2018 19:45:12 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 20 Aug 2018 19:45:12 +0000 (UTC) To: pandoc-discuss Original-X-From: pandoc-discuss+bncBDNPZQMP5ICRBRFV5TNQKGQEMYK77AY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mon Aug 20 21:45:08 2018 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-io0-f186.google.com ([209.85.223.186]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1frq6t-0005y6-38 for gtp-pandoc-discuss@m.gmane.org; Mon, 20 Aug 2018 21:45:07 +0200 Original-Received: by mail-io0-f186.google.com with SMTP id x5-v6sf14092600ioa.6 for ; Mon, 20 Aug 2018 12:47:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:date:from:to:message-id:in-reply-to:references:subject :mime-version:x-original-sender:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:list-subscribe :list-unsubscribe; bh=fgSEv5aVw7M6VXTqweLx5jrPe+DUIBgBuh8dLDyxphY=; b=kzr3qr/vPNK7p6Y0TrCoOb5aNWxw9gEob+2IG7L7rH1j0R59yVoYhudftBHFG7Rk6H y+HA63/LCMPgd26FYQNnDNFX2nc4HEzN42TNXQhxGd/yEW0u6XlUEE7Gdh8szh6MtqCK P0sZvnyZFKBJTnAd1maYKDNyWeJ0956tSYVsWjSWwy887n8rBupuh+ce788hzaQy3PE9 u2PeKkiAF2CMZpS45nJye89QFwEsUWS9DR/s8aiV7zbVfOoe3A/7PxyTSruMHW489etN LA2mQAb07mZ7hKxDA2hTso3hX0LiyFDEd1CR7SLEp6ow1hXUHY3g3esdVbVTAiMqNdj9 r/KQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:message-id:in-reply-to:references:subject:mime-version :x-original-sender:reply-to:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=fgSEv5aVw7M6VXTqweLx5jrPe+DUIBgBuh8dLDyxphY=; b=ZjHlJ5EVR0Ichl/ayIlUI04hrfRhoMAKR/vYuNS3ST9AOjSgSgNURPBfEAx/5xwJG1 8KUyDB16b2W2uLUNKmKLvrDYyJi/COL18wVJn5iVpyVvOzriRFzyAc94oElmcBGqoMcr M6fH0i9tofK88PE/sFtjPAtS5cmD/8p16BOyxoA20apA+sUiK+hDIjh/PtudDwCC1ZhZ e1h1iVf6hNodwsYdxwyB6093WiLh6+dqauqV8qiTUwg0HfGf0OPOSLQ+xuPBkFgJQMa0 Vpmrf3cvlL6WK8jgh953axl0CpQaP0pfgQ3zi80iNIe4BprLbAU0X9/cgDBbO5VXNkMw VNfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:date:from:to:message-id:in-reply-to :references:subject:mime-version:x-original-sender:reply-to :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=fgSEv5aVw7M6VXTqweLx5jrPe+DUIBgBuh8dLDyxphY=; b=SOUEjF/SMcL13HjjE6kUDrKuPIMNvkCF3MOsX9ByLiRPCEmpKCCCZW1j2/xDERUjAV ZoAu4AHzsOvtWHVMyDYFF4Aq4GPK713s2PHNLYQWXkgKJKoXD6xBDhoZpxqWsVuv3Uog obEhGgxyDGmTlBNLADs4W6n/HndP20QX1WTvmz1aiY3D6NOhGUDwU3rjiECUks9mvn2H jKwc2nSf0ICBcysZ5OSmctI4cdQmwkCZNFn3JHmGvtv0Wcvfiy3mmRcWtguA4ryh9hlv 2Fg1x5pu2aJPMkayJxPAxKuaE1+ZncKlx3vCjBCVnuPDXLJzlNKSGZjJn9nfPXBX9H0j +wOA== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: APzg51AhN3lSz6fJnqAgmmiQT+9jbtTrGiBvb2OzrGJtmpV733PeJqEH vymVslLcanja709hx4Sjkiw= X-Google-Smtp-Source: AA+uWPzyem+AAXYUWiRMcacgT4YgkEJWuzA9aA2hn1XlYNJ/mGry7zmjou2g6UsVblGEq/PLIEVZQw== X-Received: by 2002:a5e:da42:: with SMTP id o2-v6mr52671iop.0.1534794437478; Mon, 20 Aug 2018 12:47:17 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a24:694d:: with SMTP id e74-v6ls98700itc.4.canary-gmail; Mon, 20 Aug 2018 12:47:16 -0700 (PDT) X-Received: by 2002:aca:c744:: with SMTP id x65-v6mr1065179oif.2.1534794436564; Mon, 20 Aug 2018 12:47:16 -0700 (PDT) In-Reply-To: X-Original-Sender: pillerisamuele-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-Spam-Checked-In-Group: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.org gmane.text.pandoc:20819 Archived-At: ------=_Part_1535_392966441.1534794435948 Content-Type: multipart/alternative; boundary="----=_Part_1536_1113631104.1534794435948" ------=_Part_1536_1113631104.1534794435948 Content-Type: text/plain; charset="UTF-8" Oh I see. Indeed, I couldn't find any documentation on that and only looked at a couple of examples, my bad. Can you please tell me where to find those? I could only find this one which however doesn't cover all cases (ie. is there one shortcut for image path as well?). You don't say why this would be useful in your case -- could you elaborate? > I'm writing a filter to handle wrapfigure in LaTeX (and maybe other formats in the future, it would be cool if it could target HTML and DOCX/ODT as well). This is the syntax which I have in mind: ![Image caption](/path/to/image.png){.wrap width=3} As I've previously pointed out the manual defines a specific behaviour for width and height attributes and states that when no unit is passed it's assumed to be pixels. However, in order to convert pixels to inches (without introducing a misleading behaviour not matched by the manual) for LaTeX output, the filter needs to know the DPI value, which can be overridden from the command line: knowing such value would allow me to write a function to handle different units passed (or not passed) as part of the value to the width attribute, complying with this section of the manual. Still, given the complexity of the task I think it would be a better idea to let Pandoc handle this once for all, converting accordingly to the output format: Dimensions are converted to inches for output in page-based formats like > LaTeX. Dimensions are converted to pixels for output in HTML-like formats. > Hope I made myself clear. I'm reluctant to do that unless we add Underline as a proper INline > constructor > I agree with you. More generally speaking, can we rely on classes and attributes as part of the sematics? If not, I think I have to redesign the syntax for this particular filter. -- 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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/9da35dc5-3eec-446b-8464-889ec1eb26f4%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. ------=_Part_1536_1113631104.1534794435948 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Oh I see. Indeed, I couldn't find any documentati= on on that and only looked at a couple of examples, my bad. Can you please = tell me where to find those? I could only find this on= e which however doesn't cover all cases (ie. is there one shortcut = for image path as well?).

You don't say why this would be usefu= l in your case -- could you elaborate?

I'm writing a filter to handle wrapfigure in LaTeX (and maybe other f= ormats in the future, it would be cool if it could target HTML and DOCX/ODT= as well). This is the syntax which I have in mind:

![Image caption](/path/to/image.png){.wrap width=3D3}
<= br>
As I've previously pointed out the manual defines a speci= fic behaviour for width and height attributes and states that when no unit = is passed it's assumed to be pixels. However, in order to convert pixel= s to inches (without introducing a misleading behaviour not matched by the = manual) for LaTeX output, the filter needs to know the DPI value, which can= be overridden from the command line: knowing such value would allow me to = write a function to handle different units passed (or not passed) as part o= f the value to the width attribute, complying with this section of the manual= . Still, given the complexity of the task I think it would be a better idea= to let Pandoc handle this once for all, converting accordingly to the outp= ut format:

Dimensions are converted to inches for output in page-ba= sed formats like LaTeX. Dimensions are converted to pixels for output in HT= ML-like formats.

Hope I made myse= lf clear.

I'm reluctant to do that unless we add Underline as a= proper INline constructor

I agree wi= th you.
More generally speaking, can we rely on classes and attri= butes as part of the sematics? If not, I think I have to redesign the synta= x for this particular filter.
=C2=A0

--
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/= msgid/pandoc-discuss/9da35dc5-3eec-446b-8464-889ec1eb26f4%40googlegroups.co= m.
For more options, visit http= s://groups.google.com/d/optout.
------=_Part_1536_1113631104.1534794435948-- ------=_Part_1535_392966441.1534794435948--