From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/30800 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: BPJ Newsgroups: gmane.text.pandoc Subject: Re: Tip: comments in Markdown Date: Wed, 22 Jun 2022 19:48:17 +0200 Message-ID: References: Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000bc476305e20cf1ca" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39293"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCWMVYEK54FRB3FLZWKQMGQEJWMIOAA-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Wed Jun 22 19:48:32 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-wm1-f59.google.com ([209.85.128.59]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1o44St-000A1e-Ki for gtp-pandoc-discuss@m.gmane-mx.org; Wed, 22 Jun 2022 19:48:31 +0200 Original-Received: by mail-wm1-f59.google.com with SMTP id p22-20020a05600c359600b0039c7b23a1c7sf80333wmq.2 for ; Wed, 22 Jun 2022 10:48:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1655920111; cv=pass; d=google.com; s=arc-20160816; b=EjAXdn9a74JdpF1pdQUf3E/lhrvLRU1LN9h/acrdYtTpjLFyvli5UPacd7hKBF9svb SdYiqA17YGONfvH5mukkVwZoWiwywjNOremeXv8SWQY/uvT+iOL3p1HWz+FHklZQmDqD ucIxWJpfXBMimJFRReDCkvacpYf/yJo1aBvsKFfCVVBnYILj8ATUrRKCTBO8WZ2aay5R /wp4lgQh9A7m8aIaPFcov6QY3c9vx0ZcVrGqGoAm91PlQ6uawbRtUpqC6txvxk0UGOd9 Cmp5BuUj6HEv+ye3epePBfspgxRla1WrMYqerMUutt/KpqVMmCnRresisJ/bucKNWBJq qzeg== 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=cYmN6knkSCyNpd8kwVbQ0ujY0uMPg0fmAJAzZ1/6NkY=; b=OSto+4dKqihYD+0CeJu2wA4+9OXX5T5zR8xy7zuOCCmq2TzeAzqWM5gHDgrubN5rNG LL+RcTJzT1v80VsslsOdhsooR+NWcvQcT9J8cvTV+6Ksbbxw+0L+FgyTmFM7d2FbYlEj 3KU7GPcXEeyIJSmkFKrykGlZJWwe1mC2v72AW1suJ+HZzoC/wo/4c5+0rLjOT1FeqpwL H9urVfdW+6z1JYO1xvJ/pBBLQcttvimDCNP8xPteRZXaUt0gSWHW77RSnmvWo74lOesL 4w7rXwRpd14YMNUrZxEUwKNi8UadIAiWAxOSAUpxHva+8Q1/uHTt1x47sfZ5BM6mfmJu rwsw== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 209.85.218.49 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=cYmN6knkSCyNpd8kwVbQ0ujY0uMPg0fmAJAzZ1/6NkY=; b=QqPREypTt5ijphUGujDERXesrUgpwWrUEzjv3dM5Wp0SKLlSHg/1svAsyefNdSMGVT lVf1/i3K0uSXY7/siSdLdMsXBLWiCbzxl3hYd8b5lHmAg7vbvREm+XrABqjQ+b7fux1Z pwGpO9n0V6GUzb5d3dxchCJ1CM2RwPCD4QyzKbguQz5f2E0Km4nEXcUcbcdabjMZm9VL Ab2iSXDxurZNCIq2nqkJp+BqI2uFtex84B5TCewVOUiA+xFDZZ9bgp0BwJMbIk8EomUc czAP7WmtKTVNd44c/9m/qqBMbeRkoBuYuPtqKP2u712qoDEQWK2Wosvv3G/MRFKui6b8 yOmA== 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=cYmN6knkSCyNpd8kwVbQ0ujY0uMPg0fmAJAzZ1/6NkY=; b=Vwjylo74AGyS5qCYs+zJwWgPLtCgcWxwmjrQt8K3gdl53Im8i4f0hhBsnNVPaamDxm xdPJBZZYNnerhR8JnjCVwYbB/2YdBQXtpA6bPTg2m+r9a+O8R96peQudjbGHJdjUO2Mi FsF4o6/7/N08QoanWJhxVYiSZG5tcU0sgaDce367HPwvsdjd9LRdP6FozgHY9Ma4p0Vw EbgmKVfWSsdLWBRXD43FrJrM8ZbDlPFWt9ZxsPQzBy+AYdCcli6PY4L67EO4FEk9dFY3 bTlVTuomoM1ug9nlNm4vmqJiVdLKY3WOmvR86vJga3UOhSn+hMGduNonR4qG+oUah8qm gGCA== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AJIora9yBZUoHdFaTfdSDdS0oPa3PQmThFxoz68hrjzZwVjM8I2x4SOT VJHJNzC3x5XD97Uzl+UG7qA= X-Google-Smtp-Source: AGRyM1t1ZGPwRmgw8s4Zvds4X1xGTVPppOKSXBXuWis1r7V5DJAdlUUJ7dIyA3cTtgq6gCa327uEtA== X-Received: by 2002:a05:6000:706:b0:21b:8299:d156 with SMTP id bs6-20020a056000070600b0021b8299d156mr4454326wrb.237.1655920111135; Wed, 22 Jun 2022 10:48:31 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a5d:5848:0:b0:219:b7ea:18e1 with SMTP id i8-20020a5d5848000000b00219b7ea18e1ls8080149wrf.2.gmail; Wed, 22 Jun 2022 10:48:27 -0700 (PDT) X-Received: by 2002:adf:ff88:0:b0:21b:92b5:8e63 with SMTP id j8-20020adfff88000000b0021b92b58e63mr4336861wrr.233.1655920107190; Wed, 22 Jun 2022 10:48:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655920107; cv=none; d=google.com; s=arc-20160816; b=a/3QzZQehQfvs2voELbO+P7/IIsFTgBz+CTa/a8eMwWPd2tTLGMTj09It0pbW6Y472 T4eLcCz49W2qy7gqCNYABHyPxBu8FrmeuV/p+/WDkgfdhAXo8Pcp+iqtKVouvfNd2NAC IovGzbvYH3CexzLQJwOp/IdfVMz02el7sUa9LYyGYThDfLrsWN8NXcs5lxfXW10rBHpL /jxFuI0VwkaAipQEgLGTt5IkDV2DhSPjBxMxV3uZiEklan1wR4sjzTaBzakRmzXYQz6K PIS8ZIL3E0xWZywq2A/DN0nXy0IugvU/g3LeXN8XIzaUheMSVM2bcpQTMPPyRLJZPtYt CS7A== 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=3EkGRgPxMZENR/phyd2CeEpnw98G4wCsM9LUpfPsyZc=; b=IYK480AeigqAj/FARamwmt7i8yhOj52KRH3ChoqfOXb3p668lVPg8a3LeL8lJBd+Cl 2rpDHkJLesjR4xtm2WSRt47MvSJiomAdzQDc53WR6/g9CoGmimVBAvXqpG2UMpJ45laZ JYI0sxoeDRMLzx0RJQfSLO7N8f/aUQ/eG0hKyRy+z1bVIN+nTYSmt1gf9cReexK1EbDj tQUNkoc5u6DKRHEMVkMmI2J7VqloeHVnmw2avPbyeMX8Y2XH8prpygsNPITXs4C6hWxb pm1NxeI+vvL7SNl6MMHxQPrL/vD6mQqQ/gVRQiN3QhaZxRNbusJsZ3nQN/pXVCRMBeFR +l+g== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 209.85.218.49 as permitted sender) smtp.mailfrom=melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Original-Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com. [209.85.218.49]) by gmr-mx.google.com with ESMTPS id i17-20020a7bc951000000b0039c903985c6si6374wml.2.2022.06.22.10.48.27 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 22 Jun 2022 10:48:27 -0700 (PDT) Received-SPF: pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 209.85.218.49 as permitted sender) client-ip=209.85.218.49; Original-Received: by mail-ej1-f49.google.com with SMTP id sb34so6798808ejc.11 for ; Wed, 22 Jun 2022 10:48:27 -0700 (PDT) X-Received: by 2002:a17:907:7283:b0:722:e541:f157 with SMTP id dt3-20020a170907728300b00722e541f157mr4306514ejc.269.1655920106685; Wed, 22 Jun 2022 10:48:26 -0700 (PDT) In-Reply-To: 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.49 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:30800 Archived-At: --000000000000bc476305e20cf1ca Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable As I said YAML comments aren't preserved when reformatting Markdown source with pandoc, which as far as I am concerned is a defect. Den ons 22 juni 2022 15:58William Lupton skrev: > 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 n= ame" 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 sour= ce >> 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 Group= s >> "pandoc-discuss" group. >> To unsubscribe from this group and stop receiving emails from it, send a= n >> 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-xFBp699= zqrYHTARhTLCmPjZ2%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/CAEe_xxjAwFPZsCP3JMW%2Bq= HpfT2csgnei3pyE3RZT%2BaoUhYVwoQ%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/CADAJKhDDy5y-KFmWcea6BwaL7S9Jk7piw-bf4RbYmBJtVQb2aA%40mail.g= mail.com. --000000000000bc476305e20cf1ca Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
As I said YAML comments aren't preserved when reforma= tting Markdown source with pandoc, which as far as I am concerned is a defe= ct.

