From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/30792 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: William Lupton Newsgroups: gmane.text.pandoc Subject: Re: Tip: comments in Markdown Date: Wed, 22 Jun 2022 14:57:03 +0100 Message-ID: References: Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000e6523d05e209b619" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24106"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCS4HJ6WSAHBBO57ZSKQMGQE2IK4JPY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Wed Jun 22 15:57:21 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-il1-f188.google.com ([209.85.166.188]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1o40r8-00061L-MM for gtp-pandoc-discuss@m.gmane-mx.org; Wed, 22 Jun 2022 15:57:18 +0200 Original-Received: by mail-il1-f188.google.com with SMTP id p12-20020a056e02144c00b002d196a4d73esf11070259ilo.18 for ; Wed, 22 Jun 2022 06:57:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1655906237; cv=pass; d=google.com; s=arc-20160816; b=hXRyjVwZVZlSz/Yp+gDO6zBhuUm9byyZGYgSauzf9VZaRNMWvBWVmyeo9wV57YFX1c l/XoOcamjBEmlxqAcemTIpQeFg0pABYsrRh4v7ZJNW4oUtr+zqMy7cwvq+QujJv4wekY BqxQzGEid9dTk2ttdYGWrpZFtuMJRqwox2KQP+4aH1Ss/+JOrqk1Bbs5DzmCrrnonMM5 vA9vljwjYcLbnAAUBOa/Zz/c+iCON783TUg6jLcyov5RpWR9B71kIt4j4gK3XFmMjyyS 2Lazp27kwL5r2B6AhayxCyB/uXN8gHIMWrV4V+8NeGDgljhm51K8/uBRVMBVdyYJPbFj wfow== 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=S2rGUntE7FPU5wPvOQL62LlowzrF5xYR9iDyo/IEnj8=; b=cUz0FXPfmAZrHkSFMCp++VPTKZQHYA4x0kpEcJO/52aDUWrhJyU9J35ylAjheLT4ib 3WS+AYN52wZ4rhwE8qepXsVPGjLCHRS9xy/jnesa8jyd2wKn5pQEQwdlsbGtbyTE1+wS lTOZKm4Dc8lIWzHRQvyunzLiqZ87hSV9imSY2Wo8K4CAwalwtiadSv834RPUZs9RnuG2 FRU/tHP6xydfcPxqfU/QJ5SJ5LfugKD64eWET7YYmjyrG+JKpMX5oGZUcWKTBFkl6Jrf nUfAIKKmbQLjD2g1qvuO+UBQjcWMrxqchMnBp5LcLiLHPwToQ3uQ9LyvehqAuZuozUUV BRGA== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@broadband-forum-org.20210112.gappssmtp.com header.s=20210112 header.b=yErI0Kcj; spf=pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2607:f8b0:4864:20::52d as permitted sender) smtp.mailfrom=wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=sender:mime-version:references:in-reply-to: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=S2rGUntE7FPU5wPvOQL62LlowzrF5xYR9iDyo/IEnj8=; b=rm8d7UsQd65NCeuJBny9kZ9GALySc4M25x5cRjrvVNvyksrJqWjSEfjzp7bBF/ZCJM Al1Xx6guVtB/0K+PJYIfr0j+s5J55ZuMMUz/mE54KOuCjfNvwqMmFCsbEa8utGN6yV0X uEP7iOyI0ynS4d74SUEgAbgemCaW01Xh1QWp2s6r6ePLQfAy6c5eWZVufG+1TzD34spJ O1zug64Gg8L7kmw/XqRGvthL9DQV4GF16KjfFh6XKUvKxzDFxHcsWZjVQc9BvDlGrOzw r1y2S7XNrOQkJrmafcISaycIg06k01Za/NbP+70kASrNwgMe6XfPa6J0U8gQ3UI6eXl7 tgQg== 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:references:in-reply-to: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=S2rGUntE7FPU5wPvOQL62LlowzrF5xYR9iDyo/IEnj8=; b=rveuwko+BvBtpaC7C5yAbSvXAHtvfWnzq2TypXgQ43TszN3yHGV0h0kxuPFen97Xqg 194fwtVOtWYjHgCZhupQpnWxNWPOe59HB6y+6fu8M0x3yhobM47u4WIqZb3QviVKbjk+ mo8gafJf0DlCP1QQrZXBp0TECZ/NT4if0bB8e7SodoOPN+bJkK77yAkBUQfOi9vtUnsg dXes5KY6+pxG/tQOTA+LSIoq1UiemOFKwYlI1szTEifRIqvsoWyXhi7IOGyFWWcMwRAw 0VSPhwzA/CsHjP1v0Vh+nfUaEIcTZJHWkDe2/lmun0HSg3RAHB6lFCIiACGkRG4T91Hw 1cMg== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AJIora8izCgooFz3QFecXN7EJzb6c3DQ/3cDDx7zvMqvUszVAZUAFocH LcT8rrFTriSs+FPrDSVF2BA= X-Google-Smtp-Source: AGRyM1t4ffrFLyetqZTeIRZGf15HZyt/8Q5ealTbQIB0CRDKTZvddYlSuf3MwCdp45osi3sK+BZ2mQ== X-Received: by 2002:a05:6e02:1a28:b0:2d8:e770:d43f with SMTP id g8-20020a056e021a2800b002d8e770d43fmr2208056ile.137.1655906237625; Wed, 22 Jun 2022 06:57:17 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a5d:9b16:0:b0:672:77b4:ce13 with SMTP id y22-20020a5d9b16000000b0067277b4ce13ls47129ion.11.gmail; Wed, 22 Jun 2022 06:57:15 -0700 (PDT) X-Received: by 2002:a05:6602:148b:b0:657:c59b:f336 with SMTP id a11-20020a056602148b00b00657c59bf336mr1891543iow.141.1655906235419; Wed, 22 Jun 2022 06:57:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655906235; cv=none; d=google.com; s=arc-20160816; b=ZC7nFX24C2LVV7bUbQWE1axZa7kex4Z2qvtXhPxZ1rYg7QFx3OucqLDwLSnBjE8v2i NIj4SnJoySpOrmkW/kwAkALGgJNuk9T6klegvneCl0anb/0rfvAQ07DCLje/ldbP3klx nwhIMAJW/l5Xq020RkJgzaqHvxQm4Kjfr4GSrRwat+mgac69rV5f2kyP2LzsiquVU0IM 5hrvJ1HSfvuU/woE3VaVakqqO14c1ZJowF8is01ou5Q3xFXhZYj9i0gDAd6sSwWmFilC Gl6kGtIvxQn/m9WqA7GCXQCne8MHdzAaVjWIQ+t4ZMNe2TpSAySN5+pTAutbCIp4MVBz FOKQ== 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=V5gzWFFbo186adSkI59iLw5cYYaExlJkpWjnzq+g7UY=; b=NAc1sMG7F4CbSs7GVHD+nw7SqaiUAKSMBeh8QNz0XpDKgMZSe7m/2AJtE7uEzPdd6T 75WmEmHCV9oob2hXkpcPq/N5L+kruXbOrOnmnu0y3Q9MEZk7jxbtxxCeBJSOlvgXMg5L KzVrwo7t4W/Ded3NkLhGlg5IsxJl0NXpAJPyFCBv5D1qNl1k/XQdtvYah/PZlEQjAvYV QcQhoOMGa3jN3GWGpD6jmeu5V01faZzqfv0FLYFb5cwjeOEZGAbQH7UfCI0/SIKK7Z4s l2xB31ugu8fhWNOsEfa2YXpKhCLk5OF9FHFj9gqzD0cfZfmxu7aRTR4fNnuRxk+nRiFN 7U2g== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@broadband-forum-org.20210112.gappssmtp.com header.s=20210112 header.b=yErI0Kcj; spf=pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2607:f8b0:4864:20::52d as permitted sender) smtp.mailfrom=wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org Original-Received: from mail-pg1-x52d.google.com (mail-pg1-x52d.google.com. [2607:f8b0:4864:20::52d]) by gmr-mx.google.com with ESMTPS id m21-20020a0566022e9500b006495f98f57asi898583iow.1.2022.06.22.06.57.15 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 22 Jun 2022 06:57:15 -0700 (PDT) Received-SPF: pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2607:f8b0:4864:20::52d as permitted sender) client-ip=2607:f8b0:4864:20::52d; Original-Received: by mail-pg1-x52d.google.com with SMTP id a14so6558260pgh.11 for ; Wed, 22 Jun 2022 06:57:15 -0700 (PDT) X-Received: by 2002:a63:8f04:0:b0:40c:a447:a189 with SMTP id n4-20020a638f04000000b0040ca447a189mr3137758pgd.515.1655906234676; Wed, 22 Jun 2022 06:57:14 -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.20210112.gappssmtp.com header.s=20210112 header.b=yErI0Kcj; spf=pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2607:f8b0:4864:20::52d as permitted sender) smtp.mailfrom=wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@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:30792 Archived-At: --000000000000e6523d05e209b619 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable it also works to use YAML comments, e.g. % cat comment.md --- # this is a comment --- text --- # this is another comment --- % pandoc comment.md

