public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: Thorsten Sommer <vektoren-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Lua filter to insert image with caption
Date: Tue, 1 Jan 2019 12:16:40 -0800 (PST)	[thread overview]
Message-ID: <463cce3d-8746-4ebd-b047-ddfb3ddf2467@googlegroups.com> (raw)


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

Dear community,

I worked on the PlantUML filter (cf. 
https://github.com/pandoc/lua-filters/blob/master/plantuml/plantuml.lua) to 
give the generated graphics a caption. 

It looked simple at first. All I want is to get a figure with caption, so 
in Markdown:

![This is my caption.](img.jpg)

As long as this stands alone in a paragraph, it gets transformed into a 
figure with caption. Now, I want to do the same from a Lua filter. My 
attempt was this:

local imgObj = pandoc.Image({pandoc.Str("Test caption.")}, fname)
local para = pandoc.Para({imgObj})

Thus, it generates one paragraph which contains only the generated PlantUML 
graphics. Unfortunately, it generates the image only, without the caption. 
What is wrong?

Second question: How can I pass the individual captions from markdown? 
Right now, the PlantUML filter needs a code block of the type 'plantuml', 
e.g.:

```plantuml
@startuml
A - B 
@enduml
```

I would need something like:

```plantuml[My individual caption is this...]
@startuml
A - B 
@enduml
```

Is it possible to read these additional text inside the Lua filter?


Thanks for all answers.


Best
Thorsten

-- 
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/463cce3d-8746-4ebd-b047-ddfb3ddf2467%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

             reply	other threads:[~2019-01-01 20:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-01 20:16 Thorsten Sommer [this message]
     [not found] ` <463cce3d-8746-4ebd-b047-ddfb3ddf2467-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2019-01-03 20:43   ` John MacFarlane
     [not found]     ` <yh480kh8ep4gld.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
2019-01-04  9:12       ` Thorsten Sommer

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=463cce3d-8746-4ebd-b047-ddfb3ddf2467@googlegroups.com \
    --to=vektoren-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).