public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Programmatic EPUB generation
@ 2020-10-21  9:51 Wen Kokke
       [not found] ` <ef00fcfd-bd78-4dee-b4a5-07cfd675536fn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Wen Kokke @ 2020-10-21  9:51 UTC (permalink / raw)
  To: pandoc-discuss


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


Heya!

I'm trying to programmatically generate an EPUB using Pandoc, using the 
Haskell API. However, the EPUB documents that I'm generating are broken. It 
looks like I'm not generating standalone documents, e.g., from nav.xhtml 
the following EPUB document headers are missing, and instead the file 
directly contains the <nav> element

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" 
xmlns:epub="http://www.idpf.org/2007/ops" xml:lang="en-US">
<head>
...
</head>
<body>
...
</body>
</head>

How should I fix this? It seems that `--standalone` is strictly a reader 
option, and since an EPUB is a zip file containing multiple documents, and 
is represented in Pandoc by a ByteString, I'm not entirely sure how to go 
about templating either.

Kind regards,
Wen

-- 
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/ef00fcfd-bd78-4dee-b4a5-07cfd675536fn%40googlegroups.com.

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Programmatic EPUB generation
       [not found] ` <ef00fcfd-bd78-4dee-b4a5-07cfd675536fn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2020-10-21 15:44   ` John MacFarlane
  0 siblings, 0 replies; 2+ messages in thread
From: John MacFarlane @ 2020-10-21 15:44 UTC (permalink / raw)
  To: Wen Kokke, pandoc-discuss


You just need to set writerTemplate; it defaults to Nothing.
Grab the default epub template using compileDefaultTemplate.

Wen Kokke <wen.kokke-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> Heya!
>
> I'm trying to programmatically generate an EPUB using Pandoc, using the 
> Haskell API. However, the EPUB documents that I'm generating are broken. It 
> looks like I'm not generating standalone documents, e.g., from nav.xhtml 
> the following EPUB document headers are missing, and instead the file 
> directly contains the <nav> element
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE html>
> <html xmlns="http://www.w3.org/1999/xhtml" 
> xmlns:epub="http://www.idpf.org/2007/ops" xml:lang="en-US">
> <head>
> ...
> </head>
> <body>
> ...
> </body>
> </head>
>
> How should I fix this? It seems that `--standalone` is strictly a reader 
> option, and since an EPUB is a zip file containing multiple documents, and 
> is represented in Pandoc by a ByteString, I'm not entirely sure how to go 
> about templating either.
>
> Kind regards,
> Wen
>
> -- 
> 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/ef00fcfd-bd78-4dee-b4a5-07cfd675536fn%40googlegroups.com.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-10-21 15:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-21  9:51 Programmatic EPUB generation Wen Kokke
     [not found] ` <ef00fcfd-bd78-4dee-b4a5-07cfd675536fn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2020-10-21 15:44   ` John MacFarlane

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).