text

On Wed, 22 Jun 2022 at 14:53, BPJ wrote: > 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 na= me" 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 sourc= e > 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 > "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/CADAJKhAYoUGxuA-xFBp699z= qrYHTARhTLCmPjZ2%3DBE2T7kO0GA%40mail.gmail.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_xxjAwFPZsCP3JMW%2BqHpfT2csgnei3pyE3RZT%2BaoUhYVwoQ%40ma= il.gmail.com. --000000000000e6523d05e209b619 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
it also works to use YAML comments, e.g.<= div>
% cat comment.md
---
# t= his is a comment
---

text

---
# this is another comment=
---


% pandoc comment.md
<= ;p>text</p>

=
On Wed, 22 Jun 2022 at 14:5= 3, BPJ <melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> w= rote:
I don't know if I or someone else has menti= oned 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}

<!-- But this will be in HTML -->
``````

Theoretica= lly 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=A4rknin= g" (and the abbreviations "anm=C3=A4rkn" and "anm"= ) and it seems multi-byte chars in the "format name" is no proble= m.

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 {
=C2=A0 'comment',
=C2=A0 'com',=
=C2=A0 'remark',
=C2= =A0 'rem',
=C2=A0 'kommentar',
=
=C2=A0 'komm',
=C2=A0 '= ;anm=C3=A4rkning',
=C2=A0 'anm',
=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)
=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
end

return {
=C2=A0 {=C2=A0
=C2=A0 =C2=A0 RawBloc= k =3D raw,=C2=A0
=C2=A0 =C2=A0 RawInline =3D raw,
=C2=A0 }
}
``````

Notably this f= ilter can be used to remove such "comments" from Markdown output,= while otherwise they will remain when reformatting Markdown source with Pa= ndoc, 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 pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CADAJKhAYoUGxuA-x= FBp699zqrYHTARhTLCmPjZ2%3DBE2T7kO0GA%40mail.gmail.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://gro= ups.google.com/d/msgid/pandoc-discuss/CAEe_xxjAwFPZsCP3JMW%2BqHpfT2csgnei3p= yE3RZT%2BaoUhYVwoQ%40mail.gmail.com.
--000000000000e6523d05e209b619--