From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/32735 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "'William Lupton' via pandoc-discuss" Newsgroups: gmane.text.pandoc Subject: Re: Wrapping sections of text with
in custom filter Date: Thu, 1 Jun 2023 09:34:44 +0100 Message-ID: References: <2fc450a6-5a16-316c-02c8-8ef055bccd11@meddatainc.com> <93e5b610-66a2-6ac7-1d53-8a04a8314249@meddatainc.com> <853c402b-d9ee-4c9d-8bae-15b20faf7194n@googlegroups.com> <1F66BB1E-B5C8-4062-8202-D82C5CE9A3D0@meddatainc.com> <6d414734-e661-ae2d-68a1-4dfc9cb4f035@meddatainc.com> <4c58dad0-bd86-608e-2d68-74bd6f2f808b@meddatainc.com> <574fbf9f-c1b8-711a-f14a-3acd75cbf634@meddatainc.com> <05ba5663-1578-d555-8539-d6a2bdff6743@meddatainc.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000009df96c05fd0d4f72" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2414"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCS4HJ6WSAHBBMNQ4GRQMGQEXNX3P7Q-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu Jun 01 10:35:04 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-lf1-f61.google.com ([209.85.167.61]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1q4dlu-0000TA-Qk for gtp-pandoc-discuss@m.gmane-mx.org; Thu, 01 Jun 2023 10:35:02 +0200 Original-Received: by mail-lf1-f61.google.com with SMTP id 2adb3069b0e04-4edc7ab63ccsf401658e87.3 for ; Thu, 01 Jun 2023 01:35:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1685608502; cv=pass; d=google.com; s=arc-20160816; b=rmxQKCsx7b2fVA/AyZ7ukoihKtTHX1JaRCc7Iy/XZO8EP5dp59zCcUAV0V73Rz6Too 0YWtgpoGtgxYMkU+KXFOqaG+S9HKQDIzp4YOP1+sDUY054L72YgFs0HRkscLff+SW1sn mbrqyAvensUn5ygSGi9mfMpMWUiuEPAtVfY1ayaKGqS5V3sb/UvhUXVwYeCpgSIzXkwb yte7SBr8EDgXJfVl4nO+JvrIrqaIx62lMHPlzjJ/7CuSNQNWi8bnlaxpgPbmG5YNBI4J FPUmNgnJezsjocuaHYBUvQ79uj3ntL21Mpkx5XM4ue01MJIeCgqCb/+DPnJKRuG0IFW+ FNiw== 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:reply-to:to:subject:message-id:date :from:in-reply-to:references:mime-version:dkim-signature; bh=AK/6+anVUYRgmuJDJARhQ5pXfrHmLwEo/VHFtaubpbA=; b=Iw/Z1zk/GySLatIqvbIU+9e7nEbw7y8D4wDaw2hc0F034RkXKLhsMR8cTDwEeYDmfR gbKzzvtSsGSymeJYxdtAIJELRMf8+vyPj8Mo/OzD3llOo9sjrJGeKjQ65RcyCBriQIm/ XjrVyGZLV8YL9krxy/L0l2ZJkR78ChcNJaWu8EsaKNHIFsYgFonzXaT6yvmQ8Q7Z/aHa jHvwOT6N8YpjJVLJvcR1EgQcrfOVIBVawEtuVWTGeVlPhSAV8I+Mam143G13GgnXyJP2 aPrkTX4VXk8nHRsLVxYbYmf44me5F/4hvkFu7oSaf8bqPh7zPELKBGLlFR7p/jf7snUC KoIQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@broadband-forum.org header.s=google header.b=dZApbrod; spf=pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2a00:1450:4864:20::52f as permitted sender) smtp.mailfrom=wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadband-forum.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20221208; t=1685608502; x=1688200502; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:to:subject :message-id:date:from:in-reply-to:references:mime-version:from:to:cc :subject:date:message-id:reply-to; bh=AK/6+anVUYRgmuJDJARhQ5pXfrHmLwEo/VHFtaubpbA=; b=oIU0XMQdB3YVDusIcaGqrOipyTQ6crju0228VkXJrfmEGDjeedRplmNL4S8VQBRRPI t0+qk8cpHIUfj3RYLLiUR+XWgcR1eMcWbOn+PUUatCHkljduNR7YlyNyWOJEVx6WgA9y 7ZklS1kMDtkcRx/G2BvedF2CSEmjbbksoriN46BLysKbCEdbWp0c/JTT2hPmIkXbMKrf 2G6T8VDaln6vpZN4QtxTxQART7vzeVAxkccfQRPUyd/yK4NQvJZWDDzBiyiNQiAjvyMd m8ZmPsXdRPXC6OrnvdsS92tjuIllfQ1H4xmn7otK6uJ5e5Rh4do6ECW21OjD5wjOA84k nE X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685608502; x=1688200502; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:to:subject :message-id:date:from:in-reply-to:references:mime-version :x-beenthere:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=AK/6+anVUYRgmuJDJARhQ5pXfrHmLwEo/VHFtaubpbA=; b=T/pl0JqW6eIlNKQt2H44QIgWMw/vIpQs1HXwqttfPKNEQPiKy3rjnX8tjM/bBt583q HQDW0FhVUqwD5FCKeAi/UFMjWjVBB/PNRxtblV4LzvTt+RcO//MLZF9EK92jf3rsk15C qhFLQB8PoQoPiWSKdYbqErdbwvpeAnnmOVAIKEV7WZb1QWVX2JiRmlXCv+JBh+st1rsD MfyTLC31Hrikmnar15EeNfS90syrtFLHDolWe09FCZ8CfBcOKHquiVNgvAPXtjr6iUGz MRsscp1HtZMfc X-Gm-Message-State: AC+VfDzI1OFoGQkhTSIn6RaniZYvdt2+kekuGJNy9/c7u+oVvC1IeohQ UKlUoY9S98rszNgo29BwD7A= X-Google-Smtp-Source: ACHHUZ7DIDRx9ABXjs3SzITvfpH75KZV9TRS+JDkFC1hvHCXEptqQw8xjTWjdwmgzPW9oMPj+q1VjQ== X-Received: by 2002:a19:f014:0:b0:4f2:4df1:9718 with SMTP id p20-20020a19f014000000b004f24df19718mr853062lfc.17.1685608502015; Thu, 01 Jun 2023 01:35:02 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a19:4f52:0:b0:4f2:5056:2be with SMTP id a18-20020a194f52000000b004f2505602bels66931lfk.0.-pod-prod-04-eu; Thu, 01 Jun 2023 01:34:56 -0700 (PDT) X-Received: by 2002:a05:6512:2187:b0:4d8:6540:a731 with SMTP id b7-20020a056512218700b004d86540a731mr854252lft.47.1685608496562; Thu, 01 Jun 2023 01:34:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685608496; cv=none; d=google.com; s=arc-20160816; b=KL77N5S5iR2JP7rF9f0BrgUD0l2QhmgyjJEnpbWL016sXmZ2oulvNmAbjJgpraPSFJ WMJtRVOpVNOVogww3G+4j6JwUwBjJ15gQWwnN3k+0+sJhBbJtPBBATyh571ko5Vv4+aR Qex2ny1vpnl8TybGLaO7YxMf+dj/rVutO7uVatEkERvQzDCEg/VC+HAWRFVitnxlt9gU 3nb/BQgd1bNSfAjTv6CdlxZXiDngNkeNVwIZl9ET0ZD/WrrqT0bO1Cbq5axmVU8YerRi NHdW4BKVzl+aOz6oHbo3yOUUYWzSLQjJQUHiET+iKo93XuukmflHO3Mx/pH1zm9Ittl8 DTaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=+i+cE9OrqHCcHy7yHncTICnQmIQh5WPodTTS0RItcNA=; b=qRRPcPPivUBlMwIxunxUdqbEMvB68gVFBDMRP1FLkwujaYClBOD5M6ZNuZnzdhY1Jf Jj8sqLEcR8F69yE52zAdbmrz8lQ/v/zcOhiYnY5kHwKK4laL0HnwKR5azcwGM/WzglC9 bCSWwBkJ6iBP/kUcXt02X8qdhrMnlpF1S748vVMeXSLw4ZLz2aS4fbDUVuQy9flsSYpy /gNicmgK2206y+9PL1hd8PZTL/llfeB2bHWZgz/8hpJGAy7PoDi7AdxR9aRQ28lbC5Rq 7FIk97LiZpBT3GmCpNsshCVLYFoAZgCihP5W4ujxoW2osg/K7odLBAuC/eiAn+jxaGkE L0uQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@broadband-forum.org header.s=google header.b=dZApbrod; spf=pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2a00:1450:4864:20::52f as permitted sender) smtp.mailfrom=wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadband-forum.org Original-Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com. [2a00:1450:4864:20::52f]) by gmr-mx.google.com with ESMTPS id k24-20020a05600c1c9800b003f6fd9bbdb8si80692wms.2.2023.06.01.01.34.56 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 01 Jun 2023 01:34:56 -0700 (PDT) Received-SPF: pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2a00:1450:4864:20::52f as permitted sender) client-ip=2a00:1450:4864:20::52f; Original-Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-51491b87565so957506a12.1 for ; Thu, 01 Jun 2023 01:34:56 -0700 (PDT) X-Received: by 2002:a05:6402:1219:b0:510:e756:3a1e with SMTP id c25-20020a056402121900b00510e7563a1emr5060902edw.11.1685608495702; Thu, 01 Jun 2023 01:34:55 -0700 (PDT) In-Reply-To: <05ba5663-1578-d555-8539-d6a2bdff6743-FcZObrvlYduBUy7/sJONFg@public.gmane.org> X-Original-Sender: wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@broadband-forum.org header.s=google header.b=dZApbrod; spf=pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2a00:1450:4864:20::52f as permitted sender) smtp.mailfrom=wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadband-forum.org X-Original-From: William Lupton 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:32735 Archived-At: --0000000000009df96c05fd0d4f72 Content-Type: text/plain; charset="UTF-8" Am I correct in thinking that when you say "filter" here, you really mean "writer"? In filters, you can use the 'traverse' field to force top-down traversal. See https://pandoc.org/lua-filters.html#traversal-order In writers, you can choose to call doc:walk(), which will honour 'traverse'. See https://pandoc.org/custom-writers.html#example-modified-markdown-writer (and example below) However, if you use pandoc.scaffolding.Writer (as I think you are?) then I suspect that you can't control the traversal order (but I'm not sure that it makes sense to do so, because, for example, surely you always want the contents of a
to have been traversed before you add '
' and '
'?). With the custom writer shown below, and with an input file that consists of the single line 'Text' (and using my logging module ), you get this with the default 'typewise' traversal: (#) inline Str "Text" (#) inlines Inlines[1] {[1] Str "Text"} (#) block Para {content: Inlines[1] {[1] Str "Text"}} (#) blocks Blocks[1] {[1] Para {content: Inlines[1] {[1] Str "Text"}}} (#) meta Meta {} (#) doc Pandoc { blocks: Blocks[1] { [1] Para { content: Inlines[1] { [1] Str "Text" } } } meta: Meta {} } ...and this with 'topdown' traversal: (#) doc Pandoc { blocks: Blocks[1] { [1] Para { content: Inlines[1] { [1] Str "Text" } } } meta: Meta {} } (#) meta Meta {} (#) blocks Blocks[1] {[1] Para {content: Inlines[1] {[1] Str "Text"}}} (#) block Para {content: Inlines[1] {[1] Str "Text"}} (#) inlines Inlines[1] {[1] Str "Text"} (#) inline Str "Text" The writer: local logging = require 'logging' local function report(label, elem) logging.temp(label, elem) end -- 'typewise' (default) or 'topdown' local traverse = 'topdown' function Writer (doc, opts) local filter = { traverse = traverse, Inline = function(inline) report('inline', inline) end, Inlines= function(inlines) report('inlines', inlines) end, Block = function(block) report('block', block) end, Blocks = function(blocks) report('blocks', blocks) end, Meta = function(meta) report('meta', meta) end, Pandoc = function(doc) report('doc', doc) end, } return pandoc.write(doc:walk(filter), 'html', opts) end On Tue, 30 May 2023 at 20:23, H wrote: > On 05/30/2023 02:30 PM, H wrote: > > On 05/29/2023 12:31 AM, H wrote: > > On May 28, 2023 8:50:56 PM EDT, H > wrote: >> >> On 05/26/2023 03:43 PM, H wrote: >> >> No CSS (I had mentioned that in a previous message), also no >> modifications to the markdown file so the entire interpretation of layout, >> adding style information etc. needs to be in my custom PDF writer. This >> custom writer will - obviously - be specific for this single dedicated use >> by myself. >> >> Any pointers (links, code fragments to look at etc.) as to how I should >> traverse the tree to be able to output my custom PDF would be greatly >> appreciated since this will be my first pandoc writer. >> >> I am making some progress working on my custom writer for my desired html >> output layout. I am using the 3.0 syntax where the output function looks >> like >> >> Writer.Pandoc = function(doc) >> return Writer.Blocks(doc.blocks) >> end >> >> At the start of my document I also have >> >> Writer = pandoc.scaffolding.Writer >> >> with customization added for inlines and blocks added. >> >> In the Writer.Pandoc function above, is there a way I can see exactly in >> which order the document is evaluated? I am interested in exploring >> traverse = 'topdown' vs. traverse = 'typewise' as I think the topdown >> traversal will be required to add the necessary
and
in the >> correct locations to my final document. >> >> Again, please bear in mind that I will do /all/ processing in this my >> custom lua writer. >> >> Thanks. >> > > Upon further reading, it looks like the traverse directive might only be > applicable to filters when the AST is being processed > > Is this correct? If so, is there anyway I can view the traversal > processing sequence in my filter when I am writing and debugging it? > > Hoping someone can shed some light on the 'traverse' directive and how I > can debug my filter using different 'traverse' directives. > > Thanks. > > Upon further experimentation, it looks like outputting to 'native' format, > ie the AST tree after running a filter will show me what the modified tree > looks like. > > It would have been nice to have some version of 'verbose' to apply to a > filter to see in which order elements are processed. > > > -- > 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/05ba5663-1578-d555-8539-d6a2bdff6743%40meddatainc.com > > . > -- 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/CAEe_xxhTjZJRuNZFtYMqh1eSNM9yobfgs_YTj2muxs1px0ygjg%40mail.gmail.com. --0000000000009df96c05fd0d4f72 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Am I correct in thinking that when you say "filter&qu= ot; here, you really mean "writer"?

