From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/32724 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: H Newsgroups: gmane.text.pandoc Subject: Re: Wrapping sections of text with
in custom filter Date: Tue, 30 May 2023 14:30:05 -0400 Message-ID: <574fbf9f-c1b8-711a-f14a-3acd75cbf634@meddatainc.com> 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> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------------0AC91BF317B8F7FB2DA2532B" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28492"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCEIZSNSZ4IRBMEB3GRQMGQEWVPML2Y-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Tue May 30 20:30:14 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-pl1-f191.google.com ([209.85.214.191]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1q446n-0007DR-Jy for gtp-pandoc-discuss@m.gmane-mx.org; Tue, 30 May 2023 20:30:13 +0200 Original-Received: by mail-pl1-f191.google.com with SMTP id d9443c01a7336-1b0424c50b8sf15470445ad.1 for ; Tue, 30 May 2023 11:30:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1685471412; cv=pass; d=google.com; s=arc-20160816; b=HDRk+EBqJK6405Arb8abrGVCbBusoCnbneZZVkWTPKcmqqg+BWtrHBfbd5IJ/aWinT b/OwvNFubuNB7RxRnqIMV4yO6CeEYvcdRkoW0hSNseCgY+C4TSNESdMg2I+CkGtiim8h hMZJLlUZux9RDAmGsb0eoRBtgT0IuBqGqycGNoTBebB6RujZUUIJy+Q5M9qDo3saxyLl Q4ZxiWyw8bcDF8zDndDcO5lqit5ZW4RlIM5wBuQopm4jy5A0eyHf8wqqG7RH7ANLgjoc Ck+urpy6y67KWEaCl3Aaeyz41VLgr2oYW2vUdXCAvyd0nSycJTHmO4O0H2sMSLycQdqn RRJA== 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:ui-outboundreport :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:to:from:subject:sender:dkim-signature; bh=DROs0m4kD2oXb0H6LWAkUMIvCvR2ZMq/nwmk+IuFDP4=; b=YpqtdyLKw7AGjZZsXmxzGrnix/Gt5uKf9BLwqKXH9aybo+seSx3PRTBOCRymAd4ZoA wMvY21NxEwPJkYNdpiYYfRhlYC6m5e+Pe2Qr71XV5WqZHSoYbeFe+mMiNgnZINvpGOgN 4Epbs5kNgEWFbsV6VDZhu9l/x8WGTaQzWkJOjBRYdsg3UDnw0McHGajzqHN+gvBlfCyf ilxxtphBDZ45B+X7IK8IHJCCiTvrGd/SSSAa2FYTNF4N1bxEwZj7FZR+bN+MIvb1Axae Dt2IcJ/Q3xUo+v6qjsE4IVKL5rueGGvhfDNAVUiUDu63nEhKHPW/bxMAxzWGre7PwA0J lP2A== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of agents-FcZObrvlYduBUy7/sJONFg@public.gmane.org designates 74.208.4.196 as permitted sender) smtp.mailfrom=agents-FcZObrvlYduBUy7/sJONFg@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=meddatainc.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20221208; t=1685471412; x=1688063412; 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 :ui-outboundreport:content-language:in-reply-to:mime-version :user-agent:date:message-id:references:to:from:subject:sender:from :to:cc:subject:date:message-id:reply-to; bh=DROs0m4kD2oXb0H6LWAkUMIvCvR2ZMq/nwmk+IuFDP4=; b=Cm9Qa9svKegJ3eQwHUuUtOn4IfR5iKHZvyMrTxxWC3VAxlnPoJCDwqzv/6sDFF69ax 2VZn4MeUZiame7DzO/A4iMON5FvsCP++h3c2lIgxzv1UhY39VjXK9j2S3u+fcOSs1NPV U0yVqzmOdsuEsz3QbqfjMHMv4e2geBgBkmvzC4SQmLZj7kQb0NiKGexwMUeoATapYNYC mZCyZ8kovwaOBxG0iEsYEZ003AxisvB4lK1TL3vLi84czYUmmcZXKcBI2oW+UGSC4D+X /2Q1vcIe5WhPJIXa1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685471412; x=1688063412; 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 :ui-outboundreport:content-language:in-reply-to:mime-version :user-agent:date:message-id:references:to:from:subject:x-beenthere :x-gm-message-state:sender:from:to:cc:subject:date:message-id :reply-to; bh=DROs0m4kD2oXb0H6LWAkUMIvCvR2ZMq/nwmk+IuFDP4=; b=T6Paprdqa38bIbpL8S4kGGJ1BBku05b7glKC91v5m0TfA3AuEWx0o7pzphl2nvzKOB CWzSt9SODPSyF7Cam6ki3Vw8XTD/iqtoRzbcUFqMQmlEp+IwmgGOBJftO2rWje9tN4FT EBSEDbjdvxzYV/HJ8u9jSM0fmAzA/PHJSac4DBclLaEEB/vHGlLk6OBp5zxY2Wubvcw9 cWPoRUj22cHOVy8oRi8K7csolMgc Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AC+VfDxW1Wr8kSQqCJUbUwgc0UeTvBfShMFoWxRnRyc5cwMERgdy5B6A RrPqlLiuNNjwLTV0UZMKb10= X-Google-Smtp-Source: ACHHUZ6M8EF2B200Vz5U8LFgL4rH3RpawdJiHd8uuPz252qqxR6ft+QTLQDruyGCPl5xEsdl2svn7w== X-Received: by 2002:a17:902:f684:b0:1b0:e0a:b7ab with SMTP id l4-20020a170902f68400b001b00e0ab7abmr3699127plg.31.1685471412145; Tue, 30 May 2023 11:30:12 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a17:903:28c7:b0:1b0:2930:6e2f with SMTP id kv7-20020a17090328c700b001b029306e2fls2111967plb.1.-pod-prod-04-us; Tue, 30 May 2023 11:30:08 -0700 (PDT) X-Received: by 2002:a17:902:e548:b0:1b0:103a:53e9 with SMTP id n8-20020a170902e54800b001b0103a53e9mr3690130plf.57.1685471407861; Tue, 30 May 2023 11:30:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685471407; cv=none; d=google.com; s=arc-20160816; b=ydaPTeaYV6qIbuMEeKTd3w6VRsxANowg/30X44EJayUZc0m3gfQp6bCh+6JrHYo9aF cyYEVcm7z/zLKcisjBmWaLrFhpzkJZpF8lc0cYXeLLeWL7Y0xNamS5TlrvwruItoYane UCUv+BpF3w0FN2OHNaZ14o8Da5qCpttSc/mVCm2MH7VkJJqL+oOb2TN6+jcysNrfKqY1 rwO3ramGEdkk8WWjhf3ClUurGjbPxJmW/KLM2hQDKO1YlGhYmmHIBm/QEwH/O4D0XLRh 1lPKs56RonD8luO/Tzh8C1/lK73/GJL1+i0bwD/hYeeI5rHPMQ+GzvlvKlyxgg+HLtH1 QUeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=ui-outboundreport:content-language:in-reply-to:mime-version :user-agent:date:message-id:references:to:from:subject; bh=3Zz9g0BJn9UDPWxCmbMk692amPauu5LJxQ9lPimyl+8=; b=NRA74iMg6z261ZNOVv22hPf0phmCunZp+GBIS8iZF0b4a1KTy5xEiiP0YEmsJ2JJ+L s5id739pNvqctvqSBhWRUnLgMlcebenBQFghHvuKOFzMU3m15aQ9oBZGXNsFF+2+L0up k4dRYsQywCeahuSYmPQkKBLhrHy3nkzOd9/gLYVXdzgxm+xNCr471OfVcrgnc0enYspq XMxaXa6MRRdvs5bZsJ4NJSoKjLoBx5VXDsEAANymPejdXMCrWPRo1jI5GtH+CX5sSLfp SnqH/2gpIOAMEj5Ez/d19vXdDvWnHlNJ95PDb5WeXYAqa4m+IyzMrHImo/stBNh3URQG s/NA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of agents-FcZObrvlYduBUy7/sJONFg@public.gmane.org designates 74.208.4.196 as permitted sender) smtp.mailfrom=agents-FcZObrvlYduBUy7/sJONFg@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=meddatainc.com Original-Received: from mout.perfora.net (mout.perfora.net. [74.208.4.196]) by gmr-mx.google.com with ESMTPS id ko15-20020a17090307cf00b001b03a1a3166si511221plb.10.2023.05.30.11.30.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 May 2023 11:30:07 -0700 (PDT) Received-SPF: pass (google.com: domain of agents-FcZObrvlYduBUy7/sJONFg@public.gmane.org designates 74.208.4.196 as permitted sender) client-ip=74.208.4.196; Original-Received: from [192.168.1.17] ([72.94.51.172]) by mrelay.perfora.net (mreueus003 [74.208.5.2]) with ESMTPSA (Nemesis) id 0MSthj-1pcoTT2FDJ-00RoAL for ; Tue, 30 May 2023 20:30:06 +0200 In-Reply-To: Content-Language: en-US X-Provags-ID: V03:K1:7VVxnv1HuQaaTwad9rC7FF2YOYtya3s6yn2HcgVdIbSpW4WhBhu Gf/kjRDvSlIfoyzNnHXa9zHR7iDXZQ4jJDWGF7G9xDBTpSD74+b/eMmqsXx27gTtpRgYdnC YO1X9MWD3GeKtI8XDJ+ZMVgrPPsFKYLO0HHu1f856ivDqt3GO0f3zxw6AbWvPhqh16wXtFU X6E3iEQD++zO8x1BdIajA== UI-OutboundReport: notjunk:1;M01:P0:dJW9EX1BqrQ=;VPkBrEhaaumu0nmLYaLqCZ59r5l Q1ILPEKBaHopwMAjcEYoe7R/Ntl0rSKUxjGRjB7nL3iLdH/M0Bx0ZxlM7qEKqq6rcjkxF8dre znan2VcFHcxa0HK20XZjmf8RQo+Tz0fVxOoce58dpzLQWyhFugFHQwUrJ2hJcOkz26q4mvxm9 UhGwt5jlQgmaMnnco3WNpEe1KGGr0Ye0qEeQ0hp8jTgQB08I6yq0axwNrXWFTPHNZCCgA9m2x oMyEFUkuuwJ559KuII1hypWRvIII5dCcbyH/zKmBVqTDH4Si7uDGjjh5Gz0cfyRQs4g0RpdVj mBKycCAcP5TUlDQMYlmhp6meTp6E6JylVvKU9sbBHU+603GWX/EFNUttCB85eDA1vvqH2X8yL PB9uLFGZKybOttnjDDlDu8P4EXTpOTDXeEXvgkUyNXxcW0oZIVh661IJDL3Kv6ZbzyDX81sqB BvAjxt5q8HyaWnVbXrMvWGbLvQgUeW6tk2yYeWgzFL1Mka2AGLoAKOgqkD0huJtyAjsVLKLs6 kEaQeyX4OU9RfuYmBFzeszva/ijByo3cliwwSO4FJlgDAJxWUpN9nJfEtug+KvvDcCfC74yjr oqCZdpQ5EEHIoyReeqNA914q5AK8LWIJJ3ZNzGdSYK85fm4hN8onJiJleRhJ9Eq11efdZHgBS mttq4Y4VuMjotPex8A0AkLY1qg4sADWGDlHsXXzmNQ== X-Original-Sender: agents-FcZObrvlYduBUy7/sJONFg@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of agents-FcZObrvlYduBUy7/sJONFg@public.gmane.org designates 74.208.4.196 as permitted sender) smtp.mailfrom=agents-FcZObrvlYduBUy7/sJONFg@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=meddatainc.com 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:32724 Archived-At: This is a multi-part message in MIME format. --------------0AC91BF317B8F7FB2DA2532B Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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: >> On 05/26/2023 02:33 AM, 'William Lupton' via pandoc-discuss wrote: >>> Good. From your original message: >>> >>> >=C2=A0Some of the
tags need to wrap H1, H2, image, mul= tiple paragraphs, other
tags wrap only one such item. In additi= on, most HTML tag need to have some predefined custom style information. >>> >>> --section-divs covers some of this. For the rest, do you want to wr= ap all images, or only some? If the latter, how will this be indicated in t= he markdown? Similarly, how will the multiple paragraphs (that are to be wr= apped) be grouped? >>> >>> The remaining wrapping logic can almost certainly be achieved via a= lua filter, and shouldn't require changes to the writer. >>> >>> As for the styles, can the desired results be achieved via CSS? >>> >>> On Fri, 26 May 2023, 01:31 H, > wrote: >>> >>> On 05/25/2023 04:38 PM, 'William Lupton' via pandoc-discuss wro= te: >>>> Have you considered the --sections-divs option (https://pandoc= .org/MANUAL.html#option--section-divs)? >>>> >>>> For example, this markdown: >>>> >>>> # A >>>> >>>> ## A1 >>>> >>>> ## A2 >>>> >>>> # B >>>> >>>> gives the=C2=A0following: >>>> >>>> (1) pandoc section-divs.md >>>> >>>>

