public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org>
To: 'Guillem Marpons' via pandoc-discuss
	<pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>,
	pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: Re: Announcing asciidoc-hs, an AsciiDoc parser in Haskell
Date: Fri, 18 Jun 2021 10:03:34 -0700	[thread overview]
Message-ID: <m21r8z14wp.fsf@MacBook-Pro-2.hsd1.ca.comcast.net> (raw)
In-Reply-To: <c4d2a88d-2edc-ef8c-5db4-dcf87353d634-cl+VPiYnx/1AfugRpC6u6w@public.gmane.org>

"'Guillem Marpons' via pandoc-discuss"
> El 16/6/21 a las 17:01, John MacFarlane escribió:
>> 
>> One issue concerns includes.  The pandoc readers are
>> parameterized on any instance of PandocMonad, so they can be
>> run either "pure" or in an IO context.  PandocMonad provides
>> an abstraction for reading from the file system -- an ersatz
>> file system is used in "pure" instances.
>> 
>> So, for purposes of eventual integration in pandoc, it would be
>> great if your library was compatible with this (rather than,
>> e.g., exporting a parser that requires MonadIO).
>
> I'm more than willing to make the changes needed to integrate with 
> Pandoc-the-tool, when time arrives, and start planing for it. In fact, 
> it seems that PandocMonad implements a lot of the functionality needed 
> for AsciiDoc include/image/whatever expansion.
>
> Now, is there some example of reader implemented as external library 
> that needs access to included files? It seems to me that the easiest way 
> for a library to integrate with PandocMonad would be to put the class in 
> a different package that the library (asciidoc-hs in this case) could 
> have as a dependency. Is there another way? What I understand is that 
> readCommonMark[Body] calls to a pure parser defined in package 
> commonmark, am I right? But it's not possible for the AsciiDoc parser to 
> be pure.

One idea would be to use a custom typeclass instead of using
MonadIO.  Something a bit like PandocMonad, with a pure instance
and an IO instance.  Say you call it AsciidocMonad. Then hooking
up your library to pandoc would just be a matter of defining

    instance AsciidocMonad m => PandocMonad m

-- 
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/m21r8z14wp.fsf%40MacBook-Pro-2.hsd1.ca.comcast.net.


  parent reply	other threads:[~2021-06-18 17:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-16 14:15 'Guillem Marpons' via pandoc-discuss
     [not found] ` <1cee20e4-c8f5-9f6f-9903-a2ae35c1dc28-cl+VPiYnx/1AfugRpC6u6w@public.gmane.org>
2021-06-16 15:01   ` John MacFarlane
     [not found]     ` <m2fsxh3lb6.fsf-jF64zX8BO0+FqBokazbCQ6OPv3vYUT2dxr7GGTnW70NeoWH0uzbU5w@public.gmane.org>
2021-06-17 10:58       ` 'Guillem Marpons' via pandoc-discuss
     [not found]         ` <c4d2a88d-2edc-ef8c-5db4-dcf87353d634-cl+VPiYnx/1AfugRpC6u6w@public.gmane.org>
2021-06-18 17:03           ` John MacFarlane [this message]
     [not found]             ` <m21r8z14wp.fsf-jF64zX8BO0+FqBokazbCQ6OPv3vYUT2dxr7GGTnW70NeoWH0uzbU5w@public.gmane.org>
2021-06-18 17:29               ` 'Guillem Marpons' via pandoc-discuss

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=m21r8z14wp.fsf@MacBook-Pro-2.hsd1.ca.comcast.net \
    --to=jgm-tvlzxgkolnx2fbvcvol8/a@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).