From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/30802 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 19:47:57 +0100 Message-ID: References: Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000532ba305e20dc77f" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17739"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCS4HJ6WSAHBB26HZWKQMGQEFWX2QXQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Wed Jun 22 20:48:15 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-pl1-f187.google.com ([209.85.214.187]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1o45Oh-0004PE-8E for gtp-pandoc-discuss@m.gmane-mx.org; Wed, 22 Jun 2022 20:48:15 +0200 Original-Received: by mail-pl1-f187.google.com with SMTP id k11-20020a170902ce0b00b0016a15fe2627sf6706065plg.22 for ; Wed, 22 Jun 2022 11:48:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1655923694; cv=pass; d=google.com; s=arc-20160816; b=UKEp9o71Yl2XfW5dkdngKLs40laF/rO06VM/vRUSZUbTjP0u0Nkq21Ltx4apFmHvku /YDpB7d6NZ4JWJqZOXixCQuZxjMy1GY1XDEJOqtDh65j08yXYBYBCm3R8oRN786oVIO3 jaVGdozVUOqegogCJTIeHefQe7Hf3AD7MKGtOivs7Uvmpe0t5zkZ3AQPF8AUv4goK9RU yyyp8FO0HHjIj4Dt9CCsi94kZVXgfvoML/y+v0STkxeKIK+5v56XdPlkKtyclW3w9R4C C8MuUaTENU2GjgXlk6kHkBnPFgNtr5NPArBn9Xh0FKxW+QEFPGmkxv7FFCkTau3UqAyL asvg== 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=VDRASrc7oT6qE8XxiBUkuaO6fbk5WUpQHFYrVuFZJMk=; b=z2oPme8oIcx2ON/8a5dhXtPqQ6kClwwEuhPU90mX1tX1FHllip/YmpvHvksNMywpZT S4nTvnDqdI0Ej/95g/nBAfTliBTcMioSK5NosHGAKU8p4c2FJc5cLyx4nUZi1MXnCdwy Gq+8Z6Gu+OxfIMuAyAYeq92MiYm8w4Z0mYNdzz480/TmW1vh0wzfjAQGh8SDEz3nV3ue JvmIFx9fIDsPk7ejfFJTTKOP99ZDSSBp4hjtxyIJGYLLGc/M2EHZb2TIX4JoBU/wmVmK igZmuWI2ccNCNc+SLQo61+JDTz464BmdjpVGk2hjSh2LtxXwfPzcUZiSERXpqzHE9M/9 t/ZA== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@broadband-forum-org.20210112.gappssmtp.com header.s=20210112 header.b=bE5lNC5C; spf=pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2607:f8b0:4864:20::634 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=VDRASrc7oT6qE8XxiBUkuaO6fbk5WUpQHFYrVuFZJMk=; b=cS5uZVtLp6oYKMD/52ArOzAqEW4XZJUxu8F99+yWzfCeqsno78qkbfXicWo0ww6Xhd XlCz5Rv0qAfnNCQpCBBPTXC9GgQLZdeUd9K41xKwKfixN9XPCVJvw3xHa+iyfvMwaACG NJxb9mViccg5cdp2F2jzMEJUtBpgIM/YUVtULZF2ocQa3RrM0Nn4/Gfllvw3hoLLv82k adVdKVescoAt8xWYvpTD3KaB3qPpuMK67f36asDZPJxjyI53da20e5MAIAW/8iFUlX+V 0CF5L2e+69hxfLf97WQFl/Af1k0XPDlBeUEG+3Ad6IzEXJRHjgtxXXci1bwaBFXnO4bT rlYQ== 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=VDRASrc7oT6qE8XxiBUkuaO6fbk5WUpQHFYrVuFZJMk=; b=4lCehZCoj2IRRBgriPqHBZO6/ag8JXwTg9iXg+B1P4RkRe7M8idsKfG8aKz+NEGe+V itT3Nj/YVbcU6Qq+Pbrel7cbW382yfLa3+YJmh/KhHCbYrQ394b+BmsfI+WrDN6YyJHL cjdgd78Li7d6nUKGq5UHnt/0FgWRj8G7R/Z29++L6WM6NLwGyQfdXFr33n0tddVO/+o4 MyfYs91M5DzcE75iIazqUpMq/m6FlAA+6q3ogFNmno9h277DTwu2fdpd6dkt37zSdB0b AbOncRChPvnhjgk6BJhIxgUqWnPlp3AftHUH6ZaVvNaQ6Vub6b5vK4CjERx+cEurX2PU pnAQ== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AJIora86amwExAYk4LgBIW7lDmlKINqktpgHZd3papGhzflTLugMTVPE VRG3xLIkmBDoO05mSCiPOSw= X-Google-Smtp-Source: AGRyM1tlib0E+3nGgEySq3oF3uFtCO492tGmpe+6sTVgJgmbWqnTzdWvYI43k23/Ck0e4+SEnz8Ukw== X-Received: by 2002:a17:903:41c1:b0:16a:55ef:3688 with SMTP id u1-20020a17090341c100b0016a55ef3688mr648123ple.161.1655923693920; Wed, 22 Jun 2022 11:48:13 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a17:90a:2f65:b0:1ec:9383:5539 with SMTP id s92-20020a17090a2f6500b001ec93835539ls7271001pjd.1.gmail; Wed, 22 Jun 2022 11:48:10 -0700 (PDT) X-Received: by 2002:a17:902:8c88:b0:168:fbf5:56e7 with SMTP id t8-20020a1709028c8800b00168fbf556e7mr35099951plo.25.1655923690746; Wed, 22 Jun 2022 11:48:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655923690; cv=none; d=google.com; s=arc-20160816; b=DON8YigckWvvKzpuLlhkdyuh9I4/SA0Kp1iegZGKzR8DaRUtln1O2NAMuwJWl/ecL6 ssGCoY6dfbZberaEb4CHT8SH2OUjkyad2DzfD5fpFdyzX5Am3mhCif9ntuMZirmMDLJZ XCmfNz2SUpqZYgAdK5vqy1QIyNEmwhwEsr133mSdPWESXSXnhSD5iumVCbO+SHYNk2Y3 ENGST6SIRPf8YOAIDmrOtx7pGMA3MLNH2D6omSlt8teft9mMQgI9+TRTffbhCOFEY6B1 OyhT72feA634laKrkmIm75vlQqckIJ7ztsIllj0eMob8S6qeQ+/D0Z7vjMKNlwpXds/V nTEA== 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=C1XtnuZIQs89Usmfo4Lere/vKbQicsXs621zd9NdS4Y=; b=V82jQKgTVg9vBCtF7LR+fh7NvtXDlLcIbMsWWfAksheYiX3jljH4nUYtPRiiwngo71 xc/jO8Tqd/hTGauomlQr/NIT/bKWCo2b7lYnWDroRLq6ChnQzcILm5ILpg4rF5cjTULh 6U83xPg21K8gSymu/txKRAZbrVNBpV+zbZ331+uSGTofS9WX/KIu7k4Uj3kPa2vaED4V 4yRqlj4SNXUel5U9x2Q0lgM8i5oTjpVV/3ORUijZaqRDGVt2/q5H655ViY5lSmbH9r4H /2jG8GCQhUV1iKTLqNH/tLHSo8ZRuE/leQgv06S3shosUXfFSCp1bkjCoeK1ETYmGmGz zB4w== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@broadband-forum-org.20210112.gappssmtp.com header.s=20210112 header.b=bE5lNC5C; spf=pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2607:f8b0:4864:20::634 as permitted sender) smtp.mailfrom=wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org Original-Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com. [2607:f8b0:4864:20::634]) by gmr-mx.google.com with ESMTPS id 6-20020a170902c20600b0016a11b71bfbsi490392pll.8.2022.06.22.11.48.10 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 22 Jun 2022 11:48:10 -0700 (PDT) Received-SPF: pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2607:f8b0:4864:20::634 as permitted sender) client-ip=2607:f8b0:4864:20::634; Original-Received: by mail-pl1-x634.google.com with SMTP id r1so16115643plo.10 for ; Wed, 22 Jun 2022 11:48:10 -0700 (PDT) X-Received: by 2002:a17:90b:4d88:b0:1ec:aa96:ac92 with SMTP id oj8-20020a17090b4d8800b001ecaa96ac92mr18510301pjb.196.1655923690114; Wed, 22 Jun 2022 11:48:10 -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=bE5lNC5C; spf=pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2607:f8b0:4864:20::634 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:30802 Archived-At: --000000000000532ba305e20dc77f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Ah, sorry, I didn't read what you'd written sufficiently carefully. On Wed, 22 Jun 2022, 18:48 BPJ, wrote: > As I said YAML comments aren't preserved when reformatting Markdown sourc= e > 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 abbreviation= s >>> "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 wit= h >>> 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 sou= rce >>> 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-xFBp69= 9zqrYHTARhTLCmPjZ2%3DBE2T7kO0GA%40mail.gmail.com >>> >>> . >>> >> -- >> 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/CAEe_xxjAwFPZsCP3JMW%2B= qHpfT2csgnei3pyE3RZT%2BaoUhYVwoQ%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/CADAJKhDDy5y-KFmWcea6Bwa= L7S9Jk7piw-bf4RbYmBJtVQb2aA%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_xxhzPYAc%3D6mrM7sukroZ%3DR7RoiHMfwkDwxpsVHUci3OANA%40ma= il.gmail.com. --000000000000532ba305e20dc77f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Ah, sorry, I didn't read what you'd written suffi= ciently carefully.

