From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/30808 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: BPJ Newsgroups: gmane.text.pandoc Subject: Re: Tip: comments in Markdown Date: Thu, 23 Jun 2022 12:18:30 +0200 Message-ID: References: <332666C5-9B8E-42B1-A9D2-2437FCE7B70E@coolfortheblind.dk> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000f65ec905e21ac637" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8784"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCWMVYEK54FRBAH42CKQMGQEBFPTZEA-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu Jun 23 12:18:45 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-ed1-f56.google.com ([209.85.208.56]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1o4JvA-00024y-L1 for gtp-pandoc-discuss@m.gmane-mx.org; Thu, 23 Jun 2022 12:18:44 +0200 Original-Received: by mail-ed1-f56.google.com with SMTP id s15-20020a056402520f00b004327f126170sf15466373edd.7 for ; Thu, 23 Jun 2022 03:18:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1655979524; cv=pass; d=google.com; s=arc-20160816; b=eupBFylpbmXAZhpP6NzKx26phxrK4Cvp3gXgGwqtW/s7S0j/kml3GelwPUUhgR3au7 6ffssGW9VM5JRfYdByjr8OeI52WFsbqJ5nxk1kXHAUwUEDe0/vtZ9c4mvma0cCUrx4wC cjtZbx8h2TNczAhA1NdJuhLszwZt2Q24Tbr5Afa7SHr8Nm8QUJBMeG1ZQzliwHky3Q6Y tMdYBSuJe8zZik/bqe2RlFyvHbBZFHenA4qqCeNiZoHynBIVousnlzdCVGmZAZ2U3tnR KY0KFgmuCoIB46c0N77IyMec9TzRxqB/trunocae/06eMigY2BOAvO24wtA0QLq4np6I wn5A== 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:to:subject:message-id:date:from :reply-to:in-reply-to:references:mime-version:sender:dkim-signature; bh=qi9dTkibaLBstEmU/V8Pi/TJCTOKvnyQviLkHWngmNs=; b=z65IcmBc/PtGzRT2FPybPIajya9/Z/Ij6A7mS9s60HlzN3BLeTMEUpHbChnz122O3z ZYcYPU1kmj9VozDCBJdYRPdyZI1MySeWrmizfSE9PcI/r39WeHl1GLMGGarRwBYFyOeN E5IzFyByIMy+9jBH5RGxKTqbp7NytqYoFjTarbxFe7nfwJ0nZmUuiVENZXiVTDHvSiBt pKqez+hduFGu5UxXjAtaGz9SYM3Fs6eOVq8krOdd7QdsltGipwGVfvp/q/TAyml3hh+F sed5ih5W2tZZkSeFo4wa//d6Le9vVDz2tBXiIeldTIjxayo4W7aQ23+O0W+CPUok1oSU zOLw== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 209.85.218.43 as permitted sender) smtp.mailfrom=melroch-Re5JQEeQqe8AvxtiuMwx3w@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:reply-to:from:date :message-id:subject:to:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=qi9dTkibaLBstEmU/V8Pi/TJCTOKvnyQviLkHWngmNs=; b=UjPiXVi/itN5xvnPsySPb1K4Njp7x+S/gUip8pidclf/E2NO4mBJV49JXI70cxPGiE DHkubynSm8aBqX4akIORIZOxlaZEBxFUBGGuW5E61lshWnMYy5QBehnUp1Pgb+7hcj9+ sbtoXZOXA8Xg+/CjmSceh3iEmU0fF+MXqA+gCSNXDLb1BiLL/O0alsWRocoGl65qc4H7 bc0LXurPTGn2HJB7X44Fd5FXwvpQKtukKO3UGt5SLKHG+Zyb4ByjkG6HKPgisVKAw06R JdhQFDWm15rXX5gyqlRVjuODDUBv5dt4FZq5r5lI0PDHYNxdWNvxiik8rQoX1aE4UaKP YT+w== 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 :reply-to:from:date:message-id:subject:to:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=qi9dTkibaLBstEmU/V8Pi/TJCTOKvnyQviLkHWngmNs=; b=Beq8SipdS0yJ8+7+wAem8AGVu7kmmz/xcMQvzKHF/OjPwY68flDRBk31SI1syAj0Lr 2xyWENwYfFwD5jYew/oHluXYslOwOJqdZXbAmc3JysDsC3bcXXGYrV1PS+AAN9H3SZuV ge37DATd+84lTIxcCUZQKFDqOT9gVQ4D/+9b9B6gBJbhv/TA9F85yTfbNvEzlIvGXy0P ZTc90illMeitdg1iOSnDmOT9t4FkDtmX3sOjnG8UXXv7QBi+oiykHqJd6BHiZvSGnpVl Ay4SZq2CfjBQeNl9kYm0jpqYGZbe+bpPh4JSokjbE0VkWJ0iNtS9oouKFvFRa43sHgxW Aq1A== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AJIora+IHhPuw22EcLkRBW+yLJDcJt/kTNWpPOsJVPp4wNB4kXxjsaVh nuUu5Yh+zrnV9Mi83oSC6/Q= X-Google-Smtp-Source: AGRyM1s+FToPe+B/NAXOAyz8wfByq1UTKDgw6gbt19licP1hKThxlIDFWL3O9xZDKUr7ePk7GRSNRA== X-Received: by 2002:a17:906:7a08:b0:712:12f6:243a with SMTP id d8-20020a1709067a0800b0071212f6243amr7452080ejo.619.1655979524170; Thu, 23 Jun 2022 03:18:44 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a17:907:97c4:b0:711:d2c2:9fa4 with SMTP id js4-20020a17090797c400b00711d2c29fa4ls2444442ejc.9.gmail; Thu, 23 Jun 2022 03:18:39 -0700 (PDT) X-Received: by 2002:a17:906:77c9:b0:722:ea38:9979 with SMTP id m9-20020a17090677c900b00722ea389979mr7380748ejn.95.1655979519459; Thu, 23 Jun 2022 03:18:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655979519; cv=none; d=google.com; s=arc-20160816; b=Wk213MnrAWbs40XrSdhahGO8ZUCGdRjzsLEg7kTa55fnXc/cnZ0mq2KCOox77+yWsI GZvvnKD5OK5S2dd3Xb8+lVDZ49dLOUroxxL5Uy2GS5fwa97n1W+XhUO7MaZkpKIDbnPk mcsK9dLsAAkitv4cxbZGgeuDAK9MsKp4JtBwqQimtGmVMqEYcG5Nn0A67aHyA8MwbwYs wjlmZosJ84nB+/yj6hUWpjjd81vG3BdDUX5JanGL2bBV2Al+UgjuU6BPmf3NZN4umKTY PGAaGzUyVVGNg1IgUFcrAwChIV1kGDoNdh5q/cqdm0yCPYzGuf7hrcQ4kTDZlhXb9NoK K9ZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:subject:message-id:date:from:reply-to:in-reply-to:references :mime-version; bh=dXcH6EubU1h5ZhcRIgci22aZbmwmJWVUYge/1VcuEwo=; b=Xv/UD+2OMZ59ZVHjLhRW3ks7WiVhXKZoz77dLDltZvtCu1ixUuQM4wLY9kPYu3EMwM 2xAy6QyJC8wptRbaiWsiM3EiWxZb9+EuEkTQZzBVmq0DbDhHnT2OIPb35fcIbUJ6SOJ/ XHINfLK0cFs3yE6eB0Zh/GeP8tRBO5YKwAlrP/iDtkYuM3WOo240ck/JXzUZYvOQ35fO L8NE3wdNKX0U3imP0WJZOfWE+YR2Q14MaXjc5NaCoUGP7f4JDfuchb121KdiZD2EQdKt YfKJSrcA6v1EXo+g0hDiAFWfi9STNqsRSOZOAdChdSeF0BD/lSBq/MMhOf/WKwEzrIPR LUFA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 209.85.218.43 as permitted sender) smtp.mailfrom=melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Original-Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com. [209.85.218.43]) by gmr-mx.google.com with ESMTPS id h1-20020a1709063b4100b006fefa121de4si624019ejf.1.2022.06.23.03.18.39 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 23 Jun 2022 03:18:39 -0700 (PDT) Received-SPF: pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 209.85.218.43 as permitted sender) client-ip=209.85.218.43; Original-Received: by mail-ej1-f43.google.com with SMTP id pk21so16911993ejb.2 for ; Thu, 23 Jun 2022 03:18:39 -0700 (PDT) X-Received: by 2002:a17:906:7952:b0:711:d4e0:da23 with SMTP id l18-20020a170906795200b00711d4e0da23mr7399278ejo.305.1655979518613; Thu, 23 Jun 2022 03:18:38 -0700 (PDT) In-Reply-To: <332666C5-9B8E-42B1-A9D2-2437FCE7B70E-AHfMSizzl90sTMJHDOTzqX9LOBIZ5rWg@public.gmane.org> X-Original-Sender: melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 209.85.218.43 as permitted sender) smtp.mailfrom=melroch-Re5JQEeQqe8AvxtiuMwx3w@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:30808 Archived-At: --000000000000f65ec905e21ac637 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable It's perhaps not proper to include this in the manual because it is an exploit of a feature for something it wasn't meant for, or if you want to be charitable you can call it an "emergent feature". Maybe there could be a section in the manual describing the various alternatives for *simulating* markdown comments, but it would have to be somewhat carefully worded! I think a better solution would be to document such borderline "features" on the GitHub wiki. However I just checked and there is no link to the wiki in the manual. There probably should be one. Den ons 22 juni 2022 21:13Thomas Byskov Dalgaard skrev: > Wow that would be very cool. Would you mind documenting this in the Pando= c > manual? > > Will test this to see if it can help me in 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 : > > 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 > > . > > > -- > 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/332666C5-9B8E-42B1-A9D2-= 2437FCE7B70E%40coolfortheblind.dk > > . > --=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/CADAJKhDBa8sm2VNKdQpdz_SsBvMYOfofJG-6-hjY6XrSL19nPA%40mail.g= mail.com. --000000000000f65ec905e21ac637 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
It's perhaps not proper to include this in the manual= because it is an exploit of a feature for something it wasn't meant fo= r, or if you want to be charitable you can call it an "emergent featur= e". Maybe there could be a section in the manual describing the variou= s alternatives for *simulating* markdown comments, but it would have to be = somewhat carefully worded!=C2=A0

I think a better solution would be to document such borderline "fea= tures" on the GitHub wiki. However I just checked and there is no link= to the wiki in the manual. There probably should be one.

Den ons 22 j= uni 2022 21:13Thomas Byskov Dalgaard <tbdlist-AHfMSizzl90sTMJHDOTzqX9LOBIZ5rWg@public.gmane.org> skrev:
Wow that would be very cool. Would you mind documenting this in th= e Pandoc manual?

Will test this to see if it can help me= in some very odd cases I have had in the past. Thanks again bpj.

Best regards Thomas=C2=A0

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 before, but I just realized that there i= s (another) simple trick to simulate "markdown comments" as oppos= ed to HTML comments:

```= ```markdown
```{=3Dcomment}
T= his won't show up in HTML output!
```

`This neither`{=3Dcomment}

<!-- But this will be in HTM= L -->
``````

Theoretically this might break if there ever is an output fo= rmat called "comment" but I guess that is highly unlikely.
<= div dir=3D"auto">
It will also probably work wit= h your local language's word(s) for 'comment'; I tried with Swe= dish "anm=C3=A4rkning" (and the abbreviations "anm=C3=A4rkn&= quot; and "anm") and it seems multi-byte chars in the "forma= t 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 {
=C2=A0 'comment',
=C2=A0 'com',
=C2=A0 'remark',
=C2=A0 'rem',
=C2=A0 &= #39;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<= /div>
=C2=A0 =C2=A0 return nil
=C2= =A0 end
end

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

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

I hope this is usef= ul 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-/JYPxA39Uh4Ykp1iOSErHA@public.gmane.org= m.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discus= s/CADAJKhAYoUGxuA-xFBp699zqrYHTARhTLCmPjZ2%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
pandoc-discuss+unsubscribe-/JYPxA39Uh4Ykp1iOSErHA@public.gmane.org= m.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/332666C5-9= B8E-42B1-A9D2-2437FCE7B70E%40coolfortheblind.dk.

--
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/CADAJKhDBa8sm2VNKdQpdz_SsBvMYOfofJG-6-hjY= 6XrSL19nPA%40mail.gmail.com.
--000000000000f65ec905e21ac637--