Thanks for pointing that out! Now I got it to almost work. The epub is being generated and it contains images, but it seems to like using images where they shouldn't be (not like randomly adding images, but using the wrong image). Are there collisions between the images? If so, is that something one can fix?

My current code: https://gist.github.com/MagnificentPako/b72c3347b3e6bc2474c26ee91b8384ae

Am Dienstag, 1. Mai 2018 17:11:25 UTC+2 schrieb John MacFarlane:

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 <freac...-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-discus...@googlegroups.com.
> To post to this group, send email to pandoc-...@googlegroups.com.
> 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.

--
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/8bd93e89-5f06-4c39-9e68-1191cbe6df60%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.