Commit 93ba4a5d authored by Baptiste Montange's avatar Baptiste Montange

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

parents e80a9492 ae24c451
......@@ -29,6 +29,7 @@ User documentation
------------------
There are two different ways to use the converter hdoc_to_pdf: by running a script run.bat/run.sh or by command line using a terminal (allows the user to specify some parameters).
The folder samples contains a hdoc file which may be used for some tests.
#### Running the script run.bat/run.sh:
......@@ -65,8 +66,9 @@ Known bugs
* Nested ul in ol are sometimes converted to ol.
* It seems that FS doesn't support the max-width for img tags, which makes proper scaling harder.
* ToC lines rendering is sometimes ugly if the title label is too long.
* ToC lines rendering is sometimes ugly if the title label is too long: dotted leader or even page number may appear on the following line, sometimes colliding between themselves.
* Inline elements like em cause bad paragraphs justification.
* Sometimes, they are unwanted page breaks after a heading.
Generic Todo
------------
......@@ -80,20 +82,41 @@ Generic Todo
* Manage container.xml and content.xml validations using jing as jing task can't be handled with opale_to_pdf.ant call.
* Bonus: find out a HTML editor to manually add line breaks to a hdoc file in order to resolve widows and girl orphans problems after the PDF file's generation
Specific Todo list
------------------
* Gestion du bug d'espace qui apparaît après un lien.
* Ajouter le paramètre de reliure ("bound") au script ant
* Intégrer les styles CSS selon le paramètre "bound" dans un xsl
* Ajouter le paramètre de recto-verso au script ant
* Intégrer les styles CSS selon le paramètre recto-verso dans un xsl
* Ajout le support des marges pour documents oneside reliés
* Ajout le support des marges pour documents twoside reliés
* Identifier les règles CSS principales de traitement des tableaux
* Gérer les espacements veuves/o. pour les paragraphes
* Gérer les espacements veuves/o. pour les listes
* Gérer les espacements veuves/o. pour les tableaux
* Gérer les espacements veuves/o. pour les images
* Support des objets : ajouter une consigne dans le README de convertir tout objet graphique (odg, etc.) en image avant l'exécution
* Support des objets : ajouter des règles xsl de transformation des <object> en <img>
* Permettre à l'utilisateur de surcharger les règles CSS selon les règles logiques de la mise en page par défaut
Technical notes
---------------
* This converter works with _only one_ hdoc file in the input folder, please ensure to clean the folder before proceeding with the hdoc you want to convert to PDF.
* 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).
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.
* Cas d'un fichier hdoc à convertir :
* 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
......
......@@ -45,14 +45,21 @@
@bottom-center { content: counter(page) }
}
body {
html, body {
padding: 0;
margin: 0;
height: auto;
}
* {
font-family: "CMU Serif";
}
a {
text-decoration: none;
color: black;
}
p {
text-align: justify;
text-indent: 2em;
......@@ -62,6 +69,8 @@ p {
word-break: normal;
}
span[data-hdoc-type="syntax"] {font-family: "CMU Typewriter Text"}
h1 {font-size: 2em}
h2 {font-size: 1.6em}
h3 {font-size: 1.4em}
......@@ -77,26 +86,11 @@ h6 {font-style: italic}
body {counter-reset: h2}
h2 {counter-reset: h3}
h3 {counter-reset: h4}
/*
h4 {counter-reset: h5}
h5 {counter-reset: h6}
*/
h2::before {counter-increment: h2; content: counter(h2) ".\0000a0\0000a0"}
h3::before {counter-increment: h3; content: counter(h2) "." counter(h3) ".\0000a0\0000a0"}
h4::before {counter-increment: h4; content: counter(h2) "." counter(h3) "." counter(h4) ".\0000a0\0000a0"}
/*
h5::before {counter-increment: h5; content: counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) ".\0000a0\0000a0"}
h6::before {counter-increment: h6; content: counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) "." counter(h6) ".\0000a0\0000a0"}
*/
/*
h2.nocount:before,
h3.nocount:before,
h4.nocount:before,
h5.nocount:before,
h6.nocount:before { content: ""; counter-increment: none }
*/
h2.nocount:before,
h3.nocount:before,
h4.nocount:before { content: ""; counter-increment: none }
......@@ -146,27 +140,27 @@ ul.toc > li {
ul.toc > li::before {
left: 0;
position: absolute;
content: counters(toc, ".") ". ";
content: counters(toc, ".") "\A0";
counter-increment: toc;
}
ul.toc.level2 > li {padding-left: 8mm;}
ul.toc.level3 > li {padding-left: 11mm;}
ul.toc.level4 > li {padding-left: 13mm;}
ul.toc.level5 > li {padding-left: 15mm;}
ul.toc.level6 > li {padding-left: 17mm;}
ul.toc > li > a::after {
content: leader(dotted);
text-decoration: none;
color: black;
ul.toc.level2 > li {
padding-left: 8mm;
font-family: "CMU Serif Extra";
}
ul.toc.level3 > li {padding-left: 11mm}
ul.toc.level4 > li {padding-left: 13mm}
ul.toc.level3 > li > a::after, ul.toc.level4 > li > a::after {content: leader(dotted)}
ul.toc > li > span {
position: absolute;
right: -10mm;
}
ul.toc.level2 > li > span {font-family: "CMU Serif Extra"}
ul.toc > li > span::after {
content: target-counter(attr(href), page);
}
......
......@@ -47,10 +47,10 @@
</xsl:if>
</xsl:template>
<!-- Cleaning des footers vides -->
<xsl:template match="footer[not(node())]"/>
<xsl:template match="div[@data-hdoc-type='tags']"/>
<!-- Gestion de la table des matières -->
......
......@@ -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,45 @@ 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
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.
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>
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