From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/30650 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Felix SOEDJEDE Newsgroups: gmane.text.pandoc Subject: Pandoc 2.18 - Custom writer working example Date: Wed, 1 Jun 2022 16:01:26 -0700 (PDT) Message-ID: <8528d41a-d6dd-4ca7-b38a-13955a9d1eabn@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_2_2064314620.1654124486987" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14699"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBC4JXJU7UYGRBSG736KAMGQE2QDJZWA-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu Jun 02 01:01:31 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-oo1-f56.google.com ([209.85.161.56]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nwXLH-0003dH-2U for gtp-pandoc-discuss@m.gmane-mx.org; Thu, 02 Jun 2022 01:01:31 +0200 Original-Received: by mail-oo1-f56.google.com with SMTP id n5-20020a4ab345000000b0040e5ffbd237sf1665573ooo.15 for ; Wed, 01 Jun 2022 16:01:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=sender:date:from:to:message-id:subject:mime-version :x-original-sender:reply-to:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=Zhhnt/QPARLN/tgyKjKSBozOj5J3cvdR4Eh05LFDaKw=; b=sIHTOtBUMeWoGeMb/eDjFRXbpBVYxNsYoEiUfapNK2iP58ckeA9rGtwHndQacAi4vR W2DGYN/LEQCvy8r+1KBtBABpwjdo1Tr7ECC4bAQtQyTM2tw+x9MR7YX4Zlnv1Al9Hb31 Ka15Crb+Zlee8iN0USqjkbcWKZo+/GEwnTGIAir45Scanz6A/PbEAaKypcmM6M6ec4Zd UGquU2i4ZG8cZbyMgnKKKJyvPXtfkeXEtwS6CI/CaBhyOQSYEDIpzRmwgPjdJrQ2QBPS qz0CMRdcro4pqvIemaEg/j59C78+3gXdXh3ZdAxkpWQgUPj0iG6Qn05VCm1RUZXQZ5sQ 8oWA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:message-id:subject:mime-version:x-original-sender :reply-to:precedence:mailing-list:list-id:list-post:list-help :list-archive:list-subscribe:list-unsubscribe; bh=Zhhnt/QPARLN/tgyKjKSBozOj5J3cvdR4Eh05LFDaKw=; b=ixoeSjmPJySEbG3MbcWoEaIrVaj6IJGoMx3dL3uV4IqKeJ63OXmCSF5OqF+3Mt5jdy MScphojHrBdBDwU/nOxaeNQtaPGd+rhZhv8JDy1Ptcra83oviLZ7N0oWxiYs4Dv7M44P Q4zsxPEl//uBciBE6OYQHwNBBZ1qYRnaL1PgfEh3CuvrMsJnvJbejQnf3nfk8xTarrwE SkBvN1hO3NFzS31LEHmVpYojIWz/mZ2Q+XEUOD1hTW8M1LT8WqWl+R7pAzisKD9Fe11S MPGAi0g7ZFl2biDyjlhWiFgGg0TmbDNxKEhTEa3pNQ+H/L1Su6UTO74Vit9AKcWbwQ6X Xv+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=sender:x-gm-message-state:date:from:to:message-id: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=Zhhnt/QPARLN/tgyKjKSBozOj5J3cvdR4Eh05LFDaKw=; b=0J0njvUyPyTmQzfBmpuTG030S6l2BRciuNDIEeLaCve5XZ19jfBRooPUuZ35s5n03R YpjRz9lezv3RVxhtq7DQIr76pJQfo7KLasmGcFVKBxL0nM+rRjUP5IMXSsVi70XQbhuD SyDoRgRejeq6eF0PSi0dZYVOZlB81Z2EZfyqqxEIzhWd3PVLegd39RaSfE/rLs9BlK+I pbaaJNrrmVX0ursEJ29dgmF51QpuUaNt4KV+TCKgWlwL0AirOviJ53nTz1123mRITmV7 HTKIp20BkpfFbcDtqwDOy+VhWcXE0xGuhpEdFcDHfEqEPeQKrHk/b2xSIvx7DH4nMm9n d91Q== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM531V62KIA1DjjCTUA3MVtgfySAxAeI1R8cT+SDxYZ2OUpn0CcP+H N6u+/OufFlRl5yO3hRJ3aX0= X-Google-Smtp-Source: ABdhPJzok1fcNdiuCCzGFpxzftuSMPFEZ3Rh7drZrHKKKAhe4T97JeCRBOKcad8d5B79Zy4WVx6ccA== X-Received: by 2002:a05:6870:a1a0:b0:d9:b198:4cfa with SMTP id a32-20020a056870a1a000b000d9b1984cfamr1114397oaf.159.1654124490032; Wed, 01 Jun 2022 16:01:30 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6870:d683:b0:e5:d244:bf9f with SMTP id z3-20020a056870d68300b000e5d244bf9fls2005971oap.5.gmail; Wed, 01 Jun 2022 16:01:27 -0700 (PDT) X-Received: by 2002:a05:6870:ec9e:b0:f5:f315:4c83 with SMTP id eo30-20020a056870ec9e00b000f5f3154c83mr1107023oab.289.1654124487561; Wed, 01 Jun 2022 16:01:27 -0700 (PDT) X-Original-Sender: soefelix-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-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.io gmane.text.pandoc:30650 Archived-At: ------=_Part_2_2064314620.1654124486987 Content-Type: multipart/alternative; boundary="----=_Part_3_2031182829.1654124486987" ------=_Part_3_2031182829.1654124486987 Content-Type: text/plain; charset="UTF-8" Hello everyone, In Pandoc 2.18, custom writers were added: https://pandoc.org/custom-writers.html#new-style I tried to use it but it's not working and I don't know if it's an error or I'm using it the wrong way. I have a lua filter -- PANDOC_VERSION:must_be_at_least '2.18' print(PANDOC_DOCUMENT) function Writer(doc, opts) print('We enter don\'t enter "Writer"') return pandoc.write(doc, 'markdown', opts) end function Doc(body, meta, vars) print('We enter don\'t enter "Doc"') vars.date = vars.date or meta.data or os.date '%B %e, %Y' return body, vars end function Pandoc(doc) print('We enter "Pandoc"') end function Header(header) print('We enter "Header"') end -- Command used "pandoc --standalone --verbose --lua-filter=sample.lua --output=output.md sample.md" - None of *Doc*, *Writer* is called. - "print(PANDOC_DOCUMENT)" returns "nil" Some links - https://github.com/jgm/pandoc/pull/7897 (The MR to see "Writer" was implemented) - https://gist.github.com/tarleb/5a9c3fbfa47b0e6d3643efd8af2994b9 : exemple filter I tested but not working - https://groups.google.com/g/pandoc-discuss/c/Ti4Qsehn1Z8/m/Btu_uE6IBwAJ: Question asked but another person before the fonctionnality was released. It does not contains an answer to my question Question: Does anyone have a minimal working example for "Doc" or "Writer" I could use? Regards -- 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/8528d41a-d6dd-4ca7-b38a-13955a9d1eabn%40googlegroups.com. ------=_Part_3_2031182829.1654124486987 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello everyone,

In Pandoc 2.18, custom writer= s were added: https://pandoc.org/custom-writers.html#new-style
I tried to use it but it's not working and I don't know if it'= s an error or I'm using it the wrong way.

I have a= lua filter
--
PANDOC_DOCUMENT)
function= Writer(doc, opts)
print('We enter don\'= t enter "Writer"')
return= pandoc.write(doc, 'markdown', opts)
<= span>end