Den ons 22 juni 2022 15:58William Lupton <wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org> skrev:
it also works= to use YAML comments, e.g.

% c= at comment.md
---
# this is a comment
---

text

---<= br># this is another comment
---


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


On Wed, 22 Jun 2022 at 14:53, BPJ <melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 simulat= e "markdown comments" as opposed to HTML comments:

``````markdown
```{=3Dcomment}
This won't show up in HTML outp= ut!
```

`This neither`{=3Dcomment}

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

Theoretically 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 multi-byte chars in the "format name" is no problem.
<= div dir=3D"auto">
Also if you don't trust Pa= ndoc to automatically reject raw elements with a bogus format you can use a= simple filter:

``````lu= a
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 'a= ths',
}
-- 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 re= turn {}
=C2=A0 else
=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 fil= ter can be used to remove such "comments" from Markdown output, w= hile otherwise they will remain when reformatting Markdown source with Pand= oc, 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-/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-dis= cuss/CAEe_xxjAwFPZsCP3JMW%2BqHpfT2csgnei3pyE3RZT%2BaoUhYVwoQ%40mail.gmail.c= om.

--
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/CADAJKhDDy5y-KFmWcea6BwaL7S9Jk7piw-bf4RbY= mBJtVQb2aA%40mail.gmail.com.
--000000000000bc476305e20cf1ca--