Commit f7c3b1ad authored by cliclac's avatar cliclac

verification + css

parent 0cda743d
......@@ -40,6 +40,8 @@ Known bugs
Problème dans le hdoc : contient des images mais ne sont pas référencées.
Problème dans le hdoc : impossible de savoir quand il y a du code.
Problème avec les keywords : le hdoc contient des keywords mais nous ne savons pas où les utiliser.
Todo list
......
Copyright (c) 2007 Adobe Systems Incorporated
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
This folder contains the distribution of epubcheck project.
EpubCheck is a tool to validate IDPF Epub files. It can detect many
types of errors in Epub. OCF container structure, OPF and OPS mark-up,
and internal reference consistency are checked. EpubCheck can be run
as a standalone command-line tool, installed as a web application or
used as a library.
EpubCheck project home: https://github.com/idpf/epubcheck
RUNNING
To run the tool you need Java Runtime (1.6 or above). Any OS should do. Run
it from the command line:
java -jar epubcheck.jar file.epub
All detected errors are simply printed to stderr.
USING AS A LIBRARY
You can also use EpubCheck as a library in your Java application. EpubCheck
public interfaces can be found in com.adobe.epubcheck.api package. EpubCheck
class can be used to instantiate a validation engine. Use one of its
constructors and then call validate() method. Report is an interface that
you can implement to get a list of the errors and warnings reported by the
validation engine (instead of the error list being printed out).
LICENSING
See COPYING.txt and THIRD-PARTY.txt
AUTHORS / CONTRIBUTORS
Peter Sorotokin
Garth Conboy
Markus Gylling
Piotr Kula
Paul Norton
Jessica Hekman
Liza Daly
George Bina
Bogdan Iordache
Ionut-Maxim Margelatu
Romain Deltour
Thomas Ledoux
Tobias Fischer
Steve Antoch
Arwen Pond
Masayoshi Takahashi
Satoshi KOJIMA
Most of the EpubCheck functionality comes from the schema validation tool Jing
and schemas that were developed by IDPF and DAISY. EpubCheck development was
largely done at Adobe Systems.
Licenses of third-party dependencies
------------------------------------
Guava: Google Core Libraries for Java, 14.0.1
The Apache Software License, Version 2.0
TwelveMonkeys :: Common :: Image, 3.1.2
New BSD License
TwelveMonkeys :: Common :: IO, 3.1.2
New BSD License
TwelveMonkeys :: Common :: Language support, 3.1.2
New BSD License
TwelveMonkeys :: ImageIO :: Core, 3.1.2
New BSD License
TwelveMonkeys :: ImageIO :: JPEG plugin, 3.1.2
New BSD License
TwelveMonkeys :: ImageIO :: Metadata, 3.1.2
New BSD License
Saxon-HE, 9.5.1-5
Mozilla Public License Version 2.0
Commons Compress, 1.5
The Apache Software License, Version 2.0
Jackson, 1.9.12
The Apache Software License, Version 2.0
Data Mapper for Jackson, 1.9.12
The Apache Software License, Version 2.0
Jing, 20120724.0.0
New BSD License
Simple API for CSS, 1.3
The W3C Software License
Copies of the licenses are provided in the 'licenses' directory.
\ No newline at end of file
This diff is collapsed.
Copyright (c) {{YEAR}}, {{OWNER}}
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
Neither the name of {{the ORGANIZATION nor the names of its contributors}} may
be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY {{THE COPYRIGHT HOLDERS AND CONTRIBUTORS}} "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL {{THE COPYRIGHT HOLDER OR CONTRIBUTORS}} BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
This diff is collapsed.
W3C® SOFTWARE NOTICE AND LICENSE
Copyright © 1994-2002 World Wide Web Consortium, (Massachusetts Institute of Technology, Institut National de Recherche en Informatique et en Automatique, Keio University). All Rights Reserved. http://www.w3.org/Consortium/Legal/
This W3C work (including software, documents, or other related items) is being provided by the copyright holders under the following license. By obtaining, using and/or copying this work, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions:
Permission to use, copy, modify, and distribute this software and its documentation, with or without modification, for any purpose and without fee or royalty is hereby granted, provided that you include the following on ALL copies of the software and documentation or portions thereof, including modifications, that you make:
The full text of this NOTICE in a location viewable to users of the redistributed or derivative work.
Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist, a short notice of the following form (hypertext is preferred, text is permitted) should be used within the body of any redistributed or derivative code: "Copyright © [$date-of-software] World Wide Web Consortium, (Massachusetts Institute of Technology, Institut National de Recherche en Informatique et en Automatique, Keio University). All Rights Reserved. http://www.w3.org/Consortium/Legal/"
Notice of any changes or modifications to the W3C files, including the date changes were made. (We recommend you provide URIs to the location from which the code is derived.)
THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION.
The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the software without specific, written prior permission. Title to copyright in this software and any associated documentation will at all times remain with copyright holders.
\ No newline at end of file
body{
margin: 0px;
padding: 0px;
height: 100%;
font: 12px Tahoma, Arial, Sans-serif;
}
h1, h2, h3, h4, h5, h6{
font-weight: bold;
}
h1{
font-size: 1.8em;
color: #4463A1;
text-align: center;
}
h2{
font-size:1.8em;
color:#4463A1;
}
h3{
font-size: 1.4em;
color: #4463A1;
}
h4, h5, h6{
font-size: 1.3em;
color: #4463A1;
}
p{
text-align: justify;
font-size: 1.2em;
margin: 0.2em 1em 0.7em 1em;
}
table, td, th {
border: 1px solid #4463A1;
text-align: center;
font-size: 1.2em;
}
td p, th p{
text-align: center;
font-size: 15px;
}
tr:first-child {
font-weight: bold;
color : white;
background-color : #4463A1;
}
table {
border-collapse: collapse;
width: 100%;
}
th {
padding: 10px;
}
td{
padding: 5px;
}
.textTitle{
float : left;
}
.title{
float : right;
}
.border{
background: #f5fcff;
border: 2px solid #4463A1;
box-shadow: 0px 5px 5px #888888;
padding: 5px;
clear: both;
}
.warning{
color:#cc0000;
}
.borderWarning{
background: #ffcccc;
border: 2px solid #cc0000;
box-shadow: 0px 5px 5px #888888;
padding: 5px;
clear: both;
}
......@@ -52,20 +52,22 @@
<antcall target="MakeOPS">
<param name="filename" value="${filename}"/>
</antcall>
<propertyregex property="properFilename" input="${filename}" regexp=".hdoc" replace="" casesensitive="false" override="true" />
<antcall target="ZipEpubFile">
<param name="filename" value="${filename}"/>
<param name="properFilename" value="${properFilename}"/>
</antcall>
<antcall target="ValidateOutput">
<param name="filename" value="${filename}"/>
<param name="properFilename" value="${properFilename}"/>
</antcall>
<antcall target="CleanTmp"/>
</sequential>
</for>
</target>
<target name="UnzipHdocFile">
<!-- Unzip the input hdoc file. Decompressed folder is named "decompressedHdoc" : this name is the only one which
refers to the hdoc file furthermore in this project. -->
......@@ -97,11 +99,12 @@
</target>
<target name="MakeOPS">
<mkdir dir="${tmpRetour}/oebps/styles"/>
<copy file="${file}/stylesheet.css" todir="${tmpRetour}/oebps/styles"/>
<mkdir dir="${tmpRetour}/oebps/images"/>
<copy todir="${tmpRetour}/oebps/images">
<fileset dir="${tmp}/${filename}/decompressedHdoc/re" includes="**"/>
</copy>
<mkdir dir="${tmpRetour}/oebps/styles"/>
<mkdir dir="${tmpRetour}/oebps/chapitres"/>
<xslt in="${tmp}/${filename}/decompressedHdoc/content.xml" out="${tmpRetour}/oebps/tableDesMatieres.ncx" classpath="${lib}/saxon9he.jar" style="${xsl}/tdmncx.xsl"/>
<xslt destdir="${tmpRetour}/oebps/chapitres" basedir="${tmp}/${filename}/decompressedHdoc" includes="content.xml" classpath="${lib}/saxon9he.jar" style="${xsl}/chapitre.xsl"/>
......@@ -109,14 +112,12 @@
</target>
<target name="ZipEpubFile">
<propertyregex property="properFilename" input="${filename}" regexp=".hdoc" replace="" casesensitive="false" override="true" />
<zip destfile="${out}/${properFilename}.epub" update="true" encoding="UTF-8">
<zipfileset dir="${tmpRetour}/META-INF"
includes="*" prefix="META-INF"/>
<zipfileset dir="${tmpRetour}/oebps"
includes="**" prefix="oebps"/>
</zip>
<!-- zip64Mode="never" -->
<zip destfile="${out}/${properFilename}.epub" update="true" compress="false" encoding="UTF-8" keepcompression="true" createunicodeextrafields="never">
<zipfileset dir="${tmpRetour}"
includes="mimetype"/>
......@@ -124,11 +125,13 @@
</target>
<target name="ValidateOutput">
<java jar="./epubcheck-4.0.2/epubcheck.jar" fork="true">
<arg value="${out}/${properFilename}.epub"/>
</java>
</target>
<target name="CleanTmp">
<delete dir="${tmp}" failonerror="false"/>
<delete dir="${tmp}" failonerror="false"/>
</target>
</project>
......@@ -15,6 +15,8 @@
<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>
<h1><xsl:value-of select="header/h1"/></h1>
......@@ -32,6 +34,69 @@
<xsl:apply-templates select="div|section"/>
</xsl:template>
<xsl:template match="h6" priority="3"/>
<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>
</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>
</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>
</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>
</xsl:template>
<xsl:template match="//div[@data-hdoc-type='warning']" priority="4">
<h3 class="warning">
<xsl:if test="h6">
<span class="textTitle"><xsl:value-of select="h6"/></span>
</xsl:if>
<span class="title">Attention</span>
</h3>
<div class="borderWarning">
<xsl:apply-templates/>
</div>
</xsl:template>
<!-- Identity transformation -->
<xsl:template match="node()|@*">
<xsl:copy>
......
......@@ -7,7 +7,9 @@
version="2.0">
<xsl:template name="manifest">
<manifest>
<!-- Table des matières -->
<item id="tDMncx" href="tableDesMatieres.ncx" media-type="application/x-dtbncx+xml"/>
<!-- Chapitre -->
<xsl:for-each select="body/section">
<item>
<xsl:attribute name="href">chapitres/chapitre<xsl:number level="multiple" count="section" format="1"/>.xhtml</xsl:attribute>
......@@ -15,6 +17,14 @@
<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 -->
<!--<xsl:for-each select="collection('../../tmp/retour/oebps/images/')" >
<xsl:element name='file'>
<xsl:value-of select="tokenize(document-uri(.), '/')[last()]"/>
</xsl:element>
</xsl:for-each>-->
</manifest>
</xsl:template>
......
......@@ -22,7 +22,7 @@
</ncx>
</xsl:template>
<xsl:template match="//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>
......@@ -32,7 +32,7 @@
</text>
</navLabel>
<content>
<xsl:attribute name="src">content.html#ch_<xsl:number level="multiple" count="section" format="1_1"/></xsl:attribute>
<xsl:attribute name="src">chapitres/chapitre<xsl:number level="multiple" count="section" format="1_1"/>.xhtml</xsl:attribute>
</content>
<xsl:apply-templates/>
......
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