From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/32024 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: BPJ Newsgroups: gmane.text.pandoc Subject: Re: Adding a reader for Cooklang and a question about Megaparsec Date: Thu, 19 Jan 2023 11:19:44 +0100 Message-ID: References: <08647ee9-9616-482c-bae8-2657d16df33fn@googlegroups.com> <87lelzmn0l.fsf@zeitkraut.de> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000023fb2605f29b46e2" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1739"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Isaac Van Doren To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCWMVYEK54FRBS5SUSPAMGQE3LP3V6Q-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu Jan 19 11:20:00 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-yb1-f183.google.com ([209.85.219.183]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pIS1X-0000Gx-MZ for gtp-pandoc-discuss@m.gmane-mx.org; Thu, 19 Jan 2023 11:19:59 +0100 Original-Received: by mail-yb1-f183.google.com with SMTP id n203-20020a2572d4000000b0078f09db9888sf1692793ybc.18 for ; Thu, 19 Jan 2023 02:19:59 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674123598; cv=pass; d=google.com; s=arc-20160816; b=c6aY1Aj963X3w/IWcfEAeprZsJJYIeZFWWqy7gdAAwCSWxYmJiwp8f94/Lq5PcJ9Rr yph1z33e6HK6GnN0C3YeOzUAAwWROkdD6INKFJ+IZinPMrSDWQ/QzCbFqWUSKT+8m53M 6YWuHm69cS+3fp3Moz255lw14wi8w7L/KB7EmaQIHRqiiTbQ8uGybfhFTbVDpqjaDNJ4 JcwyXymOF/fJhupD/qHvxgSEuhlzxAprN6EkZH28FB8dZEJvUN4mdqR4ObtCglXJyVHr 5h3i6v9eugtfDZOEhepYTYwoPeP+xbeKv0NhiF9tLMyjiO5UY4568CK4DUyWkA9RWqXS cDaA== 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:cc:to:subject:message-id:date:from :reply-to:in-reply-to:references:mime-version:sender:dkim-signature; bh=GqHHzlfuO716bhqNz+ss5M8rQa2luY66lWUXdYOgNYg=; b=fvDgkBnpy4FbaQ9y+AgyffKRx9AEkaF042Fagoy8fwD+qYJve++9bZywt1o5NAUkS6 zdy4//Ta1T5mpMjkDjpC5IDAdDw3gFibGnMVjknvycEzV9qh4J2X4c518mikLGSubvU3 ILcodUltXdc6jedViv7DC5q9HXf4eL+KwoIR9yeMMK/u3PHa0b8omP95T9e0RexZbIHT K/O0IPC+Z5L0bO420y7gc/8B5ybqSaEdJ6e0eusNMtCIy1IbJ3tgYjd2IVq38RDAguW4 6VEfO+pN9FWpZRNUO4f3nFdTocCdOMuivFfE3+Zi8m2xTzKLjVjBKjqmj8w341QJuTR1 p/RA== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 209.85.128.172 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=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:cc:to:subject:message-id:date:from:reply-to :in-reply-to:references:mime-version:sender:from:to:cc:subject:date :message-id:reply-to; bh=GqHHzlfuO716bhqNz+ss5M8rQa2luY66lWUXdYOgNYg=; b=DSpyEo4apNCRzFkREGiZMNynnO4dfHTPKyL/cEZYwZGKzlhZTXhOK+EKO0u7Q3XVJO qyMb6RrxFAkaoBIO3+pbxgfbaiAmVu/NA5M514XBRRbH49KcG/70qNa4hy6R6xz7qKNW wmjBOVLMNN0e3GytN/XGtJZpbiquKJq8xvkulcIH5WPbR22KXdrL4VEON8+NcO6Crw/E W+O4moetN1+b2hT/84MXZYZNPLfMGztitsFHxqLbo9HxsfL7ObVCobD2IItB2kynVMzf Zd6xxs/jsIGJz2k1w5hGzZZrZ06LQwTnFQ/EIDZ3zgfqjgOFwmQj5T3yFCrwL213lkeG EsqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:cc:to:subject :message-id:date:from:reply-to:in-reply-to:references:mime-version :x-gm-message-state:sender:from:to:cc:subject:date:message-id :reply-to; bh=GqHHzlfuO716bhqNz+ss5M8rQa2luY66lWUXdYOgNYg=; b=DtzufgyKh8Az7Vi2sw3bsC2sn8dCHvnJN3RYdGtvJKQucjEcImPWbMiEgSHb3hLlsc KsaxHfVGhjj9L8YG1kvCg477Odqq8fl2mMjZy82eGv4ZnSh88ZvTxDXzC1+9GdhcHk3K esv8OuIPPNpIrpgV2zJJLhxAg5fiixjvwXQvcLkbOZLm4ObBrNtSZwEK2fHZ8XTDlvZw ie8s+1xgZakErmYsxifwpfoM9rH/K2uSh7tf5Og9AB8kPSQKzIF084Yms7BiaAef/q8L rep3V9tFtXObumwznC4Zm0KiJ9ZIb+nArw5kVRpMo17 Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AFqh2komPx+6tlInsdgzrYv3dfCvfzVBwMbE8f0jov2JE3BNXQz/aB4w EgODn7oV04iJSxJTQvcUg68= X-Google-Smtp-Source: AMrXdXsCaBVFZf9jEU20Ek8G2Z3SxqSjKl439CViM6oZZHBcAyk7nsm5iinnAkpM1U99NVcdQayY/g== X-Received: by 2002:a25:bc86:0:b0:7ec:2e1a:c914 with SMTP id e6-20020a25bc86000000b007ec2e1ac914mr1353455ybk.258.1674123598549; Thu, 19 Jan 2023 02:19:58 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a25:ce12:0:b0:7c7:550e:8719 with SMTP id x18-20020a25ce12000000b007c7550e8719ls620376ybe.6.-pod-prod-gmail; Thu, 19 Jan 2023 02:19:54 -0800 (PST) X-Received: by 2002:a05:6902:1c9:b0:7c9:a23:14e with SMTP id u9-20020a05690201c900b007c90a23014emr19914285ybh.3.1674123594869; Thu, 19 Jan 2023 02:19:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674123594; cv=none; d=google.com; s=arc-20160816; b=oQLNENg6rBFviGDhH2gACwYuN5wNQQ+zru4oi5XY/Nov9gNVqGyyGFSx+yAjSRJ8gv uZT6XhtR2Z+uOCVCWiYLkGYmKR9sS6Z3OtA4CqIMKYlj/yIvfuIU0ufeOQU6WJ0UYoko rfJkyD8+B+MInXDTHFRvpGalj+wqyB9FY4yTf/X7/M0JAPa484o3sbzow0Wd7kvKPcss rsmzOPgNCGNc7cwwWn8zOY+fIgwAT+/D3Aio0NvQA0mEsUARqNDfhvpBlLJmB2BfHO3M uAhlpEfqWpIP6Xg7Dbm+K7FS7csyNhsFVAp5xxLa3WcRfdYHWr0eJHBeoCYSZ4RrfJ3c ZI3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:reply-to:in-reply-to:references :mime-version; bh=KdI6joA9ObzTuhBHo8OTxbY2657t6WiODNlResRWRe4=; b=amt58vLBi76yWIvDrZu2q+vFbHxE0Xqj+y0XmVbe6Zm9L/QGA0otPVrSwh5LnZXP/I WhLj7Q3JA3FWAIYqhjZch0i7o9GeNTVLTioyvqJgZ+DDvKgYZ5mLIyu5zxKEs6/IOBFy nG+BJZiq55tQHEtwCo00H84UUBt5nGj8tlh99OG3rQU+uQR1uIsklkdEjfLm5LSu+OdH 4AJgps1NsPw8bnrqo1VFBpVCpWxhTlysnsw/uHnIgF/NO/LzACllg+HNQAEJ9ocNbhSp 1KcTFxhh+mlRnh/+ZRLVqnAkHTDV0L59uB3Y9++OHJTVHE/pMzmgZ0XZ0rDzux6yA4d7 +NqQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 209.85.128.172 as permitted sender) smtp.mailfrom=melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Original-Received: from mail-yw1-f172.google.com (mail-yw1-f172.google.com. [209.85.128.172]) by gmr-mx.google.com with ESMTPS id p78-20020a257451000000b007dea084c723si1283915ybc.4.2023.01.19.02.19.54 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 19 Jan 2023 02:19:54 -0800 (PST) Received-SPF: pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 209.85.128.172 as permitted sender) client-ip=209.85.128.172; Original-Received: by mail-yw1-f172.google.com with SMTP id 00721157ae682-4fc52a0f60cso3418347b3.11 for ; Thu, 19 Jan 2023 02:19:54 -0800 (PST) X-Received: by 2002:a0d:cbd7:0:b0:46f:bd6:957d with SMTP id n206-20020a0dcbd7000000b0046f0bd6957dmr1051050ywd.383.1674123594167; Thu, 19 Jan 2023 02:19:54 -0800 (PST) In-Reply-To: <87lelzmn0l.fsf-9EawChwDxG8hFhg+JK9F0w@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.128.172 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:32024 Archived-At: --00000000000023fb2605f29b46e2 Content-Type: text/plain; charset="UTF-8" Den tors 19 jan. 2023 10:47Albert Krewinkel skrev: > Hi Isaac, > > Thanks for reaching out! > > Isaac Van Doren writes: > > > About Cooklang: > > I am interested in adding a reader to Pandoc for the Cook markdown > > language. Cooklang is a concise, standardized way to format recipes. > > Very interesting! I took a look at Cooklang, it has an appealing > tool-chain. > > > I've written a parser for Cook in Haskell which would be a good > > start. It complies with the official Cooklang canonical tests. > > > > Questions: > > Currently my parser uses Megaparsec. Do I need to refactor it to use > > Parsec instead or is it okay to add Megaparsec as a dependency? > > I believe that pandoc might switch to megaparsec at some point in the > future. But I'm afraid that as of now, the parser library should be > plain ol' parsec. > > > Currently my parser uses String instead of Text. Is it necessary for > > the parser to use Text to be used by Pandoc or could I get away with > > the reader converting its Text input to String when parsing? > > That's probably ok (and not too difficult to change/fix later on). > > > Is there anything else I should know before I start working on a PR? > > Does this seem like a suitable addition to Pandoc? > > I think it would be great to have this, but jgm will have to decide. > > If you don't want to wait and also like to play with new tools, then one > way to get fast results would be to write a parser with the LPeg Lua > library. Pandoc comes with a LPeg and a Lua interpreter included, For quick stuff the lpeg.re library may be easier than Lpeg proper. It supports grammars and is also included with pandoc. http://www.inf.puc-rio.br/~roberto/lpeg/re.html and > those can be used to write custom parsers. We've improved support for > this in pandoc 3, see . > > Cheers, > Albert > > -- > Albert Krewinkel > GPG: 8eed e3e2 e8c5 6f18 81fe e836 388d c0b2 1f63 1124 > > -- > 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/87lelzmn0l.fsf%40zeitkraut.de > . > -- 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/CADAJKhDv%2BS4he3Kr4sh4tUrw4CCmL6r1PJhLyUWazfx1-%3D0kJQ%40mail.gmail.com. --00000000000023fb2605f29b46e2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


Den tors 19 jan. 2023 10:47Albert Krewinkel <albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>= ; skrev:
Hi Isaac,

Thanks for reaching out!

Isaac Van Doren <ivando5522-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> About Cooklang:
> I am interested in adding a reader to Pandoc for the Cook markdown
> language. Cooklang is a concise, standardized way to format recipes.
Very interesting! I took a look at Cooklang, it has an appealing
tool-chain.

> I've written a parser for Cook in Haskell which would be a good > start. It complies with the official Cooklang canonical tests.=C2=A0 >
> Questions:
> Currently my parser uses Megaparsec. Do I need to refactor it to use > Parsec instead or is it okay to add Megaparsec as a dependency?

I believe that pandoc might switch to megaparsec at some point in the
future. But I'm afraid that as of now, the parser library should be
plain ol' parsec.

> Currently my parser uses String instead of Text. Is it necessary for > the parser to use Text to be used by Pandoc or could I get away with > the reader converting its Text input to String when parsing?

That's probably ok (and not too difficult to change/fix later on).

> Is there anything else I should know before I start working on a PR? > Does this seem like a suitable addition to Pandoc?

I think it would be great to have this, but jgm will have to decide.

If you don't want to wait and also like to play with new tools, then on= e
way to get fast results would be to write a parser with the LPeg Lua
library. Pandoc comes with a LPeg and a Lua interpreter included,

For quick stu= ff the lpeg.re library may be easier than Lp= eg proper. It supports grammars and is also included with pandoc.=C2=A0


and
those can be used to write custom parsers. We've improved support for this in pandoc 3, see <https://pandoc.org/custom-read= ers>.

Cheers,
Albert

--
Albert Krewinkel
GPG: 8eed e3e2 e8c5 6f18 81fe=C2=A0 e836 388d c0b2 1f63 1124

--
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@googlegroups.= com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-disc= uss/87lelzmn0l.fsf%40zeitkraut.de.

--
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/CADAJKhDv%2BS4he3Kr4sh4tUrw4CCmL6r1PJ= hLyUWazfx1-%3D0kJQ%40mail.gmail.com.
--00000000000023fb2605f29b46e2--