public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org>
To: Paul <freack1208-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	pandoc-discuss
	<pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Re: How do I use media bags?
Date: Tue, 01 May 2018 08:12:20 -0700	[thread overview]
Message-ID: <m2r2mv76ln.fsf@johnmacfarlane.net> (raw)
In-Reply-To: <9bd0cbe0-31dd-45bd-be19-6d4fcc49bbec-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>


The more recent pandoc-types should eliminate the need for
the orphan Semigroup instance.

You shouldn't need fillMediaBag if you're reading docx, because
the docx reader should populate the media bag automatically using
images from the docx container itself.

However, there's an issue with the way  your code is structured.
Each time you  do runIO, it will reinitialize the mediabag, so
you'll lose information.  What you should do is put the whole
conversion pipeline (reading docxs and writing epubs) under one runIO.

Paul <freack1208-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> Hello!
>
> Just tried to use the Haskell API side of Pandoc but I rand into lots of 
> "could not fetch resource" warnings". Is there anything that would help me 
> extract the media from the downloaded .docx files and embed them in my 
> epubs?
> The (I believe) relevant parts of my code are here: 
> https://gist.github.com/MagnificentPako/22df4be40251a07a4f5d0dc4fafc5d46
>
> (For some reason I had to re-implement Semigroup for both Pandoc and Meta 
> because my GHC would complain that they are missing it otherwise.)
>
> -- 
> 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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/9bd0cbe0-31dd-45bd-be19-6d4fcc49bbec%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.


  parent reply	other threads:[~2018-05-01 15:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-01  0:53 Paul
     [not found] ` <9bd0cbe0-31dd-45bd-be19-6d4fcc49bbec-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2018-05-01  1:53   ` John MacFarlane
     [not found]     ` <m236zc87lb.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
2018-05-01 12:16       ` Paul
     [not found]         ` <b1d8abc3-8255-40ff-a1ba-075dceace535-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2018-05-01 12:44           ` Ivan Lazar Miljenovic
     [not found]             ` <CA+u6gbxA-M2c-jz7AhWbCg_FgUPDdXOG1-mqz8kDQk20Oh0-Lg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-05-01 16:15               ` Paul
     [not found]                 ` <2408d89d-5ad5-430d-8b01-7c24e2167773-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2018-05-01 22:06                   ` Ivan Lazar Miljenovic
2018-05-01 15:12   ` John MacFarlane [this message]
     [not found]     ` <m2r2mv76ln.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
2018-05-01 15:53       ` Paul
     [not found]         ` <8bd93e89-5f06-4c39-9e68-1191cbe6df60-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2018-05-01 17:42           ` John MacFarlane

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=m2r2mv76ln.fsf@johnmacfarlane.net \
    --to=jgm-tvlzxgkolnx2fbvcvol8/a@public.gmane.org \
    --cc=freack1208-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).