public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: Samuele Pilleri <pillerisamuele-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Re: Thoughts trying to write a Lua filter
Date: Mon, 20 Aug 2018 12:47:15 -0700 (PDT)	[thread overview]
Message-ID: <9da35dc5-3eec-446b-8464-889ec1eb26f4@googlegroups.com> (raw)
In-Reply-To: <m2wosm5heu.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>


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

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 
<https://github.com/pandoc/lua-filters/blob/master/short-captions/short-captions.lua> 
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 
<https://pandoc.org/MANUAL.html#extension-link_attributes> 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.

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

  parent reply	other threads:[~2018-08-20 19:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-17 17:42 Samuele Pilleri
     [not found] ` <6e09bd71-ee77-4de7-a002-953a62325234-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2018-08-19 18:40   ` John MacFarlane
     [not found]     ` <m2wosm5heu.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
2018-08-20 19:47       ` Samuele Pilleri [this message]
     [not found]         ` <9da35dc5-3eec-446b-8464-889ec1eb26f4-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2019-09-17 16:08           ` EBkysko

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=9da35dc5-3eec-446b-8464-889ec1eb26f4@googlegroups.com \
    --to=pillerisamuele-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).