A

>>>>

A1

>>>>

A2

>>>>

B

>>>> >>>> (2) pandoc section-divs.md --section-divs >>>> >>>>
>>>>

A

>>>>
>>>>

A1

>>>>
>>>>
>>>>

A2

>>>>
>>>>
>>>>
>>>>

B

>>>>
>>>> >>>> (3) pandoc section-divs.md --section-divs --to=3Dhtml4 >>>> >>>>
>>>>

A

>>>>
>>>>

A1

>>>>
>>>>
>>>>

A2

>>>>
>>>>
>>>>
>>>>

B

>>>>
>>>> >>>> On Thu, 25 May 2023 at 20:36, H > wrote: >>>> >>>> On May 25, 2023 6:42:49 AM EDT, Felix SOEDJEDE > wrote: >>>> >You could use Fenced divs: >>>> >https://pandoc.org/MANUAL.html#divs-and-spans >>>> > >>>> >You can put inside headers, paragraphs, code blocks, etc. >>>> > >>>> > >>>> >Le jeudi 25 mai 2023 =C3=A0 01:20:09 UTC+2, H a =C3=A9cri= t : >>>> > >>>> >> On 05/24/2023 04:51 PM, H wrote: >>>> >> > Using pandoc 3.1.2 and am trying my hand at writing m= y first writer >>>> >to >>>> >> customize HTML output for a specific, predefined newsle= tter format. >>>> >> > >>>> >> > The source document is written in markdown, contains = headers of >>>> >various >>>> >> levels, paragraphs of text, links to images and mail li= nks. No lists, >>>> >no >>>> >> tables and no code blocks. >>>> >> > >>>> >> > The document is structured with an introductory secti= on, multiple >>>> >> identically formatted sections and then a final section= at the end. I >>>> >need >>>> >> to wrap various portions of the structure with
at >>>> >multiple >>>> >> levels in order to achieve the desired formatting. Some= of the >>>> >
>>>> >> tags need to wrap H1, H2, image, multiple paragraphs, o= ther >>>> >
>>>> >> tags wrap only one such item. In addition, most HTML ta= g need to have >>>> >some >>>> >> predefined custom style information. >>>> >> > >>>> >> > This output will be manually added to a certain newsl= etter editor >>>> >in a >>>> >> CRM system and I cannot add any CSS information whatsoe= ver, >>>> >everything has >>>> >> to be structured as outlined above. >>>> >> > >>>> >> > Since I am new to writing filters, I am looking for s= ome >>>> >suggestions how >>>> >> approach the
wrapping when multiple differe= nt HTML items >>>> >need >>>> >> to be wrapped. >>>> >> > >>>> >> > Thank you. >>>> >> > >>>> >> I should add that one
pair may enclose H1, = H2, image, and >>>> > >>>> >> several paragraphs until the next H1 tag or end of docu= ment. Another >>>> >>
pair (within the just-mentioned pair) may e= nclose the >>>> >image and >>>> >> several paragraphs, again until the next H1 tag (or end= of document). >>>> >There >>>> >> are some additional levels of
pairs but this desc= ribes the gist >>>> >of it. >>>> >> >>>> >> Suggestions welcome! >>>> >> >>>> >> >>>> >>>> I do not want to make any changes to the source markdown d= ocument, the appropriate processing needs to be done in my custom output HT= ML filter. >>>> >>>> I am looking into the following (simplified) flow example: >>>> - Add a
tag when encountering a H2 element. >>>> - Add the corresponding
tag when encountering a H1 = or H2 element or the end of the document. >>>> >>>> --=20 >>>> You received this message because you are subscribed to th= e Google Groups "pandoc-discuss" group. >>>> To unsubscribe from this group and stop receiving emails f= rom it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org . >>>> To view this discussion on the web visit https://groups.go= ogle.com/d/msgid/pandoc-discuss/1F66BB1E-B5C8-4062-8202-D82C5CE9A3D0%40medd= atainc.com. >>>> >>>> --=20 >>>> You received this message because you are subscribed to the Go= ogle Groups "pandoc-discuss" group. >>>> To unsubscribe from this group and stop receiving emails from = it, send an email 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_xxgNr8O73TNGgV5y%3DgwiLAKB3WFuX5a49Vv_RJDt= ojVcSQ%40mail.gmail.com . >>> >>> It's somewhat close but I need to do additional customization. = Where can I find the code this uses so I can look at it and use as a base f= or my own writer? >>> >>> --=20 >>> You received this message because you are subscribed to the Goo= gle Groups "pandoc-discuss" group. >>> To unsubscribe from this group and stop receiving emails from i= t, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org . >>> To view this discussion on the web visit https://groups.google.= com/d/msgid/pandoc-discuss/6d414734-e661-ae2d-68a1-4dfc9cb4f035%40meddatain= c.com . >>> >>> --=20 >>> 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, s= end an email 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_xxg9ExgK4WCNz6G%3Dr%3Ds4DSCs4CBPERcUV431yov2Ume= O8w%40mail.gmail.com . >> >> No CSS (I had mentioned that in a previous message), also no modific= ations to the markdown file so the entire interpretation of layout, adding = style information etc. needs to be in my custom PDF writer. This custom wri= ter will - obviously - be specific for this single dedicated use by myself. >> >> Any pointers (links, code fragments to look at etc.) as to how I sho= uld traverse the tree to be able to output my custom PDF would be greatly a= ppreciated 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 loo= ks 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 tra= verse =3D 'topdown' vs. traverse =3D 'typewise' as I think the topdown trav= ersal 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 processi= ng sequence in my filter when I am writing and debugging it?=20 Hoping someone can shed some light on the 'traverse' directive and how I ca= n debug my filter using different 'traverse' directives. Thanks. --=20 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 e= mail 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/574fbf9f-c1b8-711a-f14a-3acd75cbf634%40meddatainc.com. --------------0AC91BF317B8F7FB2DA2532B Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On 05/29/2023 12:31 AM, H wrote:
On May 28, 2023 8:50:56 PM EDT, H <agents-FcZObrvlYduBUy7/sJONFg@public.gmane.org> wrote:
On 05/26/2023 03:43 PM, H wrote:
On 05/26/2023 02:33 AM, 'William Lupton' via pandoc-discuss wrote:
Good. From your original message:

>=C2=A0Some of the <div></div> tags need to wrap H1, H2, image, multiple paragraphs, other <div></div> tags wrap only one such item. In addition, most HTML tag need to have some predefined custom style information.

--section-divs covers some of this. For the rest, do you want to wrap all images, or only some? If the latter, how will this be indicated in the markdown? Similarly, how will the multiple paragraphs (that are to be wrapped) be grouped?

The remaining wrapping logic can almost certainly be achieved via a lua filter, and shouldn't require changes to the writer.

As for the styles, can the desired results be achieved via CSS?

On Fri, 26 May 2023, 01:31 H, <agents-FcZObrvlYduBUy7/sJONFg@public.gmane.org&= gt; wrote:
On 05/25/2023 04:38 PM, 'William Lupton' via pandoc-discuss wrote:
Have you considered the --sections-divs option (= https://pandoc.org/MANUAL.html#option--section-divs)?

For example, this markdown:

# A

## A1

## A2

# B

gives the=C2=A0following:

(1) pandoc section-divs.md

<h1 id=3D"a">A</h1>
<h2 id=3D"a1">A1</h2>
<h2 id=3D"a2">A2</h2>
<h1 id=3D"b">B</h1>

(2) pandoc section-divs.md --section-divs

<section id=3D"a" class=3D"level1">
<h1>A</h1>
<section id=3D"a1" class=3D"level2"><= br> <h2>A1</h2>
</section>
<section id=3D"a2" class=3D"level2"><= br> <h2>A2</h2>
</section>
</section>
<section id=3D"b" class=3D"level1"> <h1>B</h1>
</section>


(3) pandoc section-divs.md --section-divs --to=3Dhtml4

<div id=3D"a" class=3D"section level1">
<h1>A</h1>
<div id=3D"a1" class=3D"section level2">
<h2>A1</h2>
</div>
<div id=3D"a2" class=3D"section level2">
<h2>A2</h2>
</div>
</div>
<div id=3D"b" class=3D"section level1">
<h1>B</h1>
</div>

On Thu, 2= 5 May 2023 at 20:36, H <= agents-FcZObrvlYduBUy7/sJONFg@public.gmane.org> wrote:
On May 25, 2023 6:42:49 AM EDT, Felix SOEDJEDE <= soefelix-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>You could use Fenced divs:
>= https://pandoc.org/MANUAL.html#divs-and-spans
>
>You can put inside headers, paragraphs, code blocks, etc.
>
>
>Le jeudi 25 mai 2023 =C3=A0 01:20:09 UTC+= 2, H a =C3=A9crit :
>
>> On 05/24/2023 04:51 PM, H wrote:
>> > Using pandoc 3.1.2 and am trying my hand at writing my first writer
>to
>> customize HTML output for a specific, predefined newsletter format.
>> >
>> > The source document is written in markdown, contains headers of
>various
>> levels, paragraphs of text, links to images and mail links. No lists,
>no
>> tables and no code blocks.
>> >
>> > The document is structured with an introductory section, multiple
>> identically formatted sections and then a final section at the end. I
>need
>> to wrap various portions of the structure with <div></div> at
>multiple
>> levels in order to achieve the desired formatting. Some of the
><div></div>
>> tags need to wrap H1, H2, image, multiple paragraphs, other
><div></div>
>> tags wrap only one such item. In addition, most HTML tag need to have
>some
>> predefined custom style information.
>> >
>> > This output will be manually added to a certain newsletter editor
>in a
>> CRM system and I cannot add any CSS information whatsoever,
>everything has
>> to be structured as outlined above.
>> >
>> > Since I am new to writing filters, I am looking for some
>suggestions how
>> approach the <div></div> wrapping when multiple different HTML items
>need
>> to be wrapped.
>> >
>> > Thank you.
>> >
>> I should add that one <div></div> pair may enclose H1, H2, image, and
>
>> several paragraphs until the next H1 tag or end of document. Another
>> <div></div> pair (within the just-mentioned pair) may enclose the
>image and
>> several paragraphs, again until the next H1 tag (or end of document).
>There
>> are some additional levels of <div> pairs but this describes the gist
>of it.
>>
>> Suggestions welcome!
>>
>>

I do not want to make any changes to the source markdown document, the appropriate processing needs to be done in my custom output HTML filter.

I am looking into the following (simplified) flow example:
- Add a <div> tag when encountering a H2 element.
- Add the corresponding </div> tag when encountering a H1 or H2 element or the end of the document.

--
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit = https://groups.google.com/d/msgid/pandoc-discuss/1F66BB1E-B5C8-4062-8202-D8= 2C5CE9A3D0%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+unsubsc= ribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.= com/d/msgid/pandoc-discuss/CAEe_xxgNr8O73TNGgV5y%3DgwiLAKB3WFuX5a49Vv_RJDto= jVcSQ%40mail.gmail.com.

It's somewhat close but I need to do additional customization. Where can I find the code this uses so I can look at it and use as a base for my own writer?

--
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= @googlegroups.com.
To view this discussion on the web visit https://groups.google.com/= d/msgid/pandoc-discuss/6d414734-e661-ae2d-68a1-4dfc9cb4f035%40meddatainc.co= m.
--
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@googleg= roups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/= pandoc-discuss/CAEe_xxg9ExgK4WCNz6G%3Dr%3Ds4DSCs4CBPERcUV431yov2UmeO8w%40ma= il.gmail.com.

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. traverse =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' directive and how I can debug my filter using different 'traverse' directives.

Thanks.

--
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/ms= gid/pandoc-discuss/574fbf9f-c1b8-711a-f14a-3acd75cbf634%40meddatainc.com.
--------------0AC91BF317B8F7FB2DA2532B--