function Doc(body, = meta, vars)
= print('We enter don\'t enter "Doc"')
vars= .date =3D vars.date or meta.d= ata or os.date '%B %e, %Y'
= return body, vars
=
end

function Pandoc(doc)
print('We enter= "Pandoc"')
end

function Header(= header)
print('We enter "Header"')
end=
--
Command used "pandoc = --standalone --verbose --lua-filter=3Dsample.lua --output=3Doutput.md sampl= e.md"
  • None of Doc, Writer= is called.
  • "print(PANDOC_DOCUMENT)" return= s "nil"

Some links
- https://github.com/jgm/pandoc/pull/7897 (The MR to see "Writer" was implemented)
- https://gist.github.com/tarleb/5a= 9c3fbfa47b0e6d3643efd8af2994b9 : exemple filter I tested but not working
- https://groups.google.com/g/pandoc-disc= uss/c/Ti4Qsehn1Z8/m/Btu_uE6IBwAJ: Question asked but another person before = the fonctionnality was released. It does not contains an answer to my quest= ion

Question:
Does anyone have a = minimal working example for "Doc" or "Writer" I could use?

Regards


--
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/8528d41a-d6dd-4ca7-b38a-13955a9d1eabn%40googlegroups.= com.
------=_Part_3_2031182829.1654124486987-- ------=_Part_2_2064314620.1654124486987--