Commit 623bb18c authored by simei.yin's avatar simei.yin
Browse files

Merge branch 'master' of ssh://

Merge before push commit
parents a38f331c a9c3f851
...@@ -18,20 +18,25 @@ Credits ...@@ -18,20 +18,25 @@ Credits
Presentation Presentation
------------ ------------
"Hdoc to Epub" is an hdoc converter to epub files. It's a set of ANT scripts and XSL files
Dependencies Dependencies
------------ ------------
There's no particular dependencies needed to run the converter.
User Documentation User Documentation
------------------ ------------------
### Scenario
La personne possède un hdoc et voudrait le convertir en epub. Il se dirige vers le site hdoc et télécharge le zip. Il extrait le zip et se rend vers le dossier hdoc_to_epub. Il lit le et suit les directives pour obtenir son format epub. Pour cela, il doit coller son hdoc dans le dossier input et lancer l'exécutable "run". Enfin, il aura son epub dans le dossier output.
Unsupported Unsupported
----------- -----------
Known bugs Known bugs
---------- ----------
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- test.ant --> <project name="hdoc_to_epub" basedir="." default="convert">
<property name="p">Default</property> <taskdef resource="net/sf/antcontrib/antlib.xml"/>
<echo message="${p}"/> <taskdef name="jing" classname="com.thaiopensource.relaxng.util.JingTask"/>
<property name="in" location="${basedir}/input"/>
<property name="out" location="${basedir}/output"/>
<property name="tmp" location="${basedir}/tmp"/>
<property name="schema" location="${basedir}/schema"/>
<target name="convert">
<delete dir="${tmp}" failonerror="false"/>
<sleep seconds="1"/>
<mkdir dir="${tmp}"/>
<delete dir="${out}" failonerror="false"/>
<sleep seconds="1"/>
<mkdir dir="${out}"/>
<for param="inputFile">
<fileset dir="${in}" includes="**/*.hdoc"/>
<local name="filename"/>
<basename property="filename" file="@{inputFile}"/>
<antcall target="UnzipHdocFile">
<param name="filename" value="${filename}"/>
<antcall target="ValidateInput">
<param name="filename" value="${filename}"/>
<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. -->
<unzip src="${in}/${filename}" dest="${tmp}/${filename}/decompressedHdoc"/>
<chmod dir="${tmp}/${filename}/decompressedHdoc" perm="777"/>
<!-- Validating the XML container file -->
<target name="ValidateInput">
<trycatch property="foo" reference="bar">
<jing file="${tmp}/${filename}/decompressedHdoc/META-INF/container.xml" rngfile="${schema}/hdoc1-container.rng"></jing>
<echo>Validation failed</echo>
</project> </project>
<?xml version="1.0" encoding="UTF-8"?>
<a:documentation>This schema describes the META-INF/container.xml file for hdoc format</a:documentation>
<a:documentation>This schema is a derivation of
from EPUB Open Container Format (
<element name="container">
<attribute name="version">
<element name="rootfiles">
<element name="rootfile">
<attribute name="full-path">
<data type="anyURI"/>
<attribute name="media-type">
...@@ -2,10 +2,12 @@ ...@@ -2,10 +2,12 @@
<xsl:stylesheet <xsl:stylesheet
xmlns:xsl="" version="2.0" xmlns:xsl="" version="2.0"
xmlns:xs=""> xmlns:xs=""
<xsl:output method="xml" indent="yes"/> xpath-default-namespace="">
<xsl:output method="text" indent="yes"/>
<xsl:template match="html"> <xsl:template match="html">
<Helloworld/> Hello world !
</xsl:template> </xsl:template>
</xsl:stylesheet> </xsl:stylesheet>
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