Commit c853c8cc authored by Aghiles's avatar Aghiles
Browse files

Merge branch 'master' of https://gitlab.utc.fr/crozatst/hdoc

parents 2ea5f2f6 16fe948d
......@@ -20,8 +20,9 @@ Credits
* Thibault DRAIN
* Christophe VIROT
* Pierre Lemaire
* Baptiste PERRAUD
* Raphaël DEBRAY
* 2016 :
* Baptiste PERRAUD
* Raphaël DEBRAY
Dependance
......@@ -35,36 +36,49 @@ This converter is based on two converters :
User documentation
------------------
The folder samples contains a scar file which may be used for some tests.
Follow the steps above to get a pdf file from a scar one:
1. Download hdoc_converter.zip and unzip it.
2. Add your source file into the input folder. It must be a .scar file.
3. Place _only one file_ in that folder.
4. On Linux or Mac, run the script run.sh. On Windows, run the script run.bat.
5. Your file has been converted, the result is in the output folder.
Unsupported
**Warning: on Windows systems, the script may fail due to the lack of writing rights for some folders, try to re-execute it once are twice and it should work (until this bug is solved).**
Unsupported
-----------
Refer to the unsupported elements in Opale to Hdoc and in Hdoc to Pdf.
Refer to the unsupported elements in Opale to Hdoc and in Hdoc to Pdf.
Known bugs
----------
Refer to the known bugs in Opale to Hdoc and in Hdoc to Pdf.
- The windows execution of the run.bat script sometimes fails (problems when we try to remove some folders).
Refer to the known bugs in Opale to Hdoc and in Hdoc to Pdf.
Todo
----
----
Technical notes
---------------
* This converter works with _only one_ hdoc file in the input folder at the moment, please ensure to clean the folder before proceeding with the hdoc you want to convert to PDF. When the multifiles ability is set within the hdoc_to_pdf converter, the opale_to_pdf one shall naturally work because it already implements the opale_to_hdoc multifiles handling (the copy of all the hdoc results into the input directory of the hdoc_to_pdf converter).
The converter contains 1 file:
* opale_to_pdf.ant
It checks wether or not the user specified the parameters and performs the following :
* Copy the input file in the opale_to_hdoc directory.
It checks whether the user specified or not the parameters and performs the following :
* Copy the input files in the opale_to_hdoc directory.
* Perform the opale_to_hdoc transformation.
* Copy the result in the hdoc_to_pdf directory.
* Perform the hdoc_to_pdf transformation.
* Copy the result in the opale_to_pdf directory.
* Copy the results in the hdoc_to_pdf directory.
* Perform the hdoc_to_pdf transformation.
* Copy the results in the opale_to_pdf directory.
Capitalisation
......
......@@ -5,7 +5,7 @@
<pathelement location="lib/ant-contrib.jar" />
</classpath>
</taskdef>
<!-- Arguments properties -->
<property name="DocType" value="paper" />
<property name="Source" value="none" />
......@@ -13,19 +13,19 @@
<!-- Beginning -->
<target name="convert">
<antcall target="clean_everything" />
<antcall target="clean_everything" />
<antcall target="opale_to_hdoc" />
<antcall target="hdoc_to_pdf" />
<antcall target="copy_pdf_output" />
</target>
<target name="clean_everything">
<delete dir="../opale_to_hdoc/input"/>
<delete dir="../opale_to_hdoc/output/result.hdoc"/>
<delete dir="../hdoc_to_pdf/input"/>
<delete dir="../hdoc_to_pdf/output/result.pdf"/>
</target>
<target name="opale_to_hdoc">
<!--Check wether there is an input using command line or not-->
......@@ -33,41 +33,60 @@
<equals arg1="${Source}" arg2="none" />
<then>
<!--There is no input, check the input folder-->
<echo message="The value of property InputFile is ${Source} ... Checking the input folder" />
<echo message="The value of property DocType is ${DocType}" />
<!-- get input hdoc file path -->
<!--
<fileset id="fileset_scar" dir="${InputPath}" casesensitive="yes">
<include name="*.scar"/>
</fileset>
<pathconvert property="ScarFile" pathsep="" refid="fileset_scar" />
<copy tofile="../opale_to_hdoc/input/sample.scar" file="${ScarFile}"/>
<ant antfile="../opale_to_hdoc/opale_to_hdoc.ant" inheritAll="false"/>
-->
<copy todir="../opale_to_hdoc/input">
<fileset dir="${InputPath}" casesensitive="yes">
<include name="*.scar"/>
</fileset>
</copy>
<!--<copy tofile="../opale_to_hdoc/input/sample.scar" file="${ScarFile}"/>-->
<ant antfile="../opale_to_hdoc/opale_to_hdoc.ant" inheritAll="false"/>
</then>
<else>
<!--There is an input-->
<echo message="The value of property Source is ${Source}" />
<echo message="The value of property DocType is ${DocType}" />
<echo message="Executing conversion..." />
<copy tofile="../opale_to_hdoc/input/sample.scar" file="${Source}"/>
<ant antfile="../opale_to_hdoc/opale_to_hdoc.ant" inheritAll="false"/>
<ant antfile="../opale_to_hdoc/opale_to_hdoc.ant" inheritAll="false"/>
</else>
</if>
</if>
</target>
<target name="hdoc_to_pdf">
<copy tofile="../hdoc_to_pdf/input/sample.hdoc" file="../opale_to_hdoc/output/result.hdoc"/>
<!--<copy tofile="../hdoc_to_pdf/input/sample.hdoc" file="../opale_to_hdoc/output/result.hdoc"/>-->
<copy todir="../hdoc_to_pdf/input">
<fileset dir="../opale_to_hdoc/output" casesensitive="yes">
<include name="*.hdoc"/>
</fileset>
</copy>
<ant antfile="../hdoc_to_pdf/hdoc_to_pdf.ant" inheritAll="false">
<property name="DocType" value="${DocType}"/>
</ant>
</target>
<target name="copy_pdf_output">
<copy tofile="output/result.pdf" file="../hdoc_to_pdf/output/result.pdf"/>
<!--<copy tofile="output/result.pdf" file="../hdoc_to_pdf/output/result.pdf"/>-->
<copy todir="output">
<fileset dir="../hdoc_to_pdf/output" casesensitive="yes">
<include name="*.pdf"/>
</fileset>
</copy>
</target>
</project>
</project>
......@@ -29,6 +29,9 @@
<value>activity</value>
<value>aims</value>
<value>synthesis</value>
<value>order</value>
<value>match</value>
<value>group</value>
</choice>
</attribute>
</optional>
......@@ -60,6 +63,9 @@
<value>explanation-choice-incorrect</value>
<value>openQuestion</value>
<value>hint</value>
<value>gapText</value>
<value>label</value>
<value>target</value>
</choice>
</attribute>
</optional>
......
......@@ -8,7 +8,7 @@
<basename property="filename" file="${inputFile}" suffix=".xml"/>
<!-- Path -->
<property name="resultPath" value="${basedir}/result"/>
<property name="resultPath" value="${basedir}/output"/>
<property name="hdoc_to_canoprof" location="${basedir}/../hdoc_to_canoprof"/>
<target name="main">
......
......@@ -2,7 +2,7 @@
<project name="wikiToCanoprof" default="main" basedir="..">
<!-- Path -->
<property name="resultPath" value="${basedir}/result"/>
<property name="resultPath" value="${basedir}/output"/>
<property name="hdoc_to_canoprof" location="${basedir}/../hdoc_to_canoprof"/>
<target name="main">
......
......@@ -89,7 +89,7 @@
select="following-sibling::*[starts-with(name(), 'h')][1]"/>
<xsl:apply-templates
select="following-sibling::div[contains(@class,'thumb tleft') or contains(@class,'thumb tright')] intersect $nextTitle/preceding-sibling::*"/>
select="following-sibling::div[contains(@class,'thumb tleft') or contains(@class,'thumb tright') and not(descendant::img)] intersect $nextTitle/preceding-sibling::*"/>
<!-- <xsl:apply-templates select="following-sibling::p/img"/>-->
<!-- If there is text right below the section name, copy it -->
......
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