From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/31694 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Aidan Reilly Newsgroups: gmane.text.pandoc Subject: Re: Transform a fenced div to mkdocs markdown admonition format Date: Sat, 5 Nov 2022 16:26:32 +0000 Message-ID: References: <7AF275BD-12EB-4424-84E5-1A45FF675520@gmail.com> <87h6zf698z.fsf@zeitkraut.de> <87a6556cg2.fsf@zeitkraut.de> <875yft5wqc.fsf@zeitkraut.de> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000e1436905ecbba752" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22689"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBDO2LZEJ4EIRBR45TKNQMGQEQDM3HJQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sat Nov 05 17:26:52 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-pj1-f59.google.com ([209.85.216.59]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1orM0S-0005gZ-6F for gtp-pandoc-discuss@m.gmane-mx.org; Sat, 05 Nov 2022 17:26:52 +0100 Original-Received: by mail-pj1-f59.google.com with SMTP id ch8-20020a17090af40800b002140ba517b6sf3311330pjb.4 for ; Sat, 05 Nov 2022 09:26:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1667665611; cv=pass; d=google.com; s=arc-20160816; b=Pu6axnenFLg4lN4srOTi1WAAfjP6vK1T1j2wwK7+O0eNtp1++uhfucqj5nPrKAj6jE 7xWmbJLLTQaRFfv0/tdw6FWXBBc7U7wWSfwQlurbz9GFqNKRmIFYGUtEN/ganANlfle4 Dz3ObSF0GaQQsGE/DJwtEIi13ao2/lbfiLMnsH8BGuIP0B2zbceJYopr5KisToFU18td zQ04Uw1fMgqR0vBG/oXa5CCcoRplMa7P6pQhnh0TFXoYwjqs1h53P1xVwc3ryN74VIDf zhhgwlPe0n9UCfkq3PgLntMlY6sYppwFrppmsdlgZRh98EBDkH5OkqsOtG8IH2s46BW0 8Ryg== 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:sender:dkim-signature; bh=3ogrd7Dm0fB3/BEA5vOGRwd/jh4HBx0L0Vl9+uaaAO8=; b=QCn1aEur2na08w5+hrmLKY5FPRjahmN2dG66rkHIKx4ecjeJkcLd1ifM03vUqfRolL fCw64AybO/JePfxLC4z9RsJSSVovjx7W0jd6ZTzc4Vd1OSq+vu/CLAfhRKXfUCpPoJvL HIu7ne809qPNFNIiTi24oU5O5gVB0IMOXSpk8K5FWD0Ypm6NK59lPVECk2RmZzTSrncq Cgq9dsVvcDUhLXBVqMxX31uZiuyOp/ko/XJ4Kwr04zaq8F7eOcH1hJyGY5ixnaucrlar 6295dM7fsaXvK4zNvJmuEgW+jmjrPAJkisFrpLKGC58KTmB+4FQY3PWI7Cw1khA9Sl5r 7aFQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bOfUDcoo; spf=pass (google.com: domain of aireilly-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org designates 170.10.133.124 as permitted sender) smtp.mailfrom=aireilly-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com 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:to:subject :message-id:date:from:in-reply-to:references:mime-version:sender :from:to:cc:subject:date:message-id:reply-to; bh=3ogrd7Dm0fB3/BEA5vOGRwd/jh4HBx0L0Vl9+uaaAO8=; b=l8NDoInspPet0GPvenl6CmDLp9hwIrUc2rkCqhs8EK9+aXRz1XAQ7tDsTCsiXCyts6 4+3LyQXPRQ9sU/Oiv768uRwx7qlG7OddFMufpKFbyi9Xcl+u48eMdIgqH/73J8RMzMCk jpyd5rg5rA2xP79xhwcbShOdLtZ5ROmeLajlrblhP+RdZ/oIp1QgzBlgWN7ZI0ECf6cs hsG8sw0tMhCyz40F/hAYmkW/g6L2oUDTOxIPQkFnmrQGc68xZuOZ3D1d9vrSTvDsRMSR JFMMepWGHIrZLwGTz4HTZzBrDxKs1rcXN6WofvfR3Ui2LWp6h+EERa6Z+tox55gQBHWm PrBA== 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:to:subject :message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:sender:from:to:cc:subject:date:message-id :reply-to; bh=3ogrd7Dm0fB3/BEA5vOGRwd/jh4HBx0L0Vl9+uaaAO8=; b=0wZF7XXm+Vs6vXv4CteVP9h3J1HNIoa0is1IZPu264wOt2CRlx0WdLALfbrNfGwmyi 1ViPjyHVbOR15IAKrWxHxO20xIsOei+zw6U44WFRWcXqHtElreoCDsD2Cx/WM4LHHl8A i/mzeWUKb5W4oTi0UzBpCfzqhti7bhlBaUWxGXUR6MkA2cH7EtG3nQaVDOD4yNd2P6IV EEHStFwYbu8IOwiczp83VzesfY5kzRKefn54FYeTgCT0TsBldHPZhGLLUNJqQ1/NSOK4 x4UyDSjqNWQccrdy9avRXzKwX0W+UQJwo6ekkS4syBpo0x Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: ACrzQf15z4PEUk2k+fgU/AtiAIR4oDI21EG5cbpUHQ0vRly2rR4uHI4p T5o0/fTrc9ssvl9ae2eEdEM= X-Google-Smtp-Source: AMsMyM5JyDvRkjcLTUvm11OxGJPYN9MTgfIl0oksQh/zDK6VRa5fcd++qPfOHuzuqbr8irMSPdcNzA== X-Received: by 2002:a17:902:d486:b0:186:cf83:4ba8 with SMTP id c6-20020a170902d48600b00186cf834ba8mr41538625plg.154.1667665610814; Sat, 05 Nov 2022 09:26:50 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a62:8246:0:b0:56b:696a:9a6a with SMTP id w67-20020a628246000000b0056b696a9a6als3532958pfd.6.-pod-prod-gmail; Sat, 05 Nov 2022 09:26:46 -0700 (PDT) X-Received: by 2002:a05:6a00:22d6:b0:56d:39a2:14ae with SMTP id f22-20020a056a0022d600b0056d39a214aemr36533251pfj.80.1667665606736; Sat, 05 Nov 2022 09:26:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667665606; cv=none; d=google.com; s=arc-20160816; b=l5R5UwaEF5Fm81O9+U4FGSb7Qu2PTjA5MlDd+lf0wPBTmlkbKayIk+xv6beX02xBUv NxHmQvEI4Fzr8p7Ye6qqrEwP8ucezkybWP6Z8cKzuAvCRveHGd13Qgg5rbI7uMiDw/Ik d8X9UlZ6XoQG2DGwoecloX8J8p9paW2z0cUTLcxAO++cvNvjamo0XMKbqLXIQazjDBbT codyJC8f99AHKrOaJw1zR48wnRFNJCgigmpTM0t7umvkU1jxVMR9buNoS4B1Adm1+byb ao+14xMaknMTthxz3zrXJ5KuNnv4XI6MXix2OgTDo0Fkqz4lqcHlmzn/VQ0iaFP58yb8 q0ig== 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=CzUOldik4NVPBro9+VCxvVjnnQpnncvDbiLQFJ7oKec=; b=ZIkhJVOuAf1frXmduLWy1qvGMGsTY7YVeC82wmXbzYKazoeTubJY09jFDgH5sNAMwH jTeJ8nRwMClCrhNsuuHe0XXm9g3eJjTxFaPBd7uvqMuBOILLGAxDVP/wxaY1W2QWI/3P /mIEMT3Fi+N2i4r8O5a/UGap5/dIRqzVr5xNekJX1CI+GLURsupYpC8An5eETWe8kcDW 1F6xE3QV1oOL+rdeSREuc3yeT48rr3nkA3J36z+llj70Xk9IfKXAKYqhDvLbuQ+4lQX6 qOtKe+Qqet0Uln+NqdCJb4WN4mEgLDcwyo/BC7rzWgxIdNw2Sv4u4rDOWfGDI8ymyYfX 63Uw== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bOfUDcoo; spf=pass (google.com: domain of aireilly-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org designates 170.10.133.124 as permitted sender) smtp.mailfrom=aireilly-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Original-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com. [170.10.133.124]) by gmr-mx.google.com with ESMTPS id f18-20020aa79d92000000b0056611e6228dsi82862pfq.1.2022.11.05.09.26.46 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 05 Nov 2022 09:26:46 -0700 (PDT) Received-SPF: pass (google.com: domain of aireilly-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; Original-Received: from mail-ua1-f71.google.com (mail-ua1-f71.google.com [209.85.222.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-462-rdkQOggvNACsPh21xuuRaQ-1; Sat, 05 Nov 2022 12:26:44 -0400 X-MC-Unique: rdkQOggvNACsPh21xuuRaQ-1 Original-Received: by mail-ua1-f71.google.com with SMTP id h11-20020ab0470b000000b003bf1da44886so3475227uac.17 for ; Sat, 05 Nov 2022 09:26:44 -0700 (PDT) X-Received: by 2002:a1f:c7c3:0:b0:3b4:318d:42d3 with SMTP id x186-20020a1fc7c3000000b003b4318d42d3mr22798675vkf.7.1667665603528; Sat, 05 Nov 2022 09:26:43 -0700 (PDT) X-Received: by 2002:a1f:c7c3:0:b0:3b4:318d:42d3 with SMTP id x186-20020a1fc7c3000000b003b4318d42d3mr22798666vkf.7.1667665603142; Sat, 05 Nov 2022 09:26:43 -0700 (PDT) In-Reply-To: <875yft5wqc.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Original-Sender: aireilly-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bOfUDcoo; spf=pass (google.com: domain of aireilly-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org designates 170.10.133.124 as permitted sender) smtp.mailfrom=aireilly-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.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:31694 Archived-At: --000000000000e1436905ecbba752 Content-Type: text/plain; charset="UTF-8" That did it Albert - thank you! I need to spend a bit more time brushing up on Lua I think. Aidan On Sat, Nov 5, 2022 at 1:58 PM Albert Krewinkel wrote: > > Aidan Reilly writes: > > > Thanks Albert! > > > > I really appreciate you looking at this. When I run the above, I get > > this error: > > > > Error running filter admonitions.lua: > > admonitions.lua:10: attempt to index a nil value (local 'opts') > > stack traceback: > > admonitions.lua:10: in main chunk > > The most likely cause for this is an older pandoc version. The > `PANDOC_WRITER_OPTIONS` global was introduced in pandoc 2.17. > > The filter can be made more robust by replacing line 9 with > > ```lua > local opts = PANDOC_WRITER_OPTIONS or {columns = 72} > ``` > > That will ensure that the filter works even with older pandoc versions > (but with reduced functionality in that case). > > > > -- > Albert Krewinkel > GPG: 8eed e3e2 e8c5 6f18 81fe e836 388d c0b2 1f63 1124 > > -- > 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/875yft5wqc.fsf%40zeitkraut.de > . > > -- Aidan -- 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/CAM4RMshpnCHthCjffGJMiXuxbRKwWR%2B%2BzxpqW62TUWN64395bQ%40mail.gmail.com. --000000000000e1436905ecbba752 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
That did it Albert - thank you! I need to spend a bit more= time brushing up on Lua I think.=C2=A0

Aidan

On Sa= t, Nov 5, 2022 at 1:58 PM Albert Krewinkel <albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org> wrote:

Aidan Reilly <a= ireilly-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> writes:

> Thanks Albert!
>
> I really appreciate you looking at this. When I run the above, I get > this error:=C2=A0
>
> Error running filter admonitions.lua:
> admonitions.lua:10: attempt to index a nil value (local 'opts'= )
> stack traceback:
> admonitions.lua:10: in main chunk

The most likely cause for this is an older pandoc version. The
`PANDOC_WRITER_OPTIONS` global was introduced in pandoc 2.17.

The filter can be made more robust by replacing line 9 with

```lua
local opts =3D PANDOC_WRITER_OPTIONS or {columns =3D 72}
```

That will ensure that the filter works even with older pandoc versions
(but with reduced functionality in that case).



--
Albert Krewinkel
GPG: 8eed e3e2 e8c5 6f18 81fe=C2=A0 e836 388d c0b2 1f63 1124

--
You received this message because you are subscribed to a topic in the Goog= le Groups "pandoc-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pandoc-discuss/65G0Kuih1wA/un= subscribe.
To unsubscribe from this group and all its topics, 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/875yft5= wqc.fsf%40zeitkraut.de.



--
Aidan

--
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://gro= ups.google.com/d/msgid/pandoc-discuss/CAM4RMshpnCHthCjffGJMiXuxbRKwWR%2B%2B= zxpqW62TUWN64395bQ%40mail.gmail.com.
--000000000000e1436905ecbba752--