From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/32717 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: Mon, 29 May 2023 00:31:53 -0400 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> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----KUD6BB2G52F4RJ5YB42YVEQV07X7ZO" Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18044"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: K-9 Mail for Android To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCEIZSNSZ4IRBPOV2CRQMGQENA4MWAA-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mon May 29 06:32:01 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-ot1-f59.google.com ([209.85.210.59]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1q3UY4-0004Ry-MR for gtp-pandoc-discuss@m.gmane-mx.org; Mon, 29 May 2023 06:32:00 +0200 Original-Received: by mail-ot1-f59.google.com with SMTP id 46e09a7af769-6afa55eed81sf2332953a34.0 for ; Sun, 28 May 2023 21:32:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1685334719; cv=pass; d=google.com; s=arc-20160816; b=B3vUrOl7XXLMOH7fMKg2UFjSpc//tZGgxLhxR4Q3MRmoz52CZq/0oZvVmisNUdW7IR 0d1Y/+ko5/w+DA1DAqPTEqW5emhX3ElM6+8YM+sYR6GwmkHQRhkBAk9F2U4gGvx4+aur SRiyRKh3VAZCxmn9w5kdO7ZObuOXwY/8ui0inpYem1TEXf22rmIqI5N74tmom1Y6zA3j DOmThtvYIhWyy91p20jhvTzv6KjViJjA8bZspYaQOMtzDqXvWJ1Rso+PlkvAuk1JsTRR cKrwjxiay9Kqyk++yqZOq7BFJRNyXT740lWXNk1zogrcbHYoIpTdXGeQE6vJZmwpzYYr lRlA== 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 :message-id:from:to:subject:content-transfer-encoding:mime-version :references:in-reply-to:user-agent:date:sender:dkim-signature; bh=WvIqOIq6hHVHVRs5nN/6j2GZjiaDhEPbwUGRXk6PBo4=; b=LTO6v5xTY7LwB/AHo0JBm0kcYRuLnyVuQPEg444vjkQxAP+m0tBCPAIVAIu+dk8cV9 C3xktmQUxvs/wQ6VLry2jVQUM/YGPnmMT4Z7daLxIFdkFNvOW9ylqHjpqK7D+Ttqb7Hs mHAmpAEOQeBHeTQi5MyGRqRz129nCLTmO9MfnPw3yqscJncmOnU0YK7UHBTB3ziGi2R/ pG7csryiJCuiQ+9v/nagktNY+vd7RnPQfJWi4NfLWqgEdvQgkiz3/CVpNE0RAmrreu64 pMHzW0ywUNLHiBdaZsxm8A+n8utdB+UMDXq6XzKZo2CfRwvuE6XzEZ2qQ1g4czWWtKt1 QshQ== 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.197 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=1685334719; x=1687926719; 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:message-id:from:to:subject :content-transfer-encoding:mime-version:references:in-reply-to :user-agent:date:sender:from:to:cc:subject:date:message-id:reply-to; bh=WvIqOIq6hHVHVRs5nN/6j2GZjiaDhEPbwUGRXk6PBo4=; b=Eq00Vg9VnDN1g38TVaEy2Q5dnHi1tgsmtFZo9dcZRTYmB0UQoUZq1/uqPP3RKbtii0 y5AIUUAO9DyLD00x0hlUfJOveX3EAb3Fs81OEnVDLNwMoJcY8N+G2nzfwMmsoRnVG1U/ So2sL7/wQnMORkghY0bnlho+zMOUyptQ4cxQ3D9UbjkQWPVtjuJJL64Uf5xVA+adm6nh z5NXfR32yRwSuvbo5PFt8wG77wCW9HbHjVd+UKn5WLY9tu3BprBFQWgrM/+hbfNl8hF2 PfgEcwe1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685334719; x=1687926719; 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:message-id:from:to:subject :content-transfer-encoding:mime-version:references:in-reply-to :user-agent:date:x-beenthere:x-gm-message-state:sender:from:to:cc :subject:date:message-id:reply-to; bh=WvIqOIq6hHVHVRs5nN/6j2GZjiaDhEPbwUGRXk6PBo4=; b=YrDTpR4Y3cRWXbSoBxIlwPpWdd6G7F/N09303CKX/yhSxsAOoxgWkYBCWhidGeknIn w17wKzHY9hadhQGxkblu7PThf8fEOHufILHAmJA3i8xxNO/fxsPPQFgvu32Ldv/9X0iL nLB0sFZwz9x4ocyTr83jgambZXIKwQe3PHsRhdbYJCuvt58jNQD+zzIm87ElDU2TBIXv UWauCcyhAk+c/ZyikiU Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AC+VfDwer4MeLkEtp7kkEOvK88/tuQcVZh1ky+vRjXW5ANlpEiMz65iq uiR0+P55sCkGuojxESLyqfQ= X-Google-Smtp-Source: ACHHUZ57TBlPkb624a5hjJTntgBLH0rohqHiZIU8gf8VEIB6ItvYFJHPLUIMO7duE9ErWQiJdElamg== X-Received: by 2002:a9d:77d7:0:b0:6ab:8d3:5209 with SMTP id w23-20020a9d77d7000000b006ab08d35209mr2593774otl.5.1685334719545; Sun, 28 May 2023 21:31:59 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a4a:e6c4:0:b0:555:66e1:464 with SMTP id v4-20020a4ae6c4000000b0055566e10464ls496884oot.1.-pod-prod-03-us; Sun, 28 May 2023 21:31:57 -0700 (PDT) X-Received: by 2002:a05:6808:1387:b0:398:2a8a:1e08 with SMTP id c7-20020a056808138700b003982a8a1e08mr5543982oiw.46.1685334716911; Sun, 28 May 2023 21:31:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685334716; cv=none; d=google.com; s=arc-20160816; b=UYqNr1scsblVzE3unOBFaSsyxM/B2Rv0yDmjXRQUXFMNZdmlMlDvq8HPXfUAoVO7DH +6OBj8+WH5GVwfmDfJKOTpfsnTyP1JvpuT6CeKvGyLDLOP0dgN1NetXvZ1eROafylPk1 i2ZeooWMw84qIHTsC4IG5D0ji1Tm81SbZY1mK55IDjVqYjKS5DZkHKJ1Z4uG/I09b7P5 fgf0VAbi9RBY1IxirBpK+4St00/6hVrw5nyqPQGT51tfrfug6ujJS89vlGpZeMaWJ1kk qB74zJwsD0712FpiBNkUMaT7FWIRuEJocR+NCiS0nr1AnEMVfGmjPFXJxtL0G3fF3zh2 Ia5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=ui-outboundreport:message-id:from:to:subject :content-transfer-encoding:mime-version:references:in-reply-to :user-agent:date; bh=MAL3Z3VThcFReT3Dff55Ii36tWMRbGzpO+6EFOxLTyA=; b=hsnEpUCPO0Whz1COfaZphla5LxiJGO7+85mWPQrzDD1SI+Ja3USYYFiWDXJo3FWfDi MKQfpWipCH65XTdYncLEf87Cn+aAxjLAnmPv2tB44ed6WELgBz3oDwGh3h5GWDemf0U6 V6w2lGSldrijQH36FvOy1eliLdLj8WSbSXnS7kuMIEstCb/ceLDfYThZK8aWooIobolu /Y0zYb6RkLbWB8tjTuCQ9cr7/A3bBQOlvZqNRdEAbFOuglr8eyAynKsS3B+vTbGZ+6IL DlwWX3YVapdoOjdQYL9PjzF2x9nvi3o103jZ+pOl7HbCc2/pf86QPr5rMpe1votg/aks MqCQ== 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.197 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.197]) by gmr-mx.google.com with ESMTPS id fg11-20020a056808640b00b0038e4d42b941si995475oib.1.2023.05.28.21.31.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 May 2023 21:31:56 -0700 (PDT) Received-SPF: pass (google.com: domain of agents-FcZObrvlYduBUy7/sJONFg@public.gmane.org designates 74.208.4.197 as permitted sender) client-ip=74.208.4.197; Original-Received: from new-host-8.home ([72.94.51.172]) by mrelay.perfora.net (mreueus002 [74.208.5.2]) with ESMTPSA (Nemesis) id 0MYQD9-1pZ1Ny3IY5-00VCrj for ; Mon, 29 May 2023 06:31:55 +0200 In-Reply-To: <4c58dad0-bd86-608e-2d68-74bd6f2f808b-FcZObrvlYduBUy7/sJONFg@public.gmane.org> X-Provags-ID: V03:K1:FFlHFNqzyPeA7Bb0nVTmfBn6I2Ns1l8NMAtf8kV1+SSEfD2FHnd sWbPOnvXQ1D2FBcOfpoG/wxMS2P2Y3Tdc+reRiAfOO4DjL2sIJ1GitVXP/mfFTjIvvRleNa zgXiAw6I/xgCHmHQHKkdYd5CR+LxPTqskANQNZAGgGPHtBsznduAj+WPV5CQSAsUHQa6uxv Z2InW2uuDpSXGV2xZy1iw== UI-OutboundReport: notjunk:1;M01:P0:6fyWFplIS8Q=;ruI9C6/mYYjbMjD66ixV9AOOt1I O+maiC3tcxTA86bMnIJKs4K9j6dN91bNuQVjiFc82wNoZ7sz+yCiBRoBzqW6I2ug1KLcasuum qAqeuAdUovGfRiJxuEKo9yxCkHM/78Ngp5RHw/9xs1PPYh5e3r+MKPtC5Np3vB+3vEdYWIwqT K4ibqnmwxj92d90JZtZmsHMw92HD6iR/G9UnXKQ8swUsU3JdkNDjJniNjwR48++ZCi8vm9PL5 VVENc+zfkdOu8jgbdfGgQYCMQgUc8ZxIXn9FR0zKMlk22AB0FJczY8Vk4732hzkqcbmU/T9hX pLTGjmx2aJKYw+VD57l2nqdsuOuo3pbhes/IFvYrliX67HmX6qpG0Un8Fks4vHWTe0X1elTj/ WpxMxGpWBuUHexT+v8HqSnhgKw9Tu8wEv8QyXATJDNWxxSy9Xt1yHmSaxMLC4mwk+hyc/zJpQ k9Ob9/yRxo2Vo7cK4xU6BThOFjovg77Xybhs5dUtCjlgg4Qm/vEd4bbedzbafxrs+aNoyCP80 UuJKCiemyy9WRFa2Z3W34iHxlcmX+1OCZmYz7Swa5JUgK6ZnRprSQXkAVAn/lt1CZBWEk8Pln dGvSacxVqTmsJDNMqyIGxCfWHk2Sf1qfpRMppZQK9VC4hkEGHm6sX1nj5VsQvdRu6tz4tkuij mfrzN8zl9GwiwAXpsesOuOzB6jea2cGfRby1lIDPyQ== 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.197 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:32717 Archived-At: ------KUD6BB2G52F4RJ5YB42YVEQV07X7ZO Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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, multipl= e >paragraphs, other
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, > 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 >>>> >>>>

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=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 >
at >>>> >multiple >>>> >> levels in order to achieve the desired formatting. Some >of the >>>> >
>>>> >> tags need to wrap H1, H2, image, multiple paragraphs, >other >>>> >
>>>> >> 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
wrapping when multiple >different 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 >document. Another >>>> >>
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
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
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 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-D= 82C5CE9A3D0%40meddatainc.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, 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%3Dg= wiLAKB3WFuX5a49Vv_RJDtojVcSQ%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? >>> >>> --=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 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-4= dfc9cb4f035%40meddatainc.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, >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_xxg9ExgK4WCNz6G%3Dr%= 3Ds4DSCs4CBPERcUV431yov2UmeO8w%40mail.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
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. > >--=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 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/4c58dad0-bd86-608e-2d68-7= 4bd6f2f808b%40meddatainc.com. Upon further reading, it looks like the traverse directive might only be ap= plicable to filters when the AST is being processed=20 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? --=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/F41D20AD-EDDD-4AF4-A9AD-AAB8581086BF%40meddatainc.com. ------KUD6BB2G52F4RJ5YB42YVEQV07X7ZO Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
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:

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.=

--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@meddatainc.= com> 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 following:

(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">
<h2>A1</h2>
</section>
<section id=3D"a2" class=3D"level2">
<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, 25 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+unsu= bscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pa= ndoc-discuss/1F66BB1E-B5C8-4062-8202-D82C5CE9A3D0%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@googlegro= ups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CAEe_xxgNr8O73TN= GgV5y%3DgwiLAKB3WFuX5a49Vv_RJDtojVcSQ%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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org= .
To view this discussion on the web visit https://grou= ps.google.com/d/msgid/pandoc-discuss/6d414734-e661-ae2d-68a1-4dfc9cb4f035%4= 0meddatainc.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@google= groups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/= CAEe_xxg9ExgK4WCNz6G%3Dr%3Ds4DSCs4CBPERcUV431yov2UmeO8w%40mail.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)
    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.

=20


Upon further reading, it looks = like the traverse directive might only be applicable to filters when the AS= T 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 d= ebugging it?

--
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/F41D20AD-EDDD-4AF4-A9AD-AAB8581086BF%40meddatainc.com.
------KUD6BB2G52F4RJ5YB42YVEQV07X7ZO--