Skip to content

Commit 0bf9cf6

Browse files
author
Sanders Kleinfeld
committed
Merge pull request #147 from oreillymedia/opf-guide
Fixed guide-generation bug
2 parents 439ae13 + 2ceb5ae commit 0bf9cf6

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

htmlbook-xsl/opf.xsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@
449449
<!-- Otherwise, just use the first <section> in the text -->
450450
<xsl:otherwise>
451451
<xsl:call-template name="output-filename-for-chunk">
452-
<xsl:with-param name="node" select="//h:section[1]"/>
452+
<xsl:with-param name="node" select="(//h:section)[1]"/>
453453
</xsl:call-template>
454454
</xsl:otherwise>
455455
</xsl:choose>

htmlbook-xsl/xspec/opf.xspec

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,15 +511,29 @@ UbuntuMono-Regular.otf
511511
</x:param>
512512
</x:call>
513513
<!-- Note, we can't access document context from a named template, so we can't check hrefs here, but at least we can check for existence of elements -->
514+
<!-- ToDo: parameterize context node for generate-guide so hrefs can be tested, and pending tests can be filled in -->
514515
<x:expect label="There should be a reference element for the cover if generate.cover.html is enabled" test="exists(/opf:guide/opf:reference[@type='cover'])"/>
515516
<x:expect label="There should be a reference element to the EPUB Nav doc" test="exists(/opf:guide/opf:reference[@type='toc'])"/>
516-
<x:expect label="There should be a reference element for 'start-of-text'" test="exists(/opf:guide/opf:reference[@type='text'])"/>
517517
<x:scenario label="With generate.cover.html disabled">
518518
<x:call>
519519
<x:param name="generate.cover.html"/>
520520
</x:call>
521521
<x:expect label="There *should not* be a reference element for the cover" test="not(exists(/opf:guide/opf:reference[@type='cover']))"/>
522522
</x:scenario>
523+
524+
<x:pending>
525+
<x:scenario label="On content that contains a titlepage">
526+
527+
</x:scenario>
528+
529+
<x:scenario label="On content that contains no titlepage, but does contain a TOC">
530+
531+
</x:scenario>
532+
533+
<x:scenario label="On content that contains no titlepage or cover">
534+
535+
</x:scenario>
536+
</x:pending>
523537
</x:scenario>
524538

525539
<x:scenario label="When element is matched in opf.spine.itemref mode">

0 commit comments

Comments
 (0)