From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/4968 Path: news.gmane.org!not-for-mail From: fiddlosopher Newsgroups: gmane.text.pandoc Subject: Re: EPUB toc for whole book? Date: Thu, 25 Oct 2012 23:17:45 -0700 (PDT) Message-ID: <12953acb-5439-440f-86fd-918665b0f385@googlegroups.com> References: <6465376.92.1335560944887.JavaMail.geo-discussion-forums@ynfi5> <8cc0d96a-d364-4f03-a7bb-3b0b558fa857@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_377_1381138.1351232266008" X-Trace: ger.gmane.org 1351232268 7615 80.91.229.3 (26 Oct 2012 06:17:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 26 Oct 2012 06:17:48 +0000 (UTC) To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBDW7ZIEHTIIBBCWWVCCAKGQELNVABAQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri Oct 26 08:17:57 2012 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-yh0-f58.google.com ([209.85.213.58]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TRdEx-0003OU-IA for gtp-pandoc-discuss@m.gmane.org; Fri, 26 Oct 2012 08:17:55 +0200 Original-Received: by mail-yh0-f58.google.com with SMTP id m54sf1579691yhm.3 for ; Thu, 25 Oct 2012 23:17:47 -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=5Wgv25glM/NDmy7F4TCmfjpHBrZ5UR3+SprQkb2yDU8=; b=aVNKOQAi2v/hIlg0kGfhbFaQrjLznhy1Z1+Nw514Xj2L2DUiW/wL9Vd5O3MbSYoDaD rGhInIB9KgQWWwy+KC7XAAvXmDn8hXqWq+wBhQWUBhM5GJuF7XDFpmXSn63ELVHhVRaQ zDRE2LSeUg7eQu2IP6wh3Lqv0ZXvZpUBdqPtIerdkWvIhXMAxUsJtWtzs0sSQIoctfg0 qS7ZD7WdJJooLDDJ+2YXXebmHikHh9CWYH158FsApY6xG0ANu+MIRNg+csajeXCiLuwb 2Vld9CaNsnRuigtw7EyBWLWHrcgetTMOxcimi1o1XHFsI69rsxltwtZQJXGoKeK6ogI2 XsoA== Original-Received: by 10.68.131.34 with SMTP id oj2mr6872104pbb.6.1351232266764; Thu, 25 Oct 2012 23:17:46 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.68.194.202 with SMTP id hy10ls14913441pbc.0.gmail; Thu, 25 Oct 2012 23:17:46 -0700 (PDT) Original-Received: by 10.68.189.37 with SMTP id gf5mr6808220pbc.16.1351232266334; Thu, 25 Oct 2012 23:17:46 -0700 (PDT) In-Reply-To: <8cc0d96a-d364-4f03-a7bb-3b0b558fa857-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> X-Original-Sender: fiddlosopher-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:4968 Archived-At: ------=_Part_377_1381138.1351232266008 Content-Type: text/plain; charset=ISO-8859-1 You'll be pleased to know that the dev version of pandoc does create a more full table of contents, so after the next release your script shouldn't be needed. On Thursday, October 25, 2012 10:16:34 PM UTC-7, Jason Morrison wrote: > > 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/-/P_re1cppfJYJ. For more options, visit https://groups.google.com/groups/opt_out. ------=_Part_377_1381138.1351232266008 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable You'll be pleased to know that the dev version of pandoc does create a more= full table of contents, so after the next release your script shouldn't be= needed.

On Thursday, October 25, 2012 10:16:34 PM UTC-7, Jason Morr= ison wrote:
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.
<= /div>

I've pasted the script here: https://gis= t.github.com/e3158a3bba95b34ce9c0 - it's pretty hacky, but does th= e 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 w= ay 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 li= fe of me find the thread/GH issue.  Anyway, I included and an exa= mple before/after contents.opf and the new contents.xhtml in the paste as w= ell.

--
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/-/P_re1cppfJYJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
------=_Part_377_1381138.1351232266008--