Commit 075785b5 authored by cliclac's avatar cliclac

Modification nom dossier : epub2

opale_to_epub2
parent 045926f8
...@@ -155,7 +155,7 @@ ...@@ -155,7 +155,7 @@
</target> </target>
<target name="CleanTmp"> <target name="CleanTmp">
<!--<delete dir="${tmp}" failonerror="false"/>--> <delete dir="${tmp}" failonerror="false"/>
</target> </target>
</project> </project>
@echo off @echo off
set lib=lib set lib=lib
set ant=hdoc_to_epub.ant set ant=hdoc_to_epub2.ant
set antparam=-Dprogram.param=%1 set antparam=-Dprogram.param=%1
set scJarList=%lib%\* set scJarList=%lib%\*
......
#!/bin/sh #!/bin/sh
lib="lib" lib="lib"
ant="hdoc_to_epub.ant" ant="hdoc_to_epub2.ant"
antparam="-Dprogram.param=$1" antparam="-Dprogram.param=$1"
#Recherche de java et controle que se soit une version SUN #Recherche de java et controle que se soit une version SUN
......
...@@ -56,9 +56,12 @@ ...@@ -56,9 +56,12 @@
</html> </html>
</xsl:result-document> </xsl:result-document>
</xsl:template> </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:if test="section[@data-hdoc-type='exercise']">
Exercice :
</xsl:if>
<xsl:value-of select="header/h1"/> <xsl:value-of select="header/h1"/>
</xsl:element> </xsl:element>
<xsl:apply-templates select="div|section"/> <xsl:apply-templates select="div|section"/>
...@@ -162,6 +165,33 @@ ...@@ -162,6 +165,33 @@
</div> </div>
</xsl:template> </xsl:template>
<xsl:template match="//div[@data-hdoc-type='description']" priority="4">
<h4>
Description :
</h4>
<div>
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template match="//div[@data-hdoc-type='question']" priority="4">
<h4>
Question :
</h4>
<div>
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template match="//div[@data-hdoc-type='solution']" priority="4">
<h4>
Solution :
</h4>
<div>
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template match="//span[@data-hdoc-type='syntax']" priority="4"> <xsl:template match="//span[@data-hdoc-type='syntax']" priority="4">
<span class="bold"><xsl:value-of select="."/></span> <span class="bold"><xsl:value-of select="."/></span>
</xsl:template> </xsl:template>
......
...@@ -8,6 +8,9 @@ ...@@ -8,6 +8,9 @@
<xsl:template name="metadata"> <xsl:template name="metadata">
<metadata xmlns:dc="http://purl.org/dc/elements/1.1/"> <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
<dc:title><xsl:value-of select="head/title"/></dc:title> <dc:title><xsl:value-of select="head/title"/></dc:title>
<xsl:for-each select="head/meta[@name='keywords']">
<dc:subject><xsl:value-of select="."/></dc:subject>
</xsl:for-each>
<dc:creator><xsl:value-of select="head/meta[@name='author']/@content"/></dc:creator> <dc:creator><xsl:value-of select="head/meta[@name='author']/@content"/></dc:creator>
<dc:language>fr</dc:language> <dc:language>fr</dc:language>
<dc:identifier id="BookID">V2.0</dc:identifier> <dc:identifier id="BookID">V2.0</dc:identifier>
......
Hdoc to Epub
------------
License
-------
http://www.gnu.org/licenses/gpl-3.0.txt
Credits
-------
### Autumn 2016
* Biagianti Marie
* Couturier Valentin
Presentation
------------
"Opale to Epub2" is an opale converter to epub2 files. It's a set of ANT scripts and XSL files
Dependencies
------------
There's no particular dependencies needed to run the converter.
User Documentation
------------------
### Scenario
Supported
---------
Image : JPEG, JPG, PNG
Gestion du multifichiers en input
Hypertexte
Unsupported
-----------
### EPUB2
ODG : non supporté en EPUB => "Élément non supporté en EPUB : <xsl:value-of select="@data"/>"
CSS3
HTML5
SVG
(voir https://mpsltd.wordpress.com/2011/05/25/epub-3-vs-epub-2-0-2/)
### Conversion
Exercices
Méthode et Rappels (data-hdoc-type)
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
---------
tester avec SVG
Repérer le problème avec le css
Faire l'affichage des exercices
Faire l'affichage des nouveaux types : Méthode et Rappels
Technical Notes
---------------
Il est déconseillé de justifier le texte pour des raisons de lisibilité sur les liseuses.
input=${basedir}/input
output=${basedir}/output
inputOpaleToHdoc=${basedir}/../opale_to_hdoc/input
outputOpaleToHdoc=${basedir}/../opale_to_hdoc/output
antOpaleToHdoc=${basedir}/../opale_to_hdoc/opale_to_hdoc.ant
inputHdocToEpub2=${basedir}/../hdoc_to_epub2/input
outputHdocToEpub2=${basedir}/../hdoc_to_epub2/output
antHdocToEpub2=${basedir}/../hdoc_to_epub2/hdoc_to_epub2.ant
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project name="hdoc_to_epub2" basedir="." default="preparation">
<taskdef resource="net/sf/antcontrib/antlib.xml"/>
<taskdef name="jing" classname="com.thaiopensource.relaxng.util.JingTask"/>
<property file="build.properties"/>
<target name="preparation">
<delete>
<fileset dir="${inputOpaleToHdoc}" includes="**/*.scar"/>
</delete>
<delete>
<fileset dir="${inputHdocToEpub2}" includes="**/*.hdoc"/>
</delete>
<delete dir="${output}"/>
<mkdir dir="${output}"/>
<chmod perm="777" dir="${output}"></chmod>
<sequential>
<antcall target="opaleToHdoc">
<param name="filename" value="${filename}"/>
</antcall>
<antcall target="hdocToEpub2">
<param name="filename" value="${filename}"/>
</antcall>
<antcall target="opaleToEpub2">
<param name="filename" value="${filename}"/>
</antcall>
</sequential>
</target>
<target name="opaleToHdoc">
<copy todir="${inputOpaleToHdoc}" >
<fileset dir="${input}" includes="**/*.scar"/>
</copy>
<ant antfile="${antOpaleToHdoc}" inheritAll="false"/>
</target>
<target name="hdocToEpub2">
<copy todir="${inputHdocToEpub2}" >
<fileset dir="${outputOpaleToHdoc}" includes="**/*.hdoc"/>
</copy>
<ant antfile="${antHdocToEpub2}" inheritAll="false"/>
</target>
<target name="opaleToEpub2">
<copy todir="${output}" >
<fileset dir="${outputHdocToEpub2}" includes="**/*.epub"/>
</copy>
</target>
</project>
@echo off
set lib=lib
set ant=opale_to_epub2.ant
set antparam=-Dprogram.param=%1
set scJarList=%lib%\*
java.exe -classpath "%scJarList%" -Xmx150m org.apache.tools.ant.Main -buildfile %ant% %antparam%
pause
REM start /MIN java.exe -classpath "%scJarList%" -Xmx150m org.apache.tools.ant.Main -buildfile %ant% %antparam%
#!/bin/sh
lib="lib"
ant="opale_to_epub2.ant"
antparam="-Dprogram.param=$1"
#Recherche de java et controle que se soit une version SUN
vJavaCmd="java"
xCheckJava () {
vInputVarName=\$"$1"
vInputVarVal=`eval "expr \"$vInputVarName\" "`
if [ -z "$vInputVarVal" ];then
eval "$1=false"
return
fi
vSunJavaFound=`$vInputVarVal -version 2>&1 | grep -Eo -m 1 "(HotSpot)|(OpenJDK)"`
if [ "$vSunJavaFound" != "HotSpot" ] && [ "$vSunJavaFound" != "OpenJDK" ] ; then
eval "$1=false"
return
fi
}
xCheckJava vJavaCmd
if [ "$vJavaCmd" = "false" ]; then
vJavaCmd="$JAVA_HOME/bin/java"
xCheckJava vJavaCmd
if [ "$vJavaCmd" = "false" ]; then
echo "ERREUR: JRE de SUN introuvable. Veuillez déclarer la variable d'environnement JAVA_HOME."
exit 1
fi
fi
#Lancer la commande
scJarList="$lib/*"
$vJavaCmd -classpath "$scJarList:" -Xmx150m org.apache.tools.ant.Main -buildfile $ant $antparam
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