From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/30791 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: BPJ Newsgroups: gmane.text.pandoc Subject: Tip: comments in Markdown Date: Wed, 22 Jun 2022 15:53:06 +0200 Message-ID: Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000a8439a05e209a876" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2268"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCWMVYEK54FRBTN5ZSKQMGQE744QCIQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Wed Jun 22 15:53:22 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-lf1-f63.google.com ([209.85.167.63]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1o40nJ-0000Pk-NP for gtp-pandoc-discuss@m.gmane-mx.org; Wed, 22 Jun 2022 15:53:21 +0200 Original-Received: by mail-lf1-f63.google.com with SMTP id bi38-20020a0565120ea600b0047f640eaee0sf5206040lfb.4 for ; Wed, 22 Jun 2022 06:53:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1655906001; cv=pass; d=google.com; s=arc-20160816; b=joMKYlIYybGnBBNGqUouSixlh4wTJ4MYaTXUiFgJSGRBAEyDsBO3B6OF5Vp6K5/toh zj4g55nYp8AsKQZKg87pLTiYTs7BogSqMSjSMMMXYFtceHEfdsnaPdhEYpooBo1+lzFV +NAnst+ENvu4mKE9d0RIwifSME6Pz7+cBevL2C2s5C777O2RPeh5kCut7Th07hNCVEn3 69GG4peq300+q0liMIDwRr1WAnrlKvf9gpzkLiSCEvgczz8yAAgDVxi8V3curZdl7ZXW /Q9AFsEkRWS9UlanDqinBTDHN/hK2La8P2n/idWP2lULJuYR0yuL/ozLhNtbkwiKfWNz dOqA== 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:mime-version:sender:dkim-signature:dkim-signature; bh=1GggtxXkIXogkhAWfUP+3WGhLk6qsaUhbH4uop0i+y4=; b=xkRP7ozUL2C74CplWmhd92oxOrpgWZu7oT6UiQQNxy69lxfZXVME7BYhVVgbBvjC1t 1hkk2O+Voi15MrRqUVpI4isYISv+PIk2roXt2R3vgU4XvElVPeejKlz97Ci5sNwUSWxk F/u60OYNHQvdF+4l6TgqjmNxCYzvXy1qV1X/c4jJ4IoWcYQNZpN1l+MEYeRqgoCUXo/W Lus6hAIFMP10aoKu7AH0DI8Y/N0SLdnzL0SFOZrfCV8uBL/Yd4LLDaSd28qnb/91ehMK jfTHZDhU8k0f99jptOQpjQXwiKu+UbyW4hARAXWuoc2Mbe+0CuEBdV5AsTAb9/Alhc7p EX1Q== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=MRi5ZZOW; spf=pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::531 as permitted sender) smtp.mailfrom=melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=sender:mime-version:from:date:message-id:subject:to :x-original-sender:x-original-authentication-results:reply-to :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=1GggtxXkIXogkhAWfUP+3WGhLk6qsaUhbH4uop0i+y4=; b=ceJcHbelCsjqtfa4Mj3dvXk26mgM/yAhTE3iBm/TmBg1/70zO8nUFShhY1RvBfDfn3 0DYRVOsxPyzkSPBlWOcgHK8Di3iAjtyC15yPZX0q0SMidMBC1ja0Ope9LbVFEgbSW16S qE0C9Af2PC1A5RrL3HpSjweuXbBAQ9MUg/owM8CJ6jCZ5IVB/D1Lo1VhVJC/rXU63MUP HiuDoMKjSX3r75bfCywZaXsjItXnJ14vEOI3vczzN+4FjJN8bd9JMQg0+bYlhEfAgXkb O8HBgI3acbUB5ROhM0x+C1esp2AqBGeyIhZM9WHh9wDdMw5MY5ZZwWK3BDbQFvth5KOG tsog== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:list-subscribe :list-unsubscribe; bh=1GggtxXkIXogkhAWfUP+3WGhLk6qsaUhbH4uop0i+y4=; b=CNfeHq3KqeqLz5tfaMnvA0oDePHuVQ6pVz3YsWDL/Lel/FQX5BUNF0GaJy/YC63zxL I7gE1SAWvOWiQfik1gHkNnxJdIH++HwpGl6mHk0vxUR9NoBAUBY2NKYnHjp1m613leyf /RdcVFStxbx8R+UWfbSEIiUvl8k4ZqMtNXfzS2M7kFSt97a7UpV6+aNsH/khB8UKY3i4 1Ml4OB7owZsmtMq4qkktNaTOoC0abCL6Yn0zTbACLv9NNErhe2Iyvl/XWIiYMHGxfuZ/ 7/rL9HQw2/kylhRSU7m8O5y58Q9KQBITkZvnBE+jFv3dZZY2hmoUltX7iOyDwzSR9x1t fLZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=sender:x-gm-message-state:mime-version:from:date:message-id:subject :to:x-original-sender:x-original-authentication-results:reply-to :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=1GggtxXkIXogkhAWfUP+3WGhLk6qsaUhbH4uop0i+y4=; b=Np9ESH/1bnqDtw+BzQbrQl+hvsJ7NMzdkAs7wU5YErgcCnZ3+NlnUmCJxDWNu4xKhb A3JaKJ6tS2ZiW7lg/vh1NhoJRvR5DzvrjnIbUznRQDZ12oF4TNNm6Bz2L8Tg/A+0AVjz bmmKe5p2k+f/dTMgnw3TyZjvqXVG+OJe4aH43yIbAKv3VwcFzOrNrLsnQ38mqccDzyz1 pkjpq3m+/V4KJOQTFXYjoPmIETRrTQI3tFCqMY3UOn6xBQoJo9Q/3DyepzMojOBXuFdx KTCbrmOtOe9ai0V0QZGiPUqIQGb06rs//TZEapAaS7czC5TVndPAJF5Dutpq0St6EDpC upRA== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AJIora9aselo3PByM7oYX3YdsPnDrETVXRbEgRS7aAEVEvUkbCg4DViI dnV6Wo2PPZNlS2fjDFGbO6A= X-Google-Smtp-Source: AGRyM1sMoI0G9+ZXENPJFZdeUFiSa7hg6hlVK3EwMw1d5JmC93DlqnvwrfChYYpQKDQJ2WG94LWL6A== X-Received: by 2002:a19:4f16:0:b0:47f:915d:b14f with SMTP id d22-20020a194f16000000b0047f915db14fmr2235543lfb.661.1655906001153; Wed, 22 Jun 2022 06:53:21 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6512:3f16:b0:449:f5bf:6f6a with SMTP id y22-20020a0565123f1600b00449f5bf6f6als72109lfa.2.gmail; Wed, 22 Jun 2022 06:53:16 -0700 (PDT) X-Received: by 2002:a05:6512:39d2:b0:479:47ad:4e9a with SMTP id k18-20020a05651239d200b0047947ad4e9amr2178792lfu.379.1655905996336; Wed, 22 Jun 2022 06:53:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655905996; cv=none; d=google.com; s=arc-20160816; b=S81ygJXpV5sKLYMyGTqzvF8TdXl0S+kYPf9JqeMMeaaTN5RKkbCF3/DC/x62hkoTwR 1KQ9uWhvKHneFEWsUjFkyJu0DO1vtp4zCePhBdEBt7aYNR9oqDwkKw8hNzT1Vj6Awbsy mOgbkosSXmQj2qEuYn10z3buU8GBC9Z4Bk2cZ5EHI9EJNc8i1jFaC5yW8VW3ti0xl+3W EZOHyUg8g71XJKGXpR8GYUeLmecowmq5fVwVFVjyNrW/7f73uUGtaDWS0JuDxKi2BLke LY3xuKKcsmy8CK3B9daHSwMHnMkx4z4w2yzEscPEZ3pcrEQY8rtFIpTMrisdeP2tzrZP Mz1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:subject:message-id:date:from:mime-version:dkim-signature; bh=eRQXt+9AYv8lMh/gj3G+Rd2pGCuhzI7l8JD8GPe9Th0=; b=cYM1LGE2PrzVV2ffFR2W4XoT7Eif0dXRkW/MYVU6R8q99QWFQRqFI4amrX8c93CDhk PcCmgzP/NtRNcp+5134HoB+ByAUZufEXcxx4gDbD0eN7969z8hxzsenpEg5qkKz/QC9o 1XbFTRkoSx5p+/D6V1XK01hnmiAEyB+jOSqXp9C5dwIJJBFqxL0PErsxXOyZ7wTAxM9s z9gELpbLXu9o9URqex/ayTF9aM6D3vA34QE+zmO4CgJ58kp2mkhRszFHlJvMnWG//5gz /nA6wpFlBrEWQb6dq2apThtCEigciCvVlWMjLFh1+h3Yr/6C4TEimo+00yJd5PSieAX3 tC1g== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=MRi5ZZOW; spf=pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::531 as permitted sender) smtp.mailfrom=melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Original-Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com. [2a00:1450:4864:20::531]) by gmr-mx.google.com with ESMTPS id t7-20020a056512068700b0047ad98bddbasi735594lfe.0.2022.06.22.06.53.16 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 22 Jun 2022 06:53:16 -0700 (PDT) Received-SPF: pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::531 as permitted sender) client-ip=2a00:1450:4864:20::531; Original-Received: by mail-ed1-x531.google.com with SMTP id fd6so21246237edb.5 for ; Wed, 22 Jun 2022 06:53:16 -0700 (PDT) X-Received: by 2002:a50:fb13:0:b0:435:90d1:19ca with SMTP id d19-20020a50fb13000000b0043590d119camr4355104edq.159.1655905995734; Wed, 22 Jun 2022 06:53:15 -0700 (PDT) X-Original-Sender: melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=MRi5ZZOW; spf=pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::531 as permitted sender) smtp.mailfrom=melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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:30791 Archived-At: --000000000000a8439a05e209a876 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I don't know if I or someone else has mentioned this before, but I just realized that there is (another) simple trick to simulate "markdown comments" as opposed to HTML comments: ``````markdown ```{=3Dcomment} This won't show up in HTML output! ``` `This neither`{=3Dcomment} `````` Theoretically this might break if there ever is an output format called "comment" but I guess that is highly unlikely. It will also probably work with your local language's word(s) for 'comment'; I tried with Swedish "anm=C3=A4rkning" (and the abbreviations "anm=C3=A4rkn" and "anm") and it seems multi-byte chars in the "format name= " is no problem. Also if you don't trust Pandoc to automatically reject raw elements with a bogus format you can use a simple filter: ``````lua local is_comment =3D { 'comment', 'com', 'remark', 'rem', 'kommentar', 'komm', 'anm=C3=A4rkning', 'anm', 'athugasemd', 'aths', } -- Turn the list into a set for i=3D1,#is_comment do is_comment[is_comment[i]] =3D true is_comment[i] =3D nil end local function raw (r) if is_comment[r.format] then return {} else return nil end end return { { RawBlock =3D raw, RawInline =3D raw, } } `````` Notably this filter can be used to remove such "comments" from Markdown output, while otherwise they will remain when reformatting Markdown source with Pandoc, which IMO is an advantage over YAML comments. I hope this is useful for others, /bpj --=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/CADAJKhAYoUGxuA-xFBp699zqrYHTARhTLCmPjZ2%3DBE2T7kO0GA%40mail= .gmail.com. --000000000000a8439a05e209a876 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I don't know if I or someone else h= as mentioned this before, but I just realized that there is (another) simpl= e trick to simulate "markdown comments" as opposed to HTML commen= ts:

