From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/33418 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Klaus Rindfrey Newsgroups: gmane.text.pandoc Subject: Aw: Re: How to resolve "WARNING: Undefined function 'Figure'"? Is there a workaround? Date: Wed, 29 Nov 2023 07:42:58 +0100 Message-ID: References: <84b364a6-bbfe-4c9b-b825-d0f52557229fn@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38147"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBC6PXIH32QFBB5F2TOVQMGQERFCCCOY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Wed Nov 29 07:43:07 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-ed1-f60.google.com ([209.85.208.60]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1r8EHp-0009k6-TL for gtp-pandoc-discuss@m.gmane-mx.org; Wed, 29 Nov 2023 07:43:05 +0100 Original-Received: by mail-ed1-f60.google.com with SMTP id 4fb4d7f45d1cf-5488298dd1esf4041648a12.1 for ; Tue, 28 Nov 2023 22:43:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1701240185; cv=pass; d=google.com; s=arc-20160816; b=GwxYGWww9RBZJpI5CNQGvtLvbX8XuGGWoZ+rUCXkBsOXVizzM0QD2dsKUhV5g1Veao nDWf28ZcoTX4a5HtiOQEzifOBXv+zvC/wqSwWcG+Cc/MaxOskgmESjK8r5TS1mAabqii 9jtWazjYtp7OmYYIihsZUOPiGDi3N5aMgq17DiliR81WyMDfSkL3YjIESTXZG+bXy3Ul MYmp22PuKUa5/ar3fttDYv/4gmgyk/jhbEf+aPdQgljNAwLuABuQ53BK7SXM3VSe6lxi YyUDE3iLk4fNkjr9eZS8BY0HxM+zg6pfP3oOX4XFwM6K5jsqos1CiDUfcQB3utXfTBf4 BMiQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:content-transfer-encoding:reply-to :ui-outboundreport:references:in-reply-to:sensitivity:importance :date:subject:to:from:message-id:mime-version:sender:dkim-signature; bh=mFcuP1RYXNCMXpHPjN+r9xUf3+bLnMFfteUcBHllWig=; fh=m01AhCNo7xUywHldCVYouaJypLlN7JgtNYbImzBf4N4=; b=cz1m0DYNdFdxayBwgqx/oDsRqDhwT3wDaUgDBTXC+xyhdsJ05ScXu7qeebTeyD+CVJ WouFkv01mCXnsSu7hejmPfohpMBNvQNY0nofWUNEGNM9tNBlMojfjI69+g8xxsruSWuW E8DxSVQP7tp6efwLP1QTUr2lHf0HA11TrPA2/QBDNQAFZGrLVAMjwLycSow09LpHA2F5 uLonDmVOu4I4ewWZ3++dPAIKkO9NrRDHVMAj78DcysKZ6zFeJ5ozIXRkWxe0ebKeco73 /ANKkOy4YDiKg+V+6LBwVY+7SEIq6GFE0PoRfsnr1LSzdaFJN3txiDVjXKmfbb7jnHII ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=UbjYN53N; spf=pass (google.com: domain of k-rindfrey-Mmb7MZpHnFY@public.gmane.org designates 212.227.17.21 as permitted sender) smtp.mailfrom=k-rindfrey-Mmb7MZpHnFY@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1701240185; x=1701844985; darn=m.gmane-mx.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:content-transfer-encoding:reply-to :x-original-authentication-results:x-original-sender :ui-outboundreport:references:in-reply-to:sensitivity:importance :date:subject:to:from:message-id:mime-version:sender:from:to:cc :subject:date:message-id:reply-to; bh=mFcuP1RYXNCMXpHPjN+r9xUf3+bLnMFfteUcBHllWig=; b=tVzABkg8ramkyi3v9rVcxtIZz3BQFa9aVcyu9q4hsJ0WBGIKm/3WIbOGjgOjm3mByC PZwEj+ZBwKrAX2QGEdd/aZmeP0nSfqE8Q9XdI2fqvAg8zUwQJPwhUGe1yquId7GUxcIS X6G33FqR82B8i3dykNtc9oXtaF9041mltsAJv/WwoHQSxYCQXK8gszYDu5vVj3xl4VkJ JWLEo8+NSpb00OkpAwTODxgddxML9IgwKTR4jYdJ3RHlGOzqcleGv X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701240185; x=1701844985; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :content-transfer-encoding:reply-to :x-original-authentication-results:x-original-sender :ui-outboundreport:references:in-reply-to:sensitivity:importance :date:subject:to:from:message-id:mime-version:x-beenthere :x-gm-message-state:sender:from:to:cc:subject:date:message-id :reply-to; bh=mFcuP1RYXNCMXpHPjN+r9xUf3+bLnMFfteUcBHllWig=; b=s4OAXHEvN0eTFFRt+PFLBZ+8doPp2+2uSu/pv/sDpE+xlbKDDq6kLzvFpVYpdq6O33 13fxDIkeJmYwLUXHjPHrtTYs7B7RVZQSFi59SBGKUzAVnlkRVTddf56DIUIJFYnnB7sQ N6NwC9/CdIQNbWrZbVFnT+9tICUfaUgGnIbaxaoIfMt/1MeDGC5Vqff95KoVEjzdYfNU Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOJu0YxEx1aondm4PTtgILIFRA2u6gFY81LX0gwLSBYQWa/d5smUbMUt 0bQcrfUdyFkKGDJ+SB9vmRk= X-Google-Smtp-Source: AGHT+IGXAVP0GuBz/lWHqOilzbD+9wXyvbOzFSxbO0BDJrBhByGNwXHv343ocYK1c4yQmBJwfJIDHQ== X-Received: by 2002:a50:d75b:0:b0:54a:f4cd:5fac with SMTP id i27-20020a50d75b000000b0054af4cd5facmr12718790edj.31.1701240184949; Tue, 28 Nov 2023 22:43:04 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6402:b84:b0:54b:40fb:59b1 with SMTP id cf4-20020a0564020b8400b0054b40fb59b1ls687435edb.0.-pod-prod-01-eu; Tue, 28 Nov 2023 22:42:59 -0800 (PST) X-Received: by 2002:a50:ab0f:0:b0:54b:3ca5:dac8 with SMTP id s15-20020a50ab0f000000b0054b3ca5dac8mr7069413edc.42.1701240178968; Tue, 28 Nov 2023 22:42:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701240178; cv=none; d=google.com; s=arc-20160816; b=Wnz6qMxSmzVvL2Z+N7lh0+C47VGJPG3G7S3R6Fvm6Wd94g4w92rMijDSitR+GTZYKn k5uYVkgN4mzGa6JEAoIu6F3OhK7/ZhMcpyHgrUL9glh6GwM29qvKobkUk4fXYKS3pYMV Nh34BJR+XO7CqdGeRJI2df6bzo85E5Nc3fLGywjsRhOEtXoVrmdag8k+1GyOvHC9W8DX /YzIeOSVaGHXK1iIx9yOalyflm0wa29JMlzD0uJVXr5aZqxXd1oocmpF7xeNpIa/CCOR DNDBBMLhcSBBZYVUgO3kSxs1aj8WfKs3lo5Uwf78pgZxwK6s0zX6PICzRVPKQTwM7KjO N0CA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=ui-outboundreport:references:in-reply-to:sensitivity:importance :date:subject:to:from:message-id:mime-version:dkim-signature; bh=lmdJfDbmoXbn4bWP1K8zm8h7Zai8GMdGW7c4VIkF2ws=; fh=m01AhCNo7xUywHldCVYouaJypLlN7JgtNYbImzBf4N4=; b=z30F39GQ0osWF0qY41NSUgbobjqPmh4dewNWIFs7c23/oAZPSwNHrHtnjSDtBPjOU8 xute2ZuoeMXsWupmASvxf9wB0/IHYTHkM+BOpHS2YxiANb9lsTv7Db3TZZOhMq1IWZYJ lloC5+x9s4p2VkNVrz44EhatTHKVbdkxxdanSzMNMAwanXmx9TTZrGlMCElWXCGF+shG hbrYiDcFeSBKoYx8Crzm5xs0sqaWinmHdniIn4AuEjxzyli3RC9HJpTtWRCrC9O1y1HQ sTIzCNiFWod02dN2AY2DCCTSvkUU/liGHE4TQ3Cnje1gcGEMRrPy95z7weMdBx8hzyge Dvfw== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=UbjYN53N; spf=pass (google.com: domain of k-rindfrey-Mmb7MZpHnFY@public.gmane.org designates 212.227.17.21 as permitted sender) smtp.mailfrom=k-rindfrey-Mmb7MZpHnFY@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmx.de Original-Received: from mout.gmx.net (mout.gmx.net. [212.227.17.21]) by gmr-mx.google.com with ESMTPS id h9-20020a0564020e8900b0053e90546ff6si700211eda.1.2023.11.28.22.42.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 22:42:58 -0800 (PST) Received-SPF: pass (google.com: domain of k-rindfrey-Mmb7MZpHnFY@public.gmane.org designates 212.227.17.21 as permitted sender) client-ip=212.227.17.21; X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from [130.41.203.113] ([130.41.203.113]) by web-mail.gmx.net (3c-app-gmx-bap05.server.lan [172.19.172.75]) (via HTTP); Wed, 29 Nov 2023 07:42:58 +0100 Importance: normal Sensitivity: Normal In-Reply-To: X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:GLFQgpoe7Ak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JDWSzltk2/T czkiCUzhdepvIna+Y+RHlBKysRJyXcTDXLhVCVabrLt6DSgkFsQtdrm4mj5ftdqVvWmP5I6/ X-Original-Sender: k-rindfrey-Mmb7MZpHnFY@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=UbjYN53N; spf=pass (google.com: domain of k-rindfrey-Mmb7MZpHnFY@public.gmane.org designates 212.227.17.21 as permitted sender) smtp.mailfrom=k-rindfrey-Mmb7MZpHnFY@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmx.de 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:33418 Archived-At:
Hi, thanks, great!
I'll try it!
 
