From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/30803 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Thomas Byskov Dalgaard Newsgroups: gmane.text.pandoc Subject: Re: Tip: comments in Markdown Date: Wed, 22 Jun 2022 21:12:14 +0200 Message-ID: <332666C5-9B8E-42B1-A9D2-2437FCE7B70E@coolfortheblind.dk> References: Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\)) Content-Type: multipart/alternative; boundary="Apple-Mail=_83DB9E77-9E1A-4A73-AD59-66A764BDD8E7" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20139"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCNKFONGRUMBBF6TZWKQMGQEG3GPBLY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Wed Jun 22 21:12:26 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-ua1-f58.google.com ([209.85.222.58]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1o45m6-00054x-PO for gtp-pandoc-discuss@m.gmane-mx.org; Wed, 22 Jun 2022 21:12:26 +0200 Original-Received: by mail-ua1-f58.google.com with SMTP id a12-20020ab00c0c000000b0037911b34262sf8850283uak.6 for ; Wed, 22 Jun 2022 12:12:26 -0700 (PDT) ARC-Seal: i=3; a=rsa-sha256; t=1655925145; cv=pass; d=google.com; s=arc-20160816; b=DTpTU2HCzhVCUBRL3V6TsSBPVNq+3grQkZzTjRZzw/a9kauHPHRfU7mceXRLdrTFvp mMjN9UPN5C0IowjTqr6dznicRfpqgbD/HlI/5oWaqdizkBKRcNTPKFNVOSqEXQmcZH30 8MZep+XypRWB44XxnSnyg3Cr2YSC+ky9a5RuzlVDUIx6mss5vkcRxfCduJBc9cxN/G0b AxI994YmvOMuuj6J/C7DyjXOxad9X92RaC1dRv0crUYZSu9YbG8ti0ymL1ajKr3iGa/i 8rtJTSzjTIaT+CLY6cqFVx6CBx/MjfVu9Ru5SSBR6ZuIh9rta3AGTSbi28mpQAItwSq0 HCOw== ARC-Message-Signature: i=3; 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:message-id:in-reply-to:to :references:date:subject:mime-version:from:sender:dkim-signature; bh=JdRoLyqbGlurg1tvD5m6X6u4LPeir4eJI+7r7nHqHsI=; b=MEUeK72H8zLNpD3uDitdjsagLJ+ZoGC1OQTYns5d/CabhAAVlKynXgPA//WEbxGao1 6zwO8cYgpCb4qhj+oPH3RRfcok+TVDeziWag6V1TfLiVVdhQ0H1nUCLKrtyYFVQvK7o0 qACt2l8tfXcEP/V2OV3bZgROXygplTmoBbJRgKSB252ZUZsmHgcU6W1rxfKCkrozwaSJ 6+n0UkV4I1zIFUYa+7WixyBRAoSoBl5i5X8By6JRWGVJ50wYmVsbOzHH4/Y6kQt1LPXb +5wRDwLTohjl56zPp+LKlP2d7sih4Cnog1u6b5tkHa8GMNbeJRJv8dec8sUxFkECCdU3 4tJQ== ARC-Authentication-Results: i=3; gmr-mx.google.com; dkim=pass header.i=@coolfortheblind.dk header.s=default header.b=hIa0lhDV; arc=pass (i=1); spf=pass (google.com: domain of tbdlist-AHfMSizzl90sTMJHDOTzqX9LOBIZ5rWg@public.gmane.org designates 23.83.212.17 as permitted sender) smtp.mailfrom=tbdlist-AHfMSizzl90sTMJHDOTzqX9LOBIZ5rWg@public.gmane.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=sender:from:mime-version:subject:date:references:to:in-reply-to :message-id: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=JdRoLyqbGlurg1tvD5m6X6u4LPeir4eJI+7r7nHqHsI=; b=Bp1/Wrr7EW8Tn78Lh/y4SQm8rMgJjyLxwJd3wm1IUNRWq3/+eCbmO/RtR4tC5/YVEz zFk8A7VoDFkCO2NkPJn3IGtMySbN6W/UIGseULF9PqxprXekfcD4N08lZCLpZdNlenaH 9InUYICp/3kp4YgbPG4gYOv3VmJwRzh1XpYOWxMvsh33QT4ynnbe+eSYxoxfLoU5v2RF S80rJT54yPfzWN4SAfuyDbo6chvL9iTFcT7ExppBoXwT0mFlTtAEA02m+L+IELFWvwWW iXb9HPPLyGlKdAMUhMGl5H9XD8u1ilM54muwJ/hC0aK0f6sQkIgNQpxl7iSkTAfh7FZC XSSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=sender:x-gm-message-state:from:mime-version:subject:date:references :to:in-reply-to:message-id: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=JdRoLyqbGlurg1tvD5m6X6u4LPeir4eJI+7r7nHqHsI=; b=zKJuH4MYOXz19kMP/zVe4EFiSvgGSuDfUPg5QIqbvnRNG23j2qrhuv2MLce9xdIk0F w+3pvXqxs0vtQLsP2dhByifiCFfl2ihpAFAM2lBsNtQ+8dZxtJBqENakyK930YB9e8zH 5xCmFftwtQ93GRIz+M/xj1I1SzQ7PLl9KHbPoXRhX6JJdNSekA+FPMRJ8O3+LSt68137 kQp/DXUZeoZjYwmYTC2Tnj21en+egdMhIq3BblacyPiqWw4bmxdTOzu+d0PVk5ixRHIc aJkQB7uHa7QmMPPW+X2IiXYXzPJVn3uAGoiEMAFbao7h5fvzrpL5n7mfXpCccgE0pMlJ NHQA== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AJIora+0zDdKHHQ9LZWAOdZUtF8AFL3pJTKS5T6QE+0nSHX+pkV028Ie MAfuYQ9Ha4uBrDCyK2BoorY= X-Google-Smtp-Source: AGRyM1t+mvW4u+VeZM6Jp59+TnAu+TLAGWUeE59k1G+IuAfKLWQrdMMA/fN2S2zFIiU3NU3ytRAMEw== X-Received: by 2002:a1f:ab90:0:b0:36c:5dff:95d3 with SMTP id u138-20020a1fab90000000b0036c5dff95d3mr5478221vke.0.1655925145784; Wed, 22 Jun 2022 12:12:25 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a1f:7886:0:b0:36c:5b61:85a with SMTP id t128-20020a1f7886000000b0036c5b61085als563302vkc.4.gmail; Wed, 22 Jun 2022 12:12:22 -0700 (PDT) X-Received: by 2002:a05:6122:25b:b0:36c:5f1a:d94b with SMTP id t27-20020a056122025b00b0036c5f1ad94bmr5698262vko.31.1655925142726; Wed, 22 Jun 2022 12:12:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1655925142; cv=pass; d=google.com; s=arc-20160816; b=CNzODzV2sq+1n9+lG9+xiRyMgxFCDJwajMhBIifukhjwoQT5gZfxjbvGXlP8hJLuic 4DX7n/M/w/IKblozDHEYc3MgvFmnMVWMsWGbhaO9dnnOnFXuUoaHs6Oi5WlqqtkQ2pkB /2CJko9ahEK3PFSBX1tQgSJ0K98+obERrbIHrLqaPx+VtwIA/OfXrYFNxihhqdlxgO2Z lX3wT4OuWfHfaULTsAFvmt25Rz3I1smJxSrLLh/zqQTAp4AEjPflWcSSkFIAyNMBcs33 51k7PyTQJNwLcrFxHJ+rZVSdtRBIA0F7KfLocsoUuidoiql1VLhSjlPTJpovbQwqAO+h EHDQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:in-reply-to:to:references:date:subject:mime-version:from :dkim-signature; bh=/SRfpQHEGoaPRcjda8Za3NpMEhEtCgdonskSzFw+aDo=; b=rrH8bwpgXLHGYyyewsmMEUapNt9O84eYqYagUPQw40RIpSh1fEX0yiPgC/0kVKrY9+ N5f9tVAGQYETCcmWScDs4kic+BujyCCIMhoimD2i59q8pYUULz02awXDW5pfM2lO7ZIg HrVGkfgtUf4fu2ZSK39gFEgh4/Mas1AH641t9BVFqZKNI688tgmw7rYTOEkfXFhzrToa K+XBwPKrpQNgrLDetT+xHRGu35xzZ30ODKwvs2xm2GKl19qts+8XG63ZP2NU0LUsTQWl 3+XqnX7ziqbnRa8qH/5J8TzUMZvt/k6jqILQm1vSTCBzqNmg4CSJQIhu9m7yLSmcGquI aDPw== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@coolfortheblind.dk header.s=default header.b=hIa0lhDV; arc=pass (i=1); spf=pass (google.com: domain of tbdlist-AHfMSizzl90sTMJHDOTzqX9LOBIZ5rWg@public.gmane.org designates 23.83.212.17 as permitted sender) smtp.mailfrom=tbdlist-AHfMSizzl90sTMJHDOTzqX9LOBIZ5rWg@public.gmane.org Original-Received: from bird.elm.relay.mailchannels.net (bird.elm.relay.mailchannels.net. [23.83.212.17]) by gmr-mx.google.com with ESMTPS id az34-20020a05613003a200b0037f38499931si514510uab.2.2022.06.22.12.12.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Jun 2022 12:12:22 -0700 (PDT) Received-SPF: pass (google.com: domain of tbdlist-AHfMSizzl90sTMJHDOTzqX9LOBIZ5rWg@public.gmane.org designates 23.83.212.17 as permitted sender) client-ip=23.83.212.17; X-Sender-Id: azehosting|x-authuser|tbdlist-AHfMSizzl90sTMJHDOTzqX9LOBIZ5rWg@public.gmane.org Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 187C412289D for ; Wed, 22 Jun 2022 19:12:18 +0000 (UTC) Original-Received: from cp06.azehosting.net (unknown [127.0.0.6]) (Authenticated sender: azehosting) by relay.mailchannels.net (Postfix) with ESMTPA id 153E0122B3A for ; Wed, 22 Jun 2022 19:12:16 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1655925137; a=rsa-sha256; cv=none; b=A6UYVcdyTh+FzPIgPuh6RVe/vqGbjEVhjQ1SDlx4xPD4oUKa6PL6pEurGuLvjWxktQ+Nxv k01BmwlcPmBT/Rb1pIg6WriLUxpJDyPcx2zTpu4ksQFrWBt9THGyI3abT7gwtExB0jAYh9 kbLMEnnVRsrTtpLD24q/ZouQUDmiaZXwz51I7odKgNf3R7ynUXqOBFSN0yIRRedQzSPExU 1urm+dKWiobrGS/slSZUeFbaB+6SgX7zVQspALsNzxisBw1ZibP1W+dt24n/Y2OLvSX5kb ZlmH2kWvr5xtMBARYbOXHJlHoV44ofeZWofko16rVb0LMSsBWlN2cssXL4Mf7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1655925137; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:dkim-signature; bh=/SRfpQHEGoaPRcjda8Za3NpMEhEtCgdonskSzFw+aDo=; b=ZCP1DwDNK6I5u8/e/GKaG0bm96WPORp8mG1behqo1W9p55GTBF23uYh8mayG+y7kZhejMF qPpYwji1dDb6xCkWKGT6uSpURE6XwzlnA1ljDXi/bgJFSQfrQlc8Wf1Sfhfm1Yflqb25VX iubd985/5tvuMRx6JlY5mPysorNaLQA5WE4aRl0ZWvUwehNYENjyIvv15FKJgxqAkQas4y UD+idWiMWz92T2aeBtgVCjEsamb1D7iTqFgmF96axney//uAzg6ST0WQarScMNf4Btr4V4 5ra5Gt9Lb+pjyw00MPFcEbxr91RKEXGnoNRstjRD9Cv1uxLxQDwEEvlBADbAEQ== ARC-Authentication-Results: i=1; rspamd-786f5898df-f6p5f; auth=pass smtp.auth=azehosting smtp.mailfrom=tbdlist-AHfMSizzl90sTMJHDOTzqX9LOBIZ5rWg@public.gmane.org X-Sender-Id: azehosting|x-authuser|tbdlist-AHfMSizzl90sTMJHDOTzqX9LOBIZ5rWg@public.gmane.org X-MC-Relay: Neutral X-MailChannels-SenderId: azehosting|x-authuser|tbdlist-AHfMSizzl90sTMJHDOTzqX9LOBIZ5rWg@public.gmane.org X-MailChannels-Auth-Id: azehosting X-Unite-Keen: 603ab9877166df91_1655925137666_3709424939 X-MC-Loop-Signature: 1655925137666:322066368 X-MC-Ingress-Time: 1655925137666 Original-Received: from cp06.azehosting.net (cp06.azehosting.net [157.90.34.121]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384) by 100.105.211.178 (trex/6.7.1); Wed, 22 Jun 2022 19:12:17 +0000 Original-Received: from [176.20.196.202] (port=56379 helo=tbdmacmini-1.home) by cp06.azehosting.net with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1o45lw-009v9Y-Th for pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; Wed, 22 Jun 2022 21:12:14 +0200 In-Reply-To: X-Mailer: Apple Mail (2.3608.120.23.2.7) X-AuthUser: tbdlist-AHfMSizzl90sTMJHDOTzqX9LOBIZ5rWg@public.gmane.org X-Original-Sender: tbdlist-AHfMSizzl90sTMJHDOTzqX9LOBIZ5rWg@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@coolfortheblind.dk header.s=default header.b=hIa0lhDV; arc=pass (i=1); spf=pass (google.com: domain of tbdlist-AHfMSizzl90sTMJHDOTzqX9LOBIZ5rWg@public.gmane.org designates 23.83.212.17 as permitted sender) smtp.mailfrom=tbdlist-AHfMSizzl90sTMJHDOTzqX9LOBIZ5rWg@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:30803 Archived-At: --Apple-Mail=_83DB9E77-9E1A-4A73-AD59-66A764BDD8E7 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" Wow that would be very cool. Would you mind documenting this in the Pandoc = manual? Will test this to see if it can help me in some very odd cases I have had i= n the past. Thanks again bpj. Best regards Thomas=20 > Den 22. jun. 2022 kl. 15.53 skrev BPJ : >=20 > I don't know if I or someone else has mentioned this before, but I just r= ealized that there is (another) simple trick to simulate "markdown comments= " as opposed to HTML comments: >=20 > ``````markdown > ```{=3Dcomment} > This won't show up in HTML output! > ``` >=20 > `This neither`{=3Dcomment} >=20 > > `````` >=20 > Theoretically this might break if there ever is an output format called "= comment" but I guess that is highly unlikely. >=20 > It will also probably work with your local language's word(s) for 'commen= t'; 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. >=20 > Also if you don't trust Pandoc to automatically reject raw elements with = a bogus format you can use a simple filter: >=20 > ``````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 >=20 > local function raw (r) > if is_comment[r.format] then > return {} > else > return nil > end > end >=20 > return { > {=20 > RawBlock =3D raw,=20 > RawInline =3D raw, > } > } > `````` >=20 > Notably this filter can be used to remove such "comments" from Markdown o= utput, while otherwise they will remain when reformatting Markdown source w= ith Pandoc, which IMO is an advantage over YAML comments. >=20 > I hope this is useful for others, >=20 > /bpj >=20 >=20 > --=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= email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org . > To view this discussion on the web visit https://groups.google.com/d/msgi= d/pandoc-discuss/CADAJKhAYoUGxuA-xFBp699zqrYHTARhTLCmPjZ2%3DBE2T7kO0GA%40ma= il.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/332666C5-9B8E-42B1-A9D2-2437FCE7B70E%40coolfortheblind.dk. --Apple-Mail=_83DB9E77-9E1A-4A73-AD59-66A764BDD8E7 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset="UTF-8" Wow that would be very coo= l. Would you mind documenting this in the Pandoc manual?
Will test this to see if it can help me i= n some very odd cases I have had in the past. Thanks again bpj.

Best regards Thomas 

Den 22. jun. 2022 kl. 15.53 skrev BPJ <melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:

I don't know if I or someone else has mentioned this b= efore, 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 -->
``````

Theoretic= ally this might break if there ever is an output format called "comment" bu= t 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 mu= lti-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 yo= u can use a simple filter:

``````lua
local is_comment =3D {
  'comm= ent',
  'com',
  'remark',
  'rem= ',
  'kommentar',
  'komm',
  'an= m=C3=A4rkning',
  'anm',
  'athugasemd',
  'aths',
}
-- Turn the list into a set
= for i=3D1,#is_comment do
  is_commen= t[is_comment[i]] =3D true
  is_comme= nt[i] =3D nil
end

local function= raw (r)
  if is_comment[r.format] t= hen
    return {}
  else
  &= nbsp; return nil
  end
end

<= /div>
return {
  { 
    RawBlock = =3D raw, 
    RawInline = =3D raw,
  }
}
``````

Notably this= filter can be used to remove such "comments" from Markdown output, while o= therwise they will remain when reformatting Markdown source with Pandoc, wh= ich 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 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-xFBp699z= qrYHTARhTLCmPjZ2%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://groups.google.com/= d/msgid/pandoc-discuss/332666C5-9B8E-42B1-A9D2-2437FCE7B70E%40coolforthebli= nd.dk.
--Apple-Mail=_83DB9E77-9E1A-4A73-AD59-66A764BDD8E7--