Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
hdoc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Stephane Crozat
hdoc
Commits
3dd7c36c
Commit
3dd7c36c
authored
Dec 20, 2016
by
cliclac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
découpage en sous-chapitre
correction css : ne coupe plus un élément au milieu
parent
f7c3b1ad
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
109 additions
and
37 deletions
+109
-37
hdoc_to_epub/README.md
hdoc_to_epub/README.md
+2
-0
hdoc_to_epub/file/stylesheet.css
hdoc_to_epub/file/stylesheet.css
+4
-0
hdoc_to_epub/hdoc_to_epub.ant
hdoc_to_epub/hdoc_to_epub.ant
+2
-2
hdoc_to_epub/xsl/chapitre.xsl
hdoc_to_epub/xsl/chapitre.xsl
+72
-33
hdoc_to_epub/xsl/content/manifest.xsl
hdoc_to_epub/xsl/content/manifest.xsl
+7
-0
hdoc_to_epub/xsl/content/spine.xsl
hdoc_to_epub/xsl/content/spine.xsl
+5
-0
hdoc_to_epub/xsl/tdmncx.xsl
hdoc_to_epub/xsl/tdmncx.xsl
+17
-2
No files found.
hdoc_to_epub/README.md
View file @
3dd7c36c
...
...
@@ -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
---------------
hdoc_to_epub/file/stylesheet.css
View file @
3dd7c36c
...
...
@@ -89,3 +89,7 @@ td{
padding
:
5px
;
clear
:
both
;
}
.noCut
{
page-break-inside
:
avoid
;
}
hdoc_to_epub/hdoc_to_epub.ant
View file @
3dd7c36c
...
...
@@ -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>
hdoc_to_epub/xsl/chapitre.xsl
View file @
3dd7c36c
...
...
@@ -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() > 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()|@*"
>
...
...
hdoc_to_epub/xsl/content/manifest.xsl
View file @
3dd7c36c
...
...
@@ -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() > 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 -->
...
...
hdoc_to_epub/xsl/content/spine.xsl
View file @
3dd7c36c
...
...
@@ -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() > 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>
hdoc_to_epub/xsl/tdmncx.xsl
View file @
3dd7c36c
...
...
@@ -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() > 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>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment