From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/31685 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Albert Krewinkel Newsgroups: gmane.text.pandoc Subject: Re: Transform a fenced div to mkdocs markdown admonition format Date: Thu, 03 Nov 2022 22:00:56 +0100 Message-ID: <87h6zf698z.fsf@zeitkraut.de> References: <7AF275BD-12EB-4424-84E5-1A45FF675520@gmail.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1166"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCZJF7XJTILRBMOZSCNQMGQEKCUCI7I-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu Nov 03 22:03:49 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-wm1-f57.google.com ([209.85.128.57]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oqhNN-000Abz-7t for gtp-pandoc-discuss@m.gmane-mx.org; Thu, 03 Nov 2022 22:03:49 +0100 Original-Received: by mail-wm1-f57.google.com with SMTP id 189-20020a1c02c6000000b003cf8e70c1ecsf395193wmc.4 for ; Thu, 03 Nov 2022 14:03:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1667509428; cv=pass; d=google.com; s=arc-20160816; b=ZeSV5iCnaAdjbrL15cR/MeqY90Rls5lhlJFfa0JsqjFQXdgfiDvaE44POgxh4QqYZB LjsikKV/8YaNQfIvIbIUajv5rgv2YOppru/NIU8hku8QVPvJF6k4hGtqv6y/hZznJwFs kwGP1Ga3OoTlTbVrkfLRcqLEUf6wm3iBpVFr8GXGyQkL4xJsIWPTYicfTfMwSSTMLb3c 0HkTiHTXa1tzbiUjj+lix+EGo2m58Ov4g3tYpZxzCkMFICmmvm15vyxHA+Cb3LAuOp+J 38Al5vjspgUX/pj+rw82d/Kzgiv4z+z6wcCBtDpXe7jIfmQs+IwjJKTh0f/TbK2K26Md ik7g== 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:content-transfer-encoding :mime-version:message-id:in-reply-to:date:subject:to:from:references :sender:dkim-signature; bh=lJAyX+JZ4X+YFZ61ZVSQlBel2rv51JDf8oh9E/tcry0=; b=q9vjdGbxnIpYKAHEKTfNLjgRDnHIev2ocmlHrwube5JlLg6OAsQ/FvPiGSdxUzIwXv kwuAoC4ZadMz63vTe2myF89XJPif6aZCXJFuUoiIQyIMIcpXt9uvXXQJEfboOTv1jaLX T1Uim+xnKiSmKcio4nRVKm01OJOqHfLeEORC2VVtxrXcJT1FGpHtK9Ug51SSmr3Eauzh U/C10jRk1DmEa9Xnk1bH6ZOUQ8bhrcyjskUWsKeNwLJYCCdQSQQWht9IfeEayPTpYDq7 PvrYzCQ4hoQ/+5ST3qHMMxlnozUYqD2Fnqaj4GCt9d5+ZkRskvDdyKIWFQ2fHApArgD+ HgYA== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org designates 80.241.56.151 as permitted sender) smtp.mailfrom=albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; 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 :content-transfer-encoding:mime-version:message-id:in-reply-to:date :subject:to:from:references:sender:from:to:cc:subject:date :message-id:reply-to; bh=lJAyX+JZ4X+YFZ61ZVSQlBel2rv51JDf8oh9E/tcry0=; b=fZXe8HFnWl3SoxPOmh52PSYm/mf/9sJS4OKFVwWtZifPnfYl96aiL54qQIqCe1PaHS j1CkAlEwKh8ZICVCOqqrGCgh+JhJJ6JfKgJXQyEQ2jhrg80Bvw/Syhby8Sgb4BB1YNUo yd4OiJc71NSPpqpmNEq5YKmo91LwXULmn52pftHkbZiLNKskeoVXntEARpcel1E0CyoN eBVIB82Mu7DuChqV9J8gsyxM6OKSe1zQnOlVQsesN9oJOmeMRX+hzF601MoG9D58sSf0 iiy1hDGuXcEBYNWgLYoNaTbZ/EBUUyCMEK46BnBJqwCMm2H+nhjnJ6cz97QypqEUl X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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 :content-transfer-encoding:mime-version:message-id:in-reply-to:date :subject:to:from:references:x-gm-message-state:sender:from:to:cc :subject:date:message-id:reply-to; bh=lJAyX+JZ4X+YFZ61ZVSQlBel2rv51JDf8oh9E/tcry0=; b=hoZTc5COTE6y6dtby0fbm45m82MW5zZn0Fg8615RV+KMdMoG1G5ib8QiXJ1+k39Ygn 8gPTvIl1hComwGTYVldnRPmBq/bWhXKZq49pugkGO1uGhp3bk+1rZAHJY9e03DDYMsQj y4JnYLuyhpzBgkUeTfwR1YNoXDU2GcsfuJ2EnBZoG37keTBOsC/XeY1ddYo83BKfWRn9 l+MmCbwBqdGyVZilR2loT073j1GmEAPhQdU1uHlwPb/gV5vTqBB0ao8bd81RrxtDrgY9 Rof/INR/uP5Ep79f3aiZ Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: ACrzQf2iI8V9Ti5SWuvpAap6yZ9e830rLnfQBe0HBX8S89d3Rl6BhgJC XmXPQ5KFd8Lyn5s1XLV/7As= X-Google-Smtp-Source: AMsMyM53lyA3o8vWAqf1+8ad4RBPZmphBodas+I58wHU4Vm2EsTY8HRtpLaTpqsckj73094InMWPww== X-Received: by 2002:adf:f305:0:b0:236:ec3e:86a6 with SMTP id i5-20020adff305000000b00236ec3e86a6mr8024103wro.496.1667509428752; Thu, 03 Nov 2022 14:03:48 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a1c:43c6:0:b0:3cf:603a:2dd9 with SMTP id q189-20020a1c43c6000000b003cf603a2dd9ls896373wma.1.-pod-preprod-gmail; Thu, 03 Nov 2022 14:03:44 -0700 (PDT) X-Received: by 2002:a05:600c:a46:b0:3b9:9b97:9304 with SMTP id c6-20020a05600c0a4600b003b99b979304mr21008307wmq.34.1667509424288; Thu, 03 Nov 2022 14:03:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667509424; cv=none; d=google.com; s=arc-20160816; b=i6eTWmhloCK9fB2aowpk3hrqBd1kUQp1Vuj4xzllQBLDzrz0UpMGbkg/JtBmZIn1t6 voFg8eDUKNMTXW2aTq9izXtMPyIhrb0K/aq+oBQM47xwdknuq03My4ROHVPdU/nTl8eK bI9GAx/EoSBVNJKZNSwyfRKw0z39XCqBjzFXt7uaZqN3cm4/FnyzVCM8+ONQNKQ8DLeB TcbsKYPiKxXFKKeo13auz991fbYFzbYLj62UDgtxI0E802SXXn9VBFi5B+Krwdu4yjWd 6TcyFQyscwrYqHhVJCwL0MD04CawTJnglBXxBeddipVd3z8ZMYf7SzaRhbPUdjPZYe1J Ia0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:in-reply-to:date :subject:to:from:references; bh=26CVgkMBQv/mrBK7yXeCfLRErWO98N/UlhD09/swH4g=; b=dUeF8wEz++hV4b7bIGMeHDtKW9wLWF2wwQeuBetdOkcecEVoG51Mir+AHKDknu9wnO mR3uqSdzc6P/0z/nHUUeXVc/f3FlNtcSbUFrx/xg5LFDji1orVVbktd/EgG2huXDdoL+ e9KsI43aVvhXV1zmMiGGdwRHuClniEgqQQErdej2cQt5ldwt0eMpoj7wUIjmnx1BsoTO jRYydiaH8j+3L87nEtOCvmgn4m0pleuXQzxl0EDxpQckcqxJYkeXzYezHtTGa8csIKlu RT01DUbyYNqzfTawxVx2VOhDJn8+4NYi7QgrzbyVK5WUpYDwICQ8XvkDdIBaWT8qLEx9 gRAg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org designates 80.241.56.151 as permitted sender) smtp.mailfrom=albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org Original-Received: from mout-p-101.mailbox.org (mout-p-101.mailbox.org. [80.241.56.151]) by gmr-mx.google.com with ESMTPS id p29-20020a05600c1d9d00b003c9a5e8adc5si49190wms.1.2022.11.03.14.03.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Nov 2022 14:03:44 -0700 (PDT) Received-SPF: pass (google.com: domain of albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org designates 80.241.56.151 as permitted sender) client-ip=80.241.56.151; Original-Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:b231:465::102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4N3GSs4mKFz9snq for ; Thu, 3 Nov 2022 22:03:41 +0100 (CET) In-reply-to: X-Rspamd-Queue-Id: 4N3GSs4mKFz9snq X-Original-Sender: albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org designates 80.241.56.151 as permitted sender) smtp.mailfrom=albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org 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:31685 Archived-At: You could try with `pandoc.write`. Probably something along the lines of ``` lua local md =3D pandoc.write(pandoc.Pandoc(div.contents), 'markdown') return md:gsub('\n', ' \n') ``` (untested) Aidan Reilly writes: > Something like=C2=A0this copied from https://jmablog.com/post/ > pandoc-filters/? My problem is understanding how to add the required > indent to every line in the `elem` - If I stringify, I lose the > markup (backticks, etc) in the content. > > function Div (elem) > if FORMAT:match 'latex' then > if elem.classes[1] =3D=3D "notes" then > return { > pandoc.RawBlock('latex', '\\begin{tcolorbox}[colframe=3DApricot!2= 0!white, colback=3DApricot!8!white]'), > elem, > pandoc.RawBlock('latex', '\\end{tcolorbox}') > } > else > return elem > end > end > end > > > On Thu, Nov 3, 2022 at 8:40 PM Aidan Reilly > wrote: > > Hi John, sorry - yes I am targeting markdown. Ok I=E2=80=99ll try tha= t > thanks.=C2=A0 > =20 > Aidan=C2=A0 > =20 > On Thu 3 Nov 2022 at 20:09, John MacFarlane < > fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > =20 > I assume you=E2=80=99re targeting markdown? > =20 > You could then just create a RawBlock with format =E2=80=9Cmarkdo= wn=E2=80=9D, > and put this content in it with whatever indentation you > like. > =20 > =20 > > On Nov 3, 2022, at 9:14 AM, Aidan Reilly < > aireilly-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote: > > > > Hello! > > > > Trying to figure out how to use pandoc +fenced_div with a > filter to transform this: > > > > ::: note > > Here is the first line of this note. > > > > And the second, > > > > And the third! > > ::: > > > > into this: > > > > !!! note > >=C2=A0 =C2=A0 =C2=A0Here is the first line of this note. > > > >=C2=A0 =C2=A0 =C2=A0And the second, > > > >=C2=A0 =C2=A0 =C2=A0And the third! > > > > Struggling to understand if it is possible to "indent" > elements using pandoc. The mkdocs markdown spec requires the > body of notes to be indented by 4 spaces.=C2=A0 Is there a way to > apply indents without stringifying the content? > > > > Thanks! > >=C2=A0 > > > > -- > > 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=20 > 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/ > ddc82450-b82b-4b8f-9d5f-30c6a28c206fn%40googlegroups.com. > =20 > -- > You received this message because you are subscribed to a > topic in the Google Groups "pandoc-discuss" group. > To unsubscribe from this topic, visit https:// > groups.google.com/d/topic/pandoc-discuss/65G0Kuih1wA/ > unsubscribe. > To unsubscribe from this group and all its topics, 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/ > 7AF275BD-12EB-4424-84E5-1A45FF675520%40gmail.com. > =20 > =20 > -- > =20 > Aidan Reilly > =20 > He/Him/His > =20 > Senior Technical Writer, Telco (Cork, Ireland) > =20 > aireilly-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org > =20 > IM/GitHub:=C2=A0aireilly > =20 > TEL: +353851261126 > =20 > [logo] =20 > =20 > > > -- > Aidan --=20 Albert Krewinkel GPG: 8eed e3e2 e8c5 6f18 81fe e836 388d c0b2 1f63 1124 --=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/87h6zf698z.fsf%40zeitkraut.de.