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 ...@@ -55,5 +55,7 @@ Validation
Étude compatibilité entre EPUB2 et EPUB3 Étude compatibilité entre EPUB2 et EPUB3
Test : Mettre un élément fondamental avec une taille plus grande qu'une page.
Technical Notes Technical Notes
--------------- ---------------
...@@ -89,3 +89,7 @@ td{ ...@@ -89,3 +89,7 @@ td{
padding: 5px; padding: 5px;
clear: both; clear: both;
} }
.noCut{
page-break-inside: avoid;
}
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
<mkdir dir="${tmpRetour}/oebps/styles"/> <mkdir dir="${tmpRetour}/oebps/styles"/>
<copy file="${file}/stylesheet.css" todir="${tmpRetour}/oebps/styles"/> <copy file="${file}/stylesheet.css" todir="${tmpRetour}/oebps/styles"/>
<mkdir dir="${tmpRetour}/oebps/images"/> <mkdir dir="${tmpRetour}/oebps/images"/>
<copy todir="${tmpRetour}/oebps/images"> <copy todir="${tmpRetour}/oebps/images" failonerror="false">
<fileset dir="${tmp}/${filename}/decompressedHdoc/re" includes="**"/> <fileset dir="${tmp}/${filename}/decompressedHdoc/re" includes="**"/>
</copy> </copy>
<mkdir dir="${tmpRetour}/oebps/chapitres"/> <mkdir dir="${tmpRetour}/oebps/chapitres"/>
...@@ -131,7 +131,7 @@ ...@@ -131,7 +131,7 @@
</target> </target>
<target name="CleanTmp"> <target name="CleanTmp">
<delete dir="${tmp}" failonerror="false"/> <!--<delete dir="${tmp}" failonerror="false"/> -->
</target> </target>
</project> </project>
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<xsl:output method="xml" indent="yes" encoding="UTF-8"/> <xsl:output method="xml" indent="yes" encoding="UTF-8"/>
<xsl:template match="/html" priority="10"> <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: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}"> <xsl:result-document method="xml" href="{$path}">
<html xml:lang="en" lang="en" xmlns:epub="http://www.idpf.org/2007/ops"> <html xml:lang="en" lang="en" xmlns:epub="http://www.idpf.org/2007/ops">
...@@ -27,6 +27,23 @@ ...@@ -27,6 +27,23 @@
</xsl:for-each> </xsl:for-each>
</xsl:template> </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:template match="section" priority="3">
<xsl:element name="h{count(ancestor::section)+1}"> <xsl:element name="h{count(ancestor::section)+1}">
<xsl:value-of select="header/h1"/> <xsl:value-of select="header/h1"/>
...@@ -38,6 +55,7 @@ ...@@ -38,6 +55,7 @@
<xsl:template match="//div[@data-hdoc-type='remark']" priority="4"> <xsl:template match="//div[@data-hdoc-type='remark']" priority="4">
<div class="noCut">
<h3> <h3>
<xsl:if test="h6"> <xsl:if test="h6">
<span class="textTitle"><xsl:value-of select="h6"/></span> <span class="textTitle"><xsl:value-of select="h6"/></span>
...@@ -47,9 +65,11 @@ ...@@ -47,9 +65,11 @@
<div class="border"> <div class="border">
<xsl:apply-templates/> <xsl:apply-templates/>
</div> </div>
</div>
</xsl:template> </xsl:template>
<xsl:template match="//div[@data-hdoc-type='emphasis']" priority="4"> <xsl:template match="//div[@data-hdoc-type='emphasis']" priority="4">
<div class="noCut">
<h3> <h3>
<xsl:if test="h6"> <xsl:if test="h6">
<span class="textTitle"><xsl:value-of select="h6"/></span> <span class="textTitle"><xsl:value-of select="h6"/></span>
...@@ -59,9 +79,11 @@ ...@@ -59,9 +79,11 @@
<div class="border"> <div class="border">
<xsl:apply-templates/> <xsl:apply-templates/>
</div> </div>
</div>
</xsl:template> </xsl:template>
<xsl:template match="//div[@data-hdoc-type='complement']" priority="4"> <xsl:template match="//div[@data-hdoc-type='complement']" priority="4">
<div class="noCut">
<h3> <h3>
<xsl:if test="h6"> <xsl:if test="h6">
<span class="textTitle"><xsl:value-of select="h6"/></span> <span class="textTitle"><xsl:value-of select="h6"/></span>
...@@ -71,9 +93,11 @@ ...@@ -71,9 +93,11 @@
<div class="border"> <div class="border">
<xsl:apply-templates/> <xsl:apply-templates/>
</div> </div>
</div>
</xsl:template> </xsl:template>
<xsl:template match="//div[@data-hdoc-type='example']" priority="4"> <xsl:template match="//div[@data-hdoc-type='example']" priority="4">
<div class="noCut">
<h3> <h3>
<xsl:if test="h6"> <xsl:if test="h6">
<span class="textTitle"><xsl:value-of select="h6"/></span> <span class="textTitle"><xsl:value-of select="h6"/></span>
...@@ -83,6 +107,7 @@ ...@@ -83,6 +107,7 @@
<div class="border"> <div class="border">
<xsl:apply-templates/> <xsl:apply-templates/>
</div> </div>
</div>
</xsl:template> </xsl:template>
<xsl:template match="//div[@data-hdoc-type='warning']" priority="4"> <xsl:template match="//div[@data-hdoc-type='warning']" priority="4">
...@@ -97,6 +122,20 @@ ...@@ -97,6 +122,20 @@
</div> </div>
</xsl:template> </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 --> <!-- Identity transformation -->
<xsl:template match="node()|@*"> <xsl:template match="node()|@*">
<xsl:copy> <xsl:copy>
......
...@@ -17,6 +17,13 @@ ...@@ -17,6 +17,13 @@
<xsl:attribute name="media-type">application/xhtml+xml</xsl:attribute> <xsl:attribute name="media-type">application/xhtml+xml</xsl:attribute>
</item> </item>
</xsl:for-each> </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 --> <!-- CSS -->
<item id="CSS" href="styles/stylesheet.css" media-type="text/css"/> <item id="CSS" href="styles/stylesheet.css" media-type="text/css"/>
<!-- Images --> <!-- Images -->
......
...@@ -12,6 +12,11 @@ ...@@ -12,6 +12,11 @@
<xsl:attribute name="idref">ch_<xsl:number level="multiple" count="section" format="1"/></xsl:attribute> <xsl:attribute name="idref">ch_<xsl:number level="multiple" count="section" format="1"/></xsl:attribute>
</itemref> </itemref>
</xsl:for-each> </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> </spine>
</xsl:template> </xsl:template>
</xsl:stylesheet> </xsl:stylesheet>
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
</ncx> </ncx>
</xsl:template> </xsl:template>
<xsl:template match="/html/body/section"> <xsl:template match="html/body/section">
<navPoint> <navPoint>
<xsl:attribute name="class">h<xsl:value-of select="count(ancestor::section)+1"/></xsl:attribute> <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> <xsl:attribute name="id">ch_<xsl:number level="multiple" count="section" format="1_1"/></xsl:attribute>
...@@ -35,7 +35,22 @@ ...@@ -35,7 +35,22 @@
<xsl:attribute name="src">chapitres/chapitre<xsl:number level="multiple" count="section" format="1_1"/>.xhtml</xsl:attribute> <xsl:attribute name="src">chapitres/chapitre<xsl:number level="multiple" count="section" format="1_1"/>.xhtml</xsl:attribute>
</content> </content>
<xsl:apply-templates/> <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>
<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> </navPoint>
</xsl:template> </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