In filters= , you can use the 'traverse' field to force top-down traversal. See= https://pa= ndoc.org/lua-filters.html#traversal-order

In w= riters, you can choose to call doc:walk(), which will honour 'traverse&= #39;. See=C2=A0https://pandoc.org/custom-writers.html#example-modi= fied-markdown-writer (and example below)

Howev= er, if you use=C2=A0pandoc.scaffolding.Writer (as I think you are?) then I = suspect that you can't control the traversal order (but I'm not sur= e that it makes sense to do so, because, for example, surely you always wan= t the contents of a <div> to have been traversed before you add '= <div>' and '</div>'?).

Wit= h the custom writer shown below, and with an input file that consists of th= e single line 'Text' (and using my logging module), you get this with the default 't= ypewise' traversal:

(= #) inline Str "Text"
(#) inlines Inlines[1] {[1] Str "Tex= t"}
(#) block Para {content: Inlines[1] {[1] Str "Text"}}=
(#) blocks Blocks[1] {[1] Para {content: Inlines[1] {[1] Str "Text= "}}}
(#) meta Meta {}
(#) doc Pandoc {
=C2=A0 blocks: Blocks[= 1] {
=C2=A0 =C2=A0 [1] Para {
=C2=A0 =C2=A0 =C2=A0 content: Inlines[1= ] {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 [1] Str "Text"
=C2=A0 =C2= =A0 =C2=A0 }
=C2=A0 =C2=A0 }
=C2=A0 }
=C2=A0 meta: Meta {}
}

...and this with 'topdown' traver= sal:

(#) doc Pandoc {
= =C2=A0 blocks: Blocks[1] {
=C2=A0 =C2=A0 [1] Para {
=C2=A0 =C2=A0 =C2= =A0 content: Inlines[1] {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 [1] Str "Text= "
=C2=A0 =C2=A0 =C2=A0 }
=C2=A0 =C2=A0 }
=C2=A0 }
=C2=A0 m= eta: Meta {}
}
(#) meta Meta {}
(#) blocks Blocks[1] {[1] Para {co= ntent: Inlines[1] {[1] Str "Text"}}}
(#) block Para {content: = Inlines[1] {[1] Str "Text"}}
(#) inlines Inlines[1] {[1] Str &= quot;Text"}
(#) inline Str "Text"
The writer:

= local logging =3D require 'logging'

local function report(la= bel, elem)
=C2=A0 =C2=A0 logging.temp(label, elem)
end

-- '= ;typewise' (default) or 'topdown'
local traverse =3D 'to= pdown'

function Writer (doc, opts)
=C2=A0 =C2=A0 local filter= =3D {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 traverse =3D traverse,
=C2=A0 =C2= =A0 =C2=A0 =C2=A0 Inline =3D function(inline)
=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 report('inline', inline)
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 end,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 Inlines=3D function(inlines)
= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 report('inlines', inlines= )
=C2=A0 =C2=A0 =C2=A0 =C2=A0 end,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 Block = =3D function(block)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 report(= 9;block', block)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 end,
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 Blocks =3D function(blocks)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 report('blocks', blocks)
=C2=A0 =C2=A0 =C2=A0 =C2= =A0 end,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 Meta =3D function(meta)
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 report('meta', meta)
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 end,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 Pandoc =3D functio= n(doc)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 report('doc', d= oc)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 end,
=C2=A0 =C2=A0 }
=C2=A0 =C2=A0= return pandoc.write(doc:walk(filter), 'html', opts)
end
<= br>

On Tue, 30 May 2023 at 20:23, H <agents-FcZObrvlYduBUy7/sJONFg@public.gmane.org> wrote:
=20 =20 =20
On 05/30/2023 02:30 PM, H wrote:
=20
On 05/29/2023 12:31 AM, H wrote:
=20
On May 28, 2023 8:50:56 PM EDT, H <agents@meddatainc.= com> wrote:
On 05/26/2023 03:43 PM, H wrote:
=20 No CSS (I had mentioned that in a previous message), also no modifications to the markdown file so the entire interpretation of layout, adding style information etc. needs to be in my custom PDF writer. This custom writer will - obviously - be specific for this single dedicated use by myself.

Any pointers (links, code fragments to look at etc.) as to how I should traverse the tree to be able to output my custom PDF would be greatly appreciated since this will be my first pandoc writer.

I am making some progress working on my custom writer for my desired html output layout. I am using the 3.0 syntax where the output function looks like

Writer.Pandoc =3D function(doc)
=C2=A0=C2=A0=C2=A0 return Writer.Blocks(doc.blocks)
end

At the start of my document I also have

Writer =3D pandoc.scaffolding.Writer

with customization added for inlines and blocks added.

In the Writer.Pandoc function above, is there a way I can see exactly in which order the document is evaluated? I am interested in exploring traverse =3D 'topdown' vs. tr= averse =3D 'typewise' as I think the topdown traversal will = be required to add the necessary <div> and </div> in the correct locations to my final document.

Again, please bear in mind that I will do /all/ processing in this my custom lua writer.

Thanks.


Upon further reading, it looks like the traverse directive might only be applicable to filters when the AST is being processed

Is this correct? If so, is there anyway I can view the traversal processing sequence in my filter when I am writing and debugging it?

Hoping someone can shed some light on the 'traverse' direc= tive and how I can debug my filter using different 'traverse' directives.

Thanks.

Upon further experimentation, it looks like outputting to 'native' format, ie the AST tree after running a filter will = show me what the modified tree looks like.

It would have been nice to have some version of 'verbose' to apply to a filter to see in which order elements are processed.


--
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/05ba5663-1578-d555-8539-d6a2bdff67= 43%40meddatainc.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/CAEe_xxhTjZJRuNZFtYMqh1eSNM9yobfgs_YTj2mu= xs1px0ygjg%40mail.gmail.com.
--0000000000009df96c05fd0d4f72--