On Wed, 22 Jun 2022, 18:48 BPJ, <bpj-J3H7GcXPSITLoDKTGw+V6w@public.gmane.org> wrote:
As I said YAML comments aren't preserved when= reformatting Markdown source with pandoc, which as far as I am concerned i= s a defect.

Den ons 22 juni 2022 15:58William Lupton <wlupton@br= oadband-forum.org> skrev:
it also works to use YAML comments, e.g.
% cat comment.md
---
# thi= s is a comment
---

text

---
# 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 d= on't know if I or someone else has mentioned this before, but I just re= alized that there is (another) simple trick to simulate "markdown comm= ents" as opposed to HTML comments:

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

`This neither`{= =3Dcomment}

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

Theoretically this might break if there e= ver is an output format called "comment" but I guess that is high= ly unlikely.

It will als= o 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>
Also if you don't trust Pandoc to automatically = reject raw elements with a bogus format you can use a simple filter:
<= div dir=3D"auto">
``````lua
local is_comment =3D {
=C2=A0 'comment',<= /div>
=C2=A0 'com',
=C2=A0 = 'remark',
=C2=A0 'rem',
=C2=A0 'kommentar',
=C2=A0 'k= omm',
=C2=A0 'anm=C3=A4rkning',
=C2=A0 'anm',
=C2=A0 'ath= ugasemd',
=C2=A0 'aths',
}
-- Turn the list into a set
for i=3D1,#is_comment do
=C2=A0 is_commen= t[is_comment[i]] =3D true
=C2=A0 is_comment[i] =3D n= il
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 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 reformatting Markdown source with Pandoc, which IMO is an advan= tage 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@goo= glegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pa= ndoc-discuss/CADAJKhAYoUGxuA-xFBp699zqrYHTARhTLCmPjZ2%3DBE2T7kO0GA%40mail.g= mail.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@goo= glegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/= pandoc-discuss/CAEe_xxjAwFPZsCP3JMW%2BqHpfT2csgnei3pyE3RZT%2BaoUhYVwoQ%40ma= il.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/= CADAJKhDDy5y-KFmWcea6BwaL7S9Jk7piw-bf4RbYmBJtVQb2aA%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_xxhzPYAc%3D6mrM7sukroZ%3DR7RoiHM= fwkDwxpsVHUci3OANA%40mail.gmail.com.
--000000000000532ba305e20dc77f--