``````markdown
=
```{=3Dcomment}
This won't sho= w up in HTML output!
```

=
`This neither`{=3Dcomment}
<= br>
<!-- But this will be in HTML -->
``````

Th= eoretically this might break if there ever is an output format called "= ;comment" but I guess that is highly unlikely.
=
It will also probably work with your local lang= uage's word(s) for 'comment'; I tried with Swedish "anm=C3= =A4rkning" (and the abbreviations "anm=C3=A4rkn" and "a= nm") and it seems multi-byte chars in the "format name" is n= o problem.

Also if you d= on't trust Pandoc to automatically reject raw elements with a bogus for= mat you can use a simple filter:

``````lua
local is_comment =3D {
=C2=A0 'comment',
=C2=A0 '= com',
=C2=A0 'remark',
=C2=A0 'rem',
=C2=A0 'kommentar= 9;,
=C2=A0 'komm',
= =C2=A0 'anm=C3=A4rkning',
=C2=A0 'anm= 9;,
=C2=A0 'athugasemd',
=C2=A0 'aths',
}
= -- Turn the list into a set
for i=3D1,#is_comment do=
=C2=A0 is_comment[is_comment[i]] =3D true
=C2=A0 is_comment[i] =3D nil
end
=

local function raw (r)
<= div dir=3D"auto">=C2=A0 if is_comment[r.format] then
=C2=A0 =C2=A0 return {}
=C2=A0 else
=C2=A0 =C2=A0 return nil
=C2=A0 end
<= div dir=3D"auto">end

ret= urn {
=C2=A0 {=C2=A0
=C2=A0 = =C2=A0 RawBlock =3D raw,=C2=A0
=C2=A0 =C2=A0 RawInli= ne =3D raw,
=C2=A0 }
}
<= div dir=3D"auto">``````

= Notably this filter can be used to remove such "comments" from Ma= rkdown output, while otherwise they will remain when reformatting Markdown = source with Pandoc, which IMO is an advantage over YAML comments.

I hope this is useful for others,=

/bpj

--
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://group= s.google.com/d/msgid/pandoc-discuss/CADAJKhAYoUGxuA-xFBp699zqrYHTARhTLCmPjZ= 2%3DBE2T7kO0GA%40mail.gmail.com.
--000000000000a8439a05e209a876--