public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: Paul <freack1208-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Re: How do I use media bags?
Date: Tue, 1 May 2018 08:53:47 -0700 (PDT)	[thread overview]
Message-ID: <8bd93e89-5f06-4c39-9e68-1191cbe6df60@googlegroups.com> (raw)
In-Reply-To: <m2r2mv76ln.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>


[-- Attachment #1.1: Type: text/plain, Size: 2861 bytes --]

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

[-- Attachment #1.2: Type: text/html, Size: 5422 bytes --]

  parent reply	other threads:[~2018-05-01 15:53 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
     [not found]     ` <m2r2mv76ln.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
2018-05-01 15:53       ` Paul [this message]
     [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=8bd93e89-5f06-4c39-9e68-1191cbe6df60@googlegroups.com \
    --to=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).