From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/32709 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: Fri, 26 May 2023 22:01:23 +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> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000dc9e4a05fc9f0aa4" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20646"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCS4HJ6WSAHBBMV4YSRQMGQE6AUWT2A-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri May 26 23:01:43 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-lj1-f186.google.com ([209.85.208.186]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1q2eZC-00059n-R6 for gtp-pandoc-discuss@m.gmane-mx.org; Fri, 26 May 2023 23:01:42 +0200 Original-Received: by mail-lj1-f186.google.com with SMTP id 38308e7fff4ca-2af28aae675sf5237951fa.0 for ; Fri, 26 May 2023 14:01:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1685134902; cv=pass; d=google.com; s=arc-20160816; b=XF2azH5wf0cytwRj89o42SAAfTeOw4+5gvQqMXTjZuHrPqZQvnxnETKA2mWpGb9fRx yDJCCv9l/9MhrdF8pTKtqZYiZJje4nmWH6E2n1+UiueF06QVd6dxitzP/z7ItcWo209L jo1qDYzIdZcTY3S6b+IrzmWyJ69PeGjCSbVVTjn23/IH5MHTD2DT25qGNlfdAtPv1T2+ lmuDZI0hx60NVmn+jiTfUiH4kdmbUJnVpjsKbfWMzAvMkdF4dp8S9kFofyTFjBaz2+Ao XHEHH/qshHwuCTPhKKT/huu/gaChqBFLERmna7wRFL2DSsw3/OcS/575AI1FOoWC2cVC 3oPQ== 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=p8OCEG9fQNyBoAXpCkXjzoOylQd50ZXMvjhM7xMpGOk=; b=Ci1DHELsBAAOdajQZdv/Vs2DJ7H0Cav1rltn5Fu4xtbE9ZS+wha7nblN+xoKOSL//1 n4Oqs/hup1FCpbpxIjg6PJwlv1ddCFFigLu9f2Qflq0Ot2xTn8AwzWNHWZ8m5LnXUxmF WArOg3/oqwyYODaPvxR+A+Fir6JHVDHcOf2HeCgvXSmfGlar5aYviX2eIFHbVMIOCLH/ mijRHFIu+A6gkhre3Y1oQVO0DhC769nXM+u1BXWlLKMBJbY95P8Io5h926MS/NF7XSGv PuHRDwwOMJo8Emj4PWtnA3sYPJKWi05lkxacpxE0eBkLFPsVSy10qkoX8j1E5F1LvCBd Ybow== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@broadband-forum.org header.s=google header.b=fBMNYuOc; spf=pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2a00:1450:4864:20::633 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=1685134902; x=1687726902; 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=p8OCEG9fQNyBoAXpCkXjzoOylQd50ZXMvjhM7xMpGOk=; b=jO1fvO29mJXP3vAI/6G2XoFXncu80Y0L1phQl2fkoS0nnl8B3BN8EfQ2nOOOBGW//9 xuw6H2Sr++F0UDghMcrUAkzBpSnoB8Qg+I2/4YnpbFst1vxFpG5QFVQ4ZcoCTKAmvQNm EbInoB/L5Fvbk8XE2sRZeYzbsqtQwMhccYMbUnNq5kYahhCrX0Zn/Fr546hYHGnKBCm9 IiV7TTmjrRmQP62UoQwNYn1yZMuKA/j7/yaGpK5VuqAiK/mnzUjeM6ac/j+WnfetAcJX SFDjuCRX8eQSZeY9rFwzfMQXHIov3s9530Ifq4ejinD2Z47mBEqCINcM5iWx8wUgMKNm Cq X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685134902; x=1687726902; 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=p8OCEG9fQNyBoAXpCkXjzoOylQd50ZXMvjhM7xMpGOk=; b=bZmRg2ifKyp3FlhF9/nEm9jLHNZ0HHLSnjNE22rwn80YQABSW5fRkbD9iKVwkD9Ua8 tDWYbl9GEH8aBkXppkG0OHFerXVGM+Si5NYj6d/XzkUrihWEX6jbVdDKek18SHFNyCqX hmhMBtaGWzYSyyS8oWyfe9sZ81lqOH9ScNtdMYfO7ejuH1Rxsby24a6st3KIoP/yVP/v fro4vFM6WnfAoO7GnbhWT5LBVo/CWYV/MRgGx7vWI3Hb5g5uL06AaE0iZlrToFz+NQg0 iyxuk+vXlndtR X-Gm-Message-State: AC+VfDwDi9abvmCfH75jkD2upMIKKvsLCRSB9UzgfWC74RFoO05lBtEH JJO9z2ex7bUR/xoIpIzOc3E= X-Google-Smtp-Source: ACHHUZ4QGuqhJ1G90DusKnAZAeESQAEx/vD5En/N1pKb65AlanK4lAQJ40YjJZRUzLhmEVmSMGjTsA== X-Received: by 2002:a2e:8610:0:b0:2ad:92ec:dd13 with SMTP id a16-20020a2e8610000000b002ad92ecdd13mr875629lji.8.1685134901996; Fri, 26 May 2023 14:01:41 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a2e:8788:0:b0:2b0:3011:17d6 with SMTP id n8-20020a2e8788000000b002b0301117d6ls1262880lji.0.-pod-prod-09-eu; Fri, 26 May 2023 14:01:36 -0700 (PDT) X-Received: by 2002:a2e:7e04:0:b0:2ac:7e64:ef8 with SMTP id z4-20020a2e7e04000000b002ac7e640ef8mr1160712ljc.16.1685134896884; Fri, 26 May 2023 14:01:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685134896; cv=none; d=google.com; s=arc-20160816; b=H2a8986sy4XeKVrKnzt2dtREYdu2EglW5+NoXKJnNBuXo5FMV+ut5ECNVhmPimmcq4 QqrB2cIQEZW80us4zJrAsBxNmJir/bcY9Qzdrw8Z0mSwlLqhk1CfR5WmWr8ppD0LJujP rLxZwXTYoDEdMANDZGQj8PSG+WCsbsyjBx1mGxJDos7pcf+Xv6jBvYsWQZBzUPU9NwBF 4UTj9pCP9BfAJpPHrwhxbQgST2msEwChZUwR0qdBpsVPCkU25Sj9Zj156NOrf7O4CzkN /bOtbF05ZC9qjJCdjvLNjGp6TesiC1EhXUtnULtOlvvcJuODQ96abdlECJoYmllhCwW3 R3Fg== 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=PYedWdEu5ArD3yDuJU/nJJIFYxCF4WMAkh9fe5ENTfA=; b=Ns47vRui9s6qGLcEp7WcbIfqjUUHKOSjCEXhus6HB/LB4y238GoMfZ795+rv5OJWKK 8GiHLa+mSFdQ5MwwMeM8QNm94fBnxRwn9zrqoNsnpzvbZ5YFOcigGFBHvkJxxQMjJXNV KPYuCBF8mweCbhcptmemZZs6/hOE4iTO8m5hzMpedtUDWvPKkuojecHcR7JizmOmjyY/ pYPMECoqDfhHqN8FafNXpP45Nm0jbxY/JARAtjFRlw+9bgxcL4/l6MIotFuE4DvrL/bM 0F/TIYOKJYu11Gz/dumIAdzrDRUzLTxxbHKulHCK/n7FyNv6YvWMFfEZB7DYQAMIxd/3 TRZA== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@broadband-forum.org header.s=google header.b=fBMNYuOc; spf=pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2a00:1450:4864:20::633 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-ej1-x633.google.com (mail-ej1-x633.google.com. [2a00:1450:4864:20::633]) by gmr-mx.google.com with ESMTPS id a4-20020a05651c210400b002ada9b7eacdsi402438ljq.4.2023.05.26.14.01.36 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 26 May 2023 14:01:36 -0700 (PDT) Received-SPF: pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2a00:1450:4864:20::633 as permitted sender) client-ip=2a00:1450:4864:20::633; Original-Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-96fdc081cb3so175186866b.2 for ; Fri, 26 May 2023 14:01:36 -0700 (PDT) X-Received: by 2002:a17:907:74d:b0:962:46d7:c8fc with SMTP id xc13-20020a170907074d00b0096246d7c8fcmr3773877ejb.21.1685134895778; Fri, 26 May 2023 14:01:35 -0700 (PDT) In-Reply-To: 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=fBMNYuOc; spf=pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2a00:1450:4864:20::633 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:32709 Archived-At: --000000000000dc9e4a05fc9f0aa4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable How will the styling be added? Directly via 'style' attributes in HTML elements or by some other mechanism? If via style attributes then you might as well use CSS (which could be embedded in the output document, potentially via use of a custom template). Perhaps you could give a short example of what your ideal HTML would look like? Sorry not (yet) to have answered your question directly, but I still don't understand why it's necessary to create a custom writer. BTW, from your other questions (which led to John sharing his djot writer) I assume that you intend to use lua rather than in Haskell. Is that correct? On Fri, 26 May 2023, 20:43 H, wrote: > On 05/26/2023 02:33 AM, 'William Lupton' via pandoc-discuss wrote: > > Good. From your original message: > > > 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. > > --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 following: >> >> (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 write= r >>> >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 hav= e >>> >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, an= d >>> > >>> >> 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 gis= t >>> >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. >>> >>> -- >>> 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/1F66BB1E-B5C8-4062-820= 2-D82C5CE9A3D0%40meddatainc.com >>> . >>> >> -- >> You received this message because you are subscribed to the Google Group= s >> "pandoc-discuss" group. >> To unsubscribe from this group and stop receiving emails from it, send a= n >> 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_xxgNr8O73TNGgV5y%3= DgwiLAKB3WFuX5a49Vv_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 o= wn >> writer? >> -- >> You received this message because you are subscribed to the Google Group= s >> "pandoc-discuss" group. >> To unsubscribe from this group and stop receiving emails from it, send a= n >> 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/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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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 modification= s > 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 > "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/cee5298a-37c9-6e17-6370-= eecda5d9d6fb%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 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/CAEe_xxiHuhXHPnShyPPA_L9O4ffvg2mU5YuKEg8Ops4eKMqLXQ%40mail.g= mail.com. --000000000000dc9e4a05fc9f0aa4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
How will the styling be added? Directly via 'style= 9; attributes in HTML elements or by some other mechanism? If via style att= ributes then you might as well use CSS (which could be embedded in the outp= ut document, potentially via use of a custom template). Perhaps you could g= ive a short example of what your ideal HTML would look like?

Sorry not (yet) to have answered your questi= on directly, but I still don't understand why it's necessary to cre= ate a custom writer.

BTW, = from your other questions (which led to John sharing his djot writer) I ass= ume that you intend to use lua rather than in Haskell. Is that correct?=C2= =A0

On Fri, 26 May 2023, 20:43 H, <= agents-FcZObrvlYduBUy7/sJONFg@public.gmane.org> wrote:
On 05/26/2023 02:33 AM, 'William Lupton' via pandoc-discuss wrote:
=20
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@= 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=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&= quot; class=3D"level1">
<h1>A</h1>
<section id=3D"a1" class=3D"level= 2">
<h2>A1</h2>
</section>
<section id=3D"a2" class=3D"level= 2">
<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 l= evel2">
<h2>A1</h2>
</div>
<div id=3D"a2" class=3D"section l= evel2">
<h2>A2</h2>
</div>
</div>
<div id=3D"b" class=3D"section le= vel1">
<h1>B</h1>
</div>

On Thu, 25 May 2023 at 20:36, H <agents-FcZObrvlYduBUy7/sJONFg@public.gmane.org> wrote:
On Ma= y 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-an= d-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&= quot; group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discus= s+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.goog= le.com/d/msgid/pandoc-discuss/1F66BB1E-B5C8-4062-8202-D82C5CE9A3D0%40meddat= ainc.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+unsu= bscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discus= s/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?

--
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/msgid/pandoc-discuss/6d414734-e661-ae2d-68= a1-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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https:= //groups.google.com/d/msgid/pandoc-discuss/CAEe_xxg9ExgK4WCNz6G%3Dr%3Ds4DSC= s4CBPERcUV431yov2UmeO8w%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 pandoc-d= iscuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msg= id/pandoc-discuss/cee5298a-37c9-6e17-6370-eecda5d9d6fb%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_xxiHuhXHPnShyPPA_L9O4ffvg2mU5YuKEg8O= ps4eKMqLXQ%40mail.gmail.com.
--000000000000dc9e4a05fc9f0aa4--