Commit 5f0b0521 authored by Baptiste Perraud's avatar Baptiste Perraud

Update README, main structure of ant script and add of basic xsl files

parent 900a05de
...@@ -13,9 +13,9 @@ http://www.gnu.org/licenses/gpl-3.0.txt ...@@ -13,9 +13,9 @@ http://www.gnu.org/licenses/gpl-3.0.txt
Credits Credits
------- -------
* Raphaël Debray * 2016
- Raphaël Debray
* Baptiste Perraud - Baptiste Perraud
Dependance Dependance
...@@ -37,7 +37,7 @@ Known bugs ...@@ -37,7 +37,7 @@ Known bugs
Generic Todo Generic Todo
---- ------------
* Generate a clean PDF file (using the LaTeX formatting example) * Generate a clean PDF file (using the LaTeX formatting example)
- Create a default CSS file with basic spine rules - Create a default CSS file with basic spine rules
...@@ -51,9 +51,18 @@ Generic Todo ...@@ -51,9 +51,18 @@ Generic Todo
Technical notes Technical notes
--------------- ---------------
* The backlog of the current project is at the following url: <https://framemo.org/NF29_Opale_to_Pdf> * The product backlog of the current project can be found through the following url: <https://framacalc.org/NF29_Opale_to_Pdf_PB>
* The user stories of the current project are at the following url: <https://bimestriel.framapad.org/p/NF29_Opale_to_Pdf_userstory> * Time-sheets can be found through the following urls:
- <https://framacalc.org/NF29_Opale_to_Pdf_fichetemps_PERRAUD>
User Story
----------
* L'utilisateur dispose d'un fichier hdoc en entrée, il veut obtenir un fichier pdf paginé en sortie.
* Il accède au convertisseur (dossier dédié) hdoc_to_pdf.
* Il place le fichier hdoc dans le dossier input.
* Il lance le script run.bat/run.sh ou exécute directement le script ant hdoc_to_pdf.ant.
* Il récupère le fichier pdf dans le dossier output.
Capitalisation Capitalisation
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project name="hdoc_to_opale" basedir="." default="convert"> <project name="hdoc_to_pdf" basedir="." default="convert">
<!--<taskdef resource="net/sf/antcontrib/antcontrib.properties"> <!--<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath> <classpath>
...@@ -8,10 +8,10 @@ ...@@ -8,10 +8,10 @@
</taskdef>--> </taskdef>-->
<!-- Arguments properties --> <!-- Arguments properties -->
<property name="InputPath" value="input" /> <property name="InputPath" location="input" />
<property name="OutputPath" value="output" /> <property name="OutputPath" location="output" />
<property name="tmp" location="${basedir}/tmp"/> <property name="tmp" location="${basedir}/tmp"/>
<property name="OutputPdfPath" value="${OutputPath}/result.pdf" /> <property name="OutputPdfPath" location="${OutputPath}/result.pdf" />
<target name="convert"> <target name="convert">
...@@ -38,18 +38,21 @@ ...@@ -38,18 +38,21 @@
<!-- Gives all rights to avoid bugs--> <!-- Gives all rights to avoid bugs-->
<chmod dir="${tmp}" perm="777"/> <chmod dir="${tmp}" perm="777"/>
<!--launches the XSLT find_content to retrieve the content path-->
<xslt in="${tmp}/META-INF/container.xml" out="prepare_hdoc.ant" style="xsl/find_content.xsl">
<param name="TempRepository" expression="${tmp}"/>
</xslt>
<chmod file="prepare_hdoc.ant" perm="777"/>
<!--launches the ANT prepare_hdoc.ant resulting from the previous XSLT in order to get a clean xhtml ready for the pdf conversion -->
<ant antfile="prepare_hdoc.ant"/>
<!--launches the ANT xxx to execute the FS/Java script and get a converted PDF file in the output directory-->
<!--TODO-->
<!--launches the XSLT find_content to retrieve the content path-->
<!--<xslt in="${tmp}/META-INF/container.xml" out="get_content.ant" style="xsl/find_content.xsl">
<param name="DocumentType" expression="${DocType}"/>
</xslt>-->
<!--temporary files and folders are deleted--> <!--temporary files and folders are deleted-->
<!--<delete dir="{tmp}"/>--> <!--<delete dir="${tmp}"/>-->
<!--<delete dir="result"/> <!--<delete file="prepare_hdoc.ant"/>-->
<delete file="get_content.ant"/>
<delete file="get_ressources.ant"/>-->
......
<?xml version="1.0" encoding="UTF-8"?>
<!--find_content.xsl creates a ANT file prepare_hdoc.ant-->
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
xmlns:h="urn:utc.fr:ics:hdoc:container"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xsl:param name="TempRepository" required="yes" as="xs:string"/>
<xsl:output method="xml" indent="yes"/>
<xsl:template match="h:container">
<project name="hdoc_to_pdf" default="main">
<target name="main">
<xsl:apply-templates/>
</target>
</project>
</xsl:template>
<xsl:template match="h:rootfiles">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="h:rootfile">
<xsl:variable name="path" select="@full-path"/>
<xslt in="{$TempRepository}/{$path}" out="{$TempRepository}/hdoc_nsless.xhtml" style="xsl/ns_remover.xsl"/>
<xslt in="{$TempRepository}/hdoc_nsless.xhtml" out="{$TempRepository}/flat_hdoc.xhtml" style="xsl/hdoc_flattenizer.xsl"/>
</xsl:template>
</xsl:stylesheet>
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="html">
<Helloworld/>
</xsl:template>
</xsl:stylesheet>
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xpath-default-namespace="http://www.utc.fr/ics/hdoc/xhtml"
xmlns="http://www.w3.org/1999/xhtml"
>
<xsl:output method="xml" indent="yes"/>
<!-- Identity transformation -->
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<!-- Namespace substitution for hdoc elements -->
<xsl:template match="*" priority="1">
<xsl:element name="{local-name()}">
<xsl:apply-templates select="node()|@*"/>
</xsl:element>
</xsl:template>
<!-- Suppress processing-instructions -->
<xsl:template match="processing-instruction()" priority="1"/>
</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