Regards,
Klaus
 
 
Gesendet: Dienstag, 28. Novem= ber 2023 um 20:33 Uhr
Von: "'William Lupton' via pandoc-discuss" &l= t;pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
An: "pandoc-discuss" <pandoc-discuss@googlegroups.= com>
Betreff: Re: How to resolve "WARNING: Undefined function &= #39;Figure'"? Is there a workaround?
Oh sorry, I didn't use the CaptionedImage() code... but I'm su= re you get the idea.
 
On Tue, 28 Nov 2023, 18:14 William Lupton, <wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org> wrote:
Something like this should work? The change to attributes() is a hack = to use 'data-scale' rather than 'scale' and the change to I= mage() is to insert the alt text and the attributes. The main change is the= new Figure() function (oops... I see that I'm ignoring its attributes)= .
 
% git diff -w
diff --git a/confluence.lua b/confluence.lua
index 3057d10..1a7d8ef 100644
--- a/confluence.lua
+++ b/confluence.lua
@@ -38,7 +38,9 @@ local function attributes(attr)
   local attr_table =3D {}
   for x,y in pairs(attr) do
       if y and y ~=3D "" then
-      table.insert(attr_table, ' ' .. x .. '=3D= "' .. escape(y,true) .. '"')
+          local p =3D ""
+          if x =3D=3D "scale" then p = =3D "data-" end
+      table.insert(attr_table, ' ' .. p .. x .. = 9;=3D"' .. escape(y,true) .. '"')
     end
   end
   return table.concat(attr_table)
@@ -162,7 +164,7 @@ end
 
 function Image(s, src, tit, attr)
   return "<img src=3D'" .. escape(src,true) .. = "' title=3D'" ..
-         escape(tit,true) .. "'/>" +      escape(tit,true) .. "' alt=3D'" .. = s .. "'" .. attributes(attr)  .. "/>"
 end
 
 function Code(s, attr)
@@ -330,6 +332,14 @@ function CaptionedImage(src, tit, caption, attr)
    return Div('<table><tbody><tr><td>= ;<ac:image><ri:attachment ri:filename=3D"' .. escape(src,= true) .. '" /></ac:image></td></tr><tr>= <td>' .. escape(caption) .. '</td></tr></tbody= ></table>', attr_cpy)
 end
 
+
+function Figure(caption, image, attr)
+    local figcaption =3D '<figcaption aria-hidden=3D"= ;true">' ..
+        caption .. "</figcaption>"
+    return "<figure>\n" .. image .. "&#= 92;n" .. figcaption .. "\n" .. "</figure>&quo= t;
+end
+
+
 -- Caption is a string, aligns is an array of strings,
 -- widths is an array of floats, headers is an array of
 -- strings, rows is an array of arrays of strings.
@@ -411,4 +421,3 @@ meta.__index =3D
     return function() return "" end
   end
 setmetatable(_G, meta)
-
 
On Tue, 28 Nov 2023 at 17:31, William Lupton <= wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org> wrote:
 
Hi,
 
To generate my documentation, I use a toolchain that generates a markd= own file from various sources, the last step is the generation of Confluenc= e HTML via Pandoc. Since Pandoc does not directly support Confluence HTML, = I use a patched version of https://github.com/jpbarrette/pandoc-c= onfluence-writer (patched because the generated HTMl is not always quit= e correct and some features I need are missing). This worked well for a lon= g time, but after the last update (from Pandoc 2.19.2 to 3.1.8) I got a ser= ies of warnings:

WARNING: Undefined function 'Figure'
WARNING: Undefined function 'Figure'
...


and the HTML code for the images is completely missing. I tried Pandoc 3.1.= 9, same result. Confusing: the Lua code of pandoc-confluence-writer does no= t contain a call to a function named "Figure". Just to analyze th= e problem, i tried custom-markdown.lua from https://gist= .github.com/tarleb/5a9c3fbfa47b0e6d3643efd8af2994b9 and i got:

Error running Lua:
custom-markdown.lua:19: No function to convert Figure (Block)


What's going on? Is this a bug in Pandoc? Is there a workaround?

At the moment I will be using version 2.19.2, but I would like to be able t= o upgrade to newer versions of Pandoc.
 
Minimal example:
 
 
# Example

Just an example.

![Fancy example](img/mypic.png){scale=3D70}
 
 
Regards,
Klaus

 

--
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 pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.=
To view this discussion on the web visit https= ://groups.google.com/d/msgid/pandoc-discuss/84b364a6-bbfe-4c9b-b825-d0f5255= 7229fn%40googlegroups.com.

 

--
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 pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.=
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CAEe_xxj2MwNy9-G21j= AfSq15sA2OHMuBNFeVXTO4nvO7Sp_Wqw%40mail.gmail.com.

--
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/trinity-cb7f73a2-b447-46c8-b633-= 3d14cb000761-1701240178470%403c-app-gmx-bap05.