From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/32708 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: Fri, 26 May 2023 15:43:54 -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> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------------16E6CDD7FF455971B8BF8AC0" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6682"; 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+bncBCEIZSNSZ4IRB7MXYSRQMGQENTUGSOA-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri May 26 21:44:02 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-pl1-f185.google.com ([209.85.214.185]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1q2dM2-0001ZZ-4Y for gtp-pandoc-discuss@m.gmane-mx.org; Fri, 26 May 2023 21:44:02 +0200 Original-Received: by mail-pl1-f185.google.com with SMTP id d9443c01a7336-1b01aa55219sf7637605ad.0 for ; Fri, 26 May 2023 12:44:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1685130241; cv=pass; d=google.com; s=arc-20160816; b=kM5jz31841Jupzrui+w/rtmggKcE1FBWr56E32Vsc6xQM9ei5v2D/gfdMyPtmL+kyD Oe1Pin/LKruZo5pHbGkU33TVpdG9onK9oENr/zxT4wZ0HRlU5hKJiJtwQZtOG+V/9QS8 ud+TkYqdvsaQD9AnthJGKtcGJjlc/1F8t4DDFJBjDx1CHhKUoZ5VuEjeydossc6xiLuc t7ojF63cATtrQyG1ZkGpJivQNCKrsTICK0VKvS1X7YKPSuBHF9imBK3uSOJ7tsaTyNM3 kheOG+i8zqkuu5jDgiBAM47bghpwepd92r/QWa8yDvSe6mzViBwdIy9/EUaQXjX6Qu+M gKyQ== 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:from:references:to:subject:sender:dkim-signature; bh=GLeeiv6Td9jku62JZB8xy/oKvgOTHNIMDad6veJEgrw=; b=RrVob/ueKvPfjIS2nXasES3qsBiUF1kN7DbHn1kGMAwyrzmDWZxljCvVOI+llNQuZx LgVj8ZXqViWFXP2/Duf/ppMjB9EdJ51d5zQXTKSY42R18IjeMmpfryJxeYbEXDac3tji cb9Us9AEo6fgTqrbtY+u5dXBefiI+Pl9HvpAYzWlNnRf8COul5JX8tV1BQgXdJd9QyFQ 8eftKb3zR5zfrb1d6UcrBCgtlB/3nxNJONY+Yb63rB6wITiKEIRvKrT8BUfsnscEDiS1 0qrDDRDanCcfkkS+ISgooJiCSY5zWD8B07vMupDiqPHRJ9kmJpzkju29h6LEbF4Iowl1 iLOg== 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.194 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=1685130241; x=1687722241; 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:from:references:to:subject:sender:from :to:cc:subject:date:message-id:reply-to; bh=GLeeiv6Td9jku62JZB8xy/oKvgOTHNIMDad6veJEgrw=; b=BgMHsAQm1PW/1NZJqxpebuyvMZOPdPPUogHBbr8R4Ha0MmP8YH11vGrW8u4TDVrLS7 MrMKcXDn/54cVMV8yDtHRHXxmKlXgPlJm9RbzHuH5Jiuh/Asru6aRptJoivvZTHDxdHl LKemLoUKTh6sHS3AV5jquYaTDgbAXt7EDxfHOvTPCAJ1FUyYfHsyJPm7Hh3fiSS+Ivbg mSMoURbIi7NDaz5o+k+akDcc6oDPwoz71DArCzbpnCurKxv7+Nydxwe7yxxMKQYywAXj OxSGJw/cFVIGVobVK X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685130241; x=1687722241; 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:from:references:to:subject:x-beenthere :x-gm-message-state:sender:from:to:cc:subject:date:message-id :reply-to; bh=GLeeiv6Td9jku62JZB8xy/oKvgOTHNIMDad6veJEgrw=; b=jG9Te84ICfPeuqZ9gQ19C+TgQKa/pDTPjKcmr2VXYtsOB0TwphcBx954rJlKvJPFz+ UpXhLAfLH5QhIxR1c9djd+a+1L+/7f0Ya8JbizJPRSahxjkIk6s62hTy2SJJ/yI8NlEE zSJwMegUWdqszogDUhdxHeSAH3/xHqXozySZuz0/ZaASxB1TXi/biqn6KnxNLKTbS53D LctsrTW76fPfafP4/6RIh6vTgpC8 Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AC+VfDx+gVT8930kpV7Ob/3LnBvux2cZ1OLZj3FjqxfTnzvl36YR4Gjb ijdR1cSKtFvaPed258XyKHE= X-Google-Smtp-Source: ACHHUZ7obDLJ9S3lGcIxDJH+fwMup1ngkd0Nfge11QflllgfHY+Nzx3Ry2JpPYweGrc3UKoumkSStA== X-Received: by 2002:a17:902:d4cc:b0:1ad:c627:87de with SMTP id o12-20020a170902d4cc00b001adc62787demr4286227plg.32.1685130240760; Fri, 26 May 2023 12:44:00 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a17:903:1009:b0:1b0:22f3:8d5e with SMTP id a9-20020a170903100900b001b022f38d5els418978plb.1.-pod-prod-06-us; Fri, 26 May 2023 12:43:57 -0700 (PDT) X-Received: by 2002:a05:6a20:9188:b0:10e:f800:2d28 with SMTP id v8-20020a056a20918800b0010ef8002d28mr414926pzd.48.1685130236849; Fri, 26 May 2023 12:43:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685130236; cv=none; d=google.com; s=arc-20160816; b=BKNRjDd/AVpTRv1ZxpVhoV7clMdra5p+xcy3f5IWdr2TVeMp1q2iX5EBdxmspAHbQF qqhTeTvDMZ8x1OuucMBPPW8470/rfJk9/TEgSmJGX8BTC/6esr1NdueXFP5yMeDPVmsF mOPae5V42eTuYl/TGUi16hDQiWtHPTzZjADiD33ZHQ940GZ4yrwwFTOclGl8+oBkXYv/ JrzTgE+qBmiaW1r6KEgSYzxBSxzAJvm3NhhI+JL8LkM3oifsfl24XKzyqby5uO356hnO LSchNuMySOI/K3AtzbRXzKfWco3hDJgjlOb/mYxg/4BBV+GqhZNa5Acl5gZWTXhZjxP4 bMpg== 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:from:references:to:subject; bh=W2tib8nR9WQTpSYyCcN1Azk8eCI4ViBUxNoXkkWgOxU=; b=fJ3NmrT9mmCE0nm/lq1yFeV4HhqPKbWU2vWHRSzzHvk2qtw2HeYHT7hgwgBYOEzMVk 0PWe23omL4zeSkcGzpEngTcj5P6MDM9xE/U6SajbuqvRJ/C41aOVkVfJud3ic1kenO4I 0OKPrejCd8eSbiScrA85jpPsWMzL/I5cZPFX/ycac2yQTjfhsjjNtJVhkt92f+Z2sXAW mf5FYsAmXPXjpg34wgPUwQnon/mEGs0BNcJiEPl8e7TMazd7YFyMFAQn9aneNrUgLCNN NpO1m5pjX+bS3jHLmRZ87XZUFz3W/efb1SruSt6k5B6a1RrmPzwKbBQveSTIeNr8r9Ua vBRw== 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.194 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.194]) by gmr-mx.google.com with ESMTPS id ft15-20020a17090b0f8f00b0023f99147cfdsi777275pjb.3.2023.05.26.12.43.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 May 2023 12:43:56 -0700 (PDT) Received-SPF: pass (google.com: domain of agents-FcZObrvlYduBUy7/sJONFg@public.gmane.org designates 74.208.4.194 as permitted sender) client-ip=74.208.4.194; Original-Received: from [192.168.1.17] ([72.94.51.172]) by mrelay.perfora.net (mreueus004 [74.208.5.2]) with ESMTPSA (Nemesis) id 1M1IF4-1q5NAn21wA-002lct for ; Fri, 26 May 2023 21:43:55 +0200 In-Reply-To: Content-Language: en-US X-Provags-ID: V03:K1:0WXwXC0u0XvWWIMny0z96dyYsep0oAuwjRYQT+v3cdHMNaVzZZp 8TW8tmNZGmEbgsWPwhUWshK5QvMVuf9Gj0S7zxz+qliXX7fYRRfZEXL1ZmYESAvqy2R+tuN 19W43oXxnFK+M07VksQ4P/tXkHtsq5WVM9TszU8+4TH+GaGwG7n01HLaRBdzWKmE6nvsogN w/9RhF4rn0gaxj+snXRgg== UI-OutboundReport: notjunk:1;M01:P0:WoHMHYupHR4=;r8czF3WegpYQo4W3ZAZDRQVKo3F ZfL7yaWPa9G/kaFWiC4aru1lnV5G6rJJANj2AHTdNfSTrQnV2tx9Xzu2T46YoNMF0+e1OPsKU NEkfWWxzGfGJxkZJRLeGsKoNxzDZ2BR5mrzZrgQ0hN7mIXxRvm2L2Z1XaTJtFg/9SRH1Fok5S ieO5JUxUWlFcLz6OoGlNu2E924mDs7FDjgtsUQdH/R1rN7asY1N1LPRG9qeBdyBG1fBxR3SnL jvtK4Hs343U9VKwuz5GQiUPhqJySqBM5uQNW8trzp3QOJf/2jXeR+gKKgh3GEq7fu6veBOLmu Vc6uAb/HjDAR3iIsbNXs5Xf+nxozAiJPEpBICcy9fXEwX1Y2HY22pqpMBmQRxpkkMKWQKH/bx Soq9OTfc4SK+l+UZcxJsUtPvOmRTr4Dlw90wk+m0C7aNUCXOuhJfVlHhTo00YPjjLxn9Z67ms m2arHpbQYGFV5w3TZL6QpeyOIHtLiKSEZ3USnhse0QJ92ldhxYkYfLVPlgR6dnM5yZHaOoalk KrQxH7zSuMnH6k/Kok7s4vErVp7hBtld+6ja4fqy6u9itElPLm9cqLcsA/Kj7vrk/Jqx9V1QW vtHBCT85/844qv/WALqE1AJSl6gCC8lHLr6ysPecaaOmj+2HKnmmjU7t2hg+uXaRVHvSwEGCP NUj9EwBLDiMSLKUQo5g+Fh7zO88Qxs/EFMsFuqTcJg== 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.194 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:32708 Archived-At: This is a multi-part message in MIME format. --------------16E6CDD7FF455971B8BF8AC0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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, multiple = paragraphs, other
tags wrap only one such item. In addition, mo= st 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 mar= kdown? 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 f= ilter, 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/M= ANUAL.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 firs= t writer >> >to >> >> customize HTML output for a specific, predefined newsletter f= ormat. >> >> > >> >> > The source document is written in markdown, contains header= s of >> >various >> >> levels, paragraphs of text, links to images and mail links. N= o lists, >> >no >> >> tables and no code blocks. >> >> > >> >> > The document is structured with an introductory section, mu= ltiple >> >> identically formatted sections and then a final section at th= e end. I >> >need >> >> to wrap various portions of the structure with
at >> >multiple >> >> levels in order to achieve the desired formatting. Some of th= e >> >
>> >> 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 HTM= L items >> >need >> >> to be wrapped. >> >> > >> >> > Thank you. >> >> > >> >> I should add that one
pair may enclose H1, H2, im= age, 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 do= cument). >> >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 documen= t, the appropriate processing needs to be done in my custom output HTML fil= ter. >> >> 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 Goog= le 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.c= om/d/msgid/pandoc-discuss/1F66BB1E-B5C8-4062-8202-D82C5CE9A3D0%40meddatainc= .com. >> >> --=20 >> You received this message because you are subscribed to the Google G= roups "pandoc-discuss" group. >> To unsubscribe from this group and stop receiving emails from it, se= nd 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_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 Gr= oups "pandoc-discuss" group. > To unsubscribe from this group and stop receiving emails from it, sen= d 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%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/msgi= d/pandoc-discuss/CAEe_xxg9ExgK4WCNz6G%3Dr%3Ds4DSCs4CBPERcUV431yov2UmeO8w%40= mail.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 i= nformation etc. needs to be in my custom PDF writer. This custom writer wil= l - obviously - be specific for this single dedicated use by myself. Any pointers (links, code fragments to look at etc.) as to how I should tra= verse the tree to be able to output my custom PDF would be greatly apprecia= ted since this will be my first pandoc 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 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/cee5298a-37c9-6e17-6370-eecda5d9d6fb%40meddatainc.com. --------------16E6CDD7FF455971B8BF8AC0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On 05/26/2023 02:33 AM, 'William Lupton' via pandoc-discuss wrote:
Good. From your original message:

>=C2=A0Some o= f 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:3= 1 H, <agents-FcZObrvlYduBUy7/sJONFg@public.gmane.org> 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">
<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&= gt; 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= @googlegroups.com.
To view this discussion on the web visit https://= groups.google.com/d/msgid/pandoc-discuss/1F66BB1E-B5C8-4062-8202-D82C5CE9A3= D0%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@goo= glegroups.com.
To view this discussion on the web visit https://groups.google.com/d/ms= gid/pandoc-discuss/CAEe_xxgNr8O73TNGgV5y%3DgwiLAKB3WFuX5a49Vv_RJDtojVcSQ%40= mail.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@googleg= roups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/= pandoc-discuss/6d414734-e661-ae2d-68a1-4dfc9cb4f035%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-/JYPxA39Uh4Ykp1iOSErHA@public.gmane.org= m.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-d= iscuss/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.

--
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/cee5298a-37c9-6e17-6370-eecda5d9d6fb%40meddatainc.com.
--------------16E6CDD7FF455971B8BF8AC0--