public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: Albert Krewinkel <albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Cc: Isaac Van Doren <ivando5522-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: Re: Adding a reader for Cooklang and a question about Megaparsec
Date: Thu, 19 Jan 2023 00:26:29 +0100	[thread overview]
Message-ID: <87lelzmn0l.fsf@zeitkraut.de> (raw)
In-Reply-To: <08647ee9-9616-482c-bae8-2657d16df33fn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>

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. 
>
> 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, and
those can be used to write custom parsers. We've improved support for
this in pandoc 3, see <https://pandoc.org/custom-readers>.

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.


  parent reply	other threads:[~2023-01-18 23:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-16  3:07 Isaac Van Doren
     [not found] ` <08647ee9-9616-482c-bae8-2657d16df33fn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2023-01-18 23:26   ` Albert Krewinkel [this message]
     [not found]     ` <87lelzmn0l.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
2023-01-19 10:19       ` BPJ
2023-01-19 16:44       ` John MacFarlane
     [not found]         ` <CC6D5774-540D-4B62-B087-AD01C40CC502-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2023-01-19 16:50           ` Isaac Van Doren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lelzmn0l.fsf@zeitkraut.de \
    --to=albert+pandoc-9eawchwdxg8hfhg+jk9f0w@public.gmane.org \
    --cc=ivando5522-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).