From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/4967 Path: news.gmane.org!not-for-mail From: Jason Morrison Newsgroups: gmane.text.pandoc Subject: Re: EPUB toc for whole book? Date: Thu, 25 Oct 2012 22:16:34 -0700 (PDT) Message-ID: <8cc0d96a-d364-4f03-a7bb-3b0b558fa857@googlegroups.com> References: <6465376.92.1335560944887.JavaMail.geo-discussion-forums@ynfi5> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_320_10297618.1351228594080" X-Trace: ger.gmane.org 1351232102 6498 80.91.229.3 (26 Oct 2012 06:15:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 26 Oct 2012 06:15:02 +0000 (UTC) To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCBYH5HH4MNBBZGUVCCAKGQEPJILODA-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri Oct 26 08:15:11 2012 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-oa0-f58.google.com ([209.85.219.58]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TRdCH-0001eI-1M for gtp-pandoc-discuss@m.gmane.org; Fri, 26 Oct 2012 08:15:09 +0200 Original-Received: by mail-oa0-f58.google.com with SMTP id l10sf1573478oag.3 for ; Thu, 25 Oct 2012 23:15:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=x-beenthere:date:from:to:message-id:in-reply-to:references:subject :mime-version:x-original-sender:reply-to:precedence:mailing-list :list-id:x-google-group-id:list-post:list-help:list-archive:sender :list-subscribe:list-unsubscribe:content-type; bh=ogu78w8mtM9aajqs8baSPtBNXD4DpjFd6Av5hr3H+mw=; b=dDOg0suxOlOZyRijEPP5Qpod68WIwg0Jx9v5TlwfyQ0w8F7f7QQJWwv8Dre0t/n8ca +FtPMPV/WotHdbevnxpeRduaZXdReW37NasErMQwlDXvlsUm6c9EUwii8pETs6ek0Pou kUv1IJv8ezgGeMIC4c/ZinyNf3y3SPf38mqpG+lKAQsLFDlVWfMfm6FWyZV8mfru2a+8 G1zRyQJLFC2HkSTBV8ORdNK7+eEQoCfJ2/AXnGBOJIoMa2Z9AanN+UPAhUzk0jk7Re0/ +JaABTdh1iB+QY3LUw5CvS2JSS5YZ+2lqeCb65DazZ5zoQHrXtVOvTrxFlMuz6riIilW VD+w== Original-Received: by 10.50.197.227 with SMTP id ix3mr177531igc.3.1351232100592; Thu, 25 Oct 2012 23:15:00 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.42.244.193 with SMTP id lr1ls8532788icb.1.gmail; Thu, 25 Oct 2012 23:14:59 -0700 (PDT) Original-Received: by 10.43.81.137 with SMTP id zy9mr12370460icb.0.1351232099970; Thu, 25 Oct 2012 23:14:59 -0700 (PDT) Original-Received: by 10.50.57.13 with SMTP id e13msigq; Thu, 25 Oct 2012 22:16:34 -0700 (PDT) Original-Received: by 10.68.253.202 with SMTP id ac10mr2529963pbd.7.1351228594444; Thu, 25 Oct 2012 22:16:34 -0700 (PDT) In-Reply-To: <6465376.92.1335560944887.JavaMail.geo-discussion-forums@ynfi5> X-Original-Sender: jason.p.morrison-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Precedence: list Mailing-list: list pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; contact pandoc-discuss+owners-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-ID: X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-Subscribe: , List-Unsubscribe: , Xref: news.gmane.org gmane.text.pandoc:4967 Archived-At: ------=_Part_320_10297618.1351228594080 Content-Type: text/plain; charset=ISO-8859-1 I've written a Ruby script that post-processes the EPUB file to inject a more full table of contents. It includes h1 (chapter), h2 and h3 section levels. I've pasted the script here: https://gist.github.com/e3158a3bba95b34ce9c0 - it's pretty hacky, but does the job for me. My Haskell's not sufficiently up to snuff to include a patch to do this properly, and I'm not sure there's a way to iterate over chapters+sections in the templates (e.g. epub-titlepage.html). Also, in another thread, John @jgm asked for an example of an EPUB with this kind of inline TOC, but I can't for the life of me find the thread/GH issue. Anyway, I included and an example before/after contents.opf and the new contents.xhtml in the paste as well. -- You received this message because you are subscribed to the Google Groups "pandoc-discuss" group. To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/pandoc-discuss/-/c5AU3gaLto4J. For more options, visit https://groups.google.com/groups/opt_out. ------=_Part_320_10297618.1351228594080 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
I've written a Ruby script that post-processes the EPUB file to inject= a more full table of contents.  It includes h1 (chapter), h2 and h3 s= ection levels.

I've pasted the script her= e: https://gist.github.com/e3158a3bba95b34ce9c0 - it's pretty hacky, b= ut does the job for me.

My Haskell's not sufficie= ntly up to snuff to include a patch to do this properly, and I'm not sure t= here's a way to iterate over chapters+sections in the templates (e.g. epub-= titlepage.html).

Also, in another thread, John @jgm= asked for an example of an EPUB with this kind of inline TOC, but I can't = for the life of me find the thread/GH issue.  Anyway, I included = and an example before/after contents.opf and the new contents.xhtml in the = paste as well.

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to pandoc-discuss+unsubscribe@go= oglegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/pan= doc-discuss/-/c5AU3gaLto4J.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
------=_Part_320_10297618.1351228594080--