Commit 3dd7c36c authored by cliclac's avatar cliclac

découpage en sous-chapitre

correction css : ne coupe plus un élément au milieu
parent f7c3b1ad
......@@ -55,5 +55,7 @@ Validation
Étude compatibilité entre EPUB2 et EPUB3
Test : Mettre un élément fondamental avec une taille plus grande qu'une page.
Technical Notes
---------------
......@@ -89,3 +89,7 @@ td{
padding: 5px;
clear: both;
}
.noCut{
page-break-inside: avoid;
}
......@@ -102,7 +102,7 @@
<mkdir dir="${tmpRetour}/oebps/styles"/>
<copy file="${file}/stylesheet.css" todir="${tmpRetour}/oebps/styles"/>
<mkdir dir="${tmpRetour}/oebps/images"/>
<copy todir="${tmpRetour}/oebps/images">
<copy todir="${tmpRetour}/oebps/images" failonerror="false">
<fileset dir="${tmp}/${filename}/decompressedHdoc/re" includes="**"/>
</copy>
<mkdir dir="${tmpRetour}/oebps/chapitres"/>
......@@ -131,7 +131,7 @@
</target>
<target name="CleanTmp">
<delete dir="${tmp}" failonerror="false"/>
<!--<delete dir="${tmp}" failonerror="false"/> -->
</target>
</project>
......@@ -9,7 +9,7 @@
<xsl:output method="xml" indent="yes" encoding="UTF-8"/>
<xsl:template match="/html" priority="10">
<xsl:for-each select="body/section">
<xsl:for-each select="/html/body/section">
<xsl:variable name="path">../../../retour/oebps/chapitres/chapitre<xsl:number level="multiple" count="section" format="1"/>.xhtml</xsl:variable>
<xsl:result-document method="xml" href="{$path}">
<html xml:lang="en" lang="en" xmlns:epub="http://www.idpf.org/2007/ops">
......@@ -27,6 +27,23 @@
</xsl:for-each>
</xsl:template>
<xsl:template match="//section[count(ancestor::section) = 1 and position() &gt; 1]" priority="9">
<xsl:variable name="path">../../../retour/oebps/chapitres/chapitre<xsl:number level="multiple" count="section" format="1_1"/>.xhtml</xsl:variable>
<xsl:result-document method="xml" href="{$path}">
<html xml:lang="en" lang="en" xmlns:epub="http://www.idpf.org/2007/ops">
<head>
<title><xsl:value-of select="header/h1"/></title>
<meta content="http://www.w3.org/1999/xhtml; charset=utf-8" http-equiv="Content-Type"/>
<link href="../styles/stylesheet.css" type="text/css" rel="stylesheet"/>
</head>
<body>
<h2><xsl:value-of select="header/h1"/></h2>
<xsl:apply-templates select="div|section"/>
</body>
</html>
</xsl:result-document>
</xsl:template>
<xsl:template match="section" priority="3">
<xsl:element name="h{count(ancestor::section)+1}">
<xsl:value-of select="header/h1"/>
......@@ -38,50 +55,58 @@
<xsl:template match="//div[@data-hdoc-type='remark']" priority="4">
<h3>
<xsl:if test="h6">
<span class="textTitle"><xsl:value-of select="h6"/></span>
</xsl:if>
<span class="title">Remarque</span>
</h3>
<div class="border">
<xsl:apply-templates/>
<div class="noCut">
<h3>
<xsl:if test="h6">
<span class="textTitle"><xsl:value-of select="h6"/></span>
</xsl:if>
<span class="title">Remarque</span>
</h3>
<div class="border">
<xsl:apply-templates/>
</div>
</div>
</xsl:template>
<xsl:template match="//div[@data-hdoc-type='emphasis']" priority="4">
<h3>
<xsl:if test="h6">
<span class="textTitle"><xsl:value-of select="h6"/></span>
</xsl:if>
<span class="title">Fondamental</span>
</h3>
<div class="border">
<xsl:apply-templates/>
<div class="noCut">
<h3>
<xsl:if test="h6">
<span class="textTitle"><xsl:value-of select="h6"/></span>
</xsl:if>
<span class="title">Fondamental</span>
</h3>
<div class="border">
<xsl:apply-templates/>
</div>
</div>
</xsl:template>
<xsl:template match="//div[@data-hdoc-type='complement']" priority="4">
<h3>
<xsl:if test="h6">
<span class="textTitle"><xsl:value-of select="h6"/></span>
</xsl:if>
<span class="title">Complément</span>
</h3>
<div class="border">
<xsl:apply-templates/>
<div class="noCut">
<h3>
<xsl:if test="h6">
<span class="textTitle"><xsl:value-of select="h6"/></span>
</xsl:if>
<span class="title">Complément</span>
</h3>
<div class="border">
<xsl:apply-templates/>
</div>
</div>
</xsl:template>
<xsl:template match="//div[@data-hdoc-type='example']" priority="4">
<h3>
<xsl:if test="h6">
<span class="textTitle"><xsl:value-of select="h6"/></span>
</xsl:if>
<span class="title">Example</span>
</h3>
<div class="border">
<xsl:apply-templates/>
<div class="noCut">
<h3>
<xsl:if test="h6">
<span class="textTitle"><xsl:value-of select="h6"/></span>
</xsl:if>
<span class="title">Example</span>
</h3>
<div class="border">
<xsl:apply-templates/>
</div>
</div>
</xsl:template>
......@@ -96,6 +121,20 @@
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template match="//div[@data-hdoc-type='advice']" priority="4">
<div class="noCut">
<h3>
<xsl:if test="h6">
<span class="textTitle"><xsl:value-of select="h6"/></span>
</xsl:if>
<span class="title">Conseil</span>
</h3>
<div class="border">
<xsl:apply-templates/>
</div>
</div>
</xsl:template>
<!-- Identity transformation -->
<xsl:template match="node()|@*">
......
......@@ -17,6 +17,13 @@
<xsl:attribute name="media-type">application/xhtml+xml</xsl:attribute>
</item>
</xsl:for-each>
<xsl:for-each select="//section[count(ancestor::section) = 1 and position() &gt; 1]">
<item>
<xsl:attribute name="href">chapitres/chapitre<xsl:number level="multiple" count="section" format="1_1"/>.xhtml</xsl:attribute>
<xsl:attribute name="id">ch_<xsl:number level="multiple" count="section" format="1_1"/></xsl:attribute>
<xsl:attribute name="media-type">application/xhtml+xml</xsl:attribute>
</item>
</xsl:for-each>
<!-- CSS -->
<item id="CSS" href="styles/stylesheet.css" media-type="text/css"/>
<!-- Images -->
......
......@@ -12,6 +12,11 @@
<xsl:attribute name="idref">ch_<xsl:number level="multiple" count="section" format="1"/></xsl:attribute>
</itemref>
</xsl:for-each>
<xsl:for-each select="//section[count(ancestor::section) = 1 and position() &gt; 1]">
<itemref>
<xsl:attribute name="idref">ch_<xsl:number level="multiple" count="section" format="1_1"/></xsl:attribute>
</itemref>
</xsl:for-each>
</spine>
</xsl:template>
</xsl:stylesheet>
......@@ -22,7 +22,23 @@
</ncx>
</xsl:template>
<xsl:template match="/html/body/section">
<xsl:template match="html/body/section">
<navPoint>
<xsl:attribute name="class">h<xsl:value-of select="count(ancestor::section)+1"/></xsl:attribute>
<xsl:attribute name="id">ch_<xsl:number level="multiple" count="section" format="1_1"/></xsl:attribute>
<navLabel>
<text>
<xsl:value-of select="header/h1"/>
</text>
</navLabel>
<content>
<xsl:attribute name="src">chapitres/chapitre<xsl:number level="multiple" count="section" format="1_1"/>.xhtml</xsl:attribute>
</content>
<xsl:apply-templates/>
</navPoint>
</xsl:template>
<xsl:template match="//section[count(ancestor::section) = 1 and position() &gt; 1]">
<navPoint>
<xsl:attribute name="class">h<xsl:value-of select="count(ancestor::section)+1"/></xsl:attribute>
<xsl:attribute name="id">ch_<xsl:number level="multiple" count="section" format="1_1"/></xsl:attribute>
......@@ -35,7 +51,6 @@
<xsl:attribute name="src">chapitres/chapitre<xsl:number level="multiple" count="section" format="1_1"/>.xhtml</xsl:attribute>
</content>
<xsl:apply-templates/>
</navPoint>
</xsl:template>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment