Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
hdoc
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Stephane Crozat
hdoc
Commits
5f0b0521
Commit
5f0b0521
authored
Dec 11, 2016
by
Baptiste Perraud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update README, main structure of ant script and add of basic xsl files
parent
900a05de
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
99 additions
and
19 deletions
+99
-19
hdoc_to_pdf/README.md
hdoc_to_pdf/README.md
+15
-6
hdoc_to_pdf/hdoc_to_pdf.ant
hdoc_to_pdf/hdoc_to_pdf.ant
+16
-13
hdoc_to_pdf/xsl/find_content.xsl
hdoc_to_pdf/xsl/find_content.xsl
+27
-0
hdoc_to_pdf/xsl/hdoc_flattenizer.xsl
hdoc_to_pdf/xsl/hdoc_flattenizer.xsl
+11
-0
hdoc_to_pdf/xsl/ns_remover.xsl
hdoc_to_pdf/xsl/ns_remover.xsl
+30
-0
No files found.
hdoc_to_pdf/README.md
View file @
5f0b0521
...
...
@@ -13,9 +13,9 @@ http://www.gnu.org/licenses/gpl-3.0.txt
Credits
-------
*
Raphaël Debray
*
Baptiste Perraud
*
2016
-
Raphaël Debray
-
Baptiste Perraud
Dependance
...
...
@@ -37,7 +37,7 @@ Known bugs
Generic Todo
----
----
--------
*
Generate a clean PDF file (using the LaTeX formatting example)
-
Create a default CSS file with basic spine rules
...
...
@@ -51,9 +51,18 @@ Generic Todo
Technical notes
---------------
*
The backlog of the current project is at the following url:
<https://framemo.org/NF29_Opale_to_Pdf>
*
The user stories of the current project are at the following url:
<https://bimestriel.framapad.org/p/NF29_Opale_to_Pdf_userstory>
*
The product backlog of the current project can be found through the following url:
<https://framacalc.org/NF29_Opale_to_Pdf_PB>
*
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
...
...
hdoc_to_pdf/hdoc_to_pdf.ant
View file @
5f0b0521
<?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">
<classpath>
...
...
@@ -8,10 +8,10 @@
</taskdef>-->
<!-- Arguments properties -->
<property
name=
"InputPath"
value
=
"input"
/>
<property
name=
"OutputPath"
value
=
"output"
/>
<property
name=
"InputPath"
location
=
"input"
/>
<property
name=
"OutputPath"
location
=
"output"
/>
<property
name=
"tmp"
location=
"${basedir}/tmp"
/>
<property
name=
"OutputPdfPath"
value
=
"${OutputPath}/result.pdf"
/>
<property
name=
"OutputPdfPath"
location
=
"${OutputPath}/result.pdf"
/>
<target
name=
"convert"
>
...
...
@@ -38,18 +38,21 @@
<!-- Gives all rights to avoid bugs-->
<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 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>-->
<!--launches the ANT xxx to execute the FS/Java script and get a converted PDF file in the output directory-->
<!--TODO-->
<!--temporary files and folders are deleted-->
<!--<delete dir="{tmp}"/>-->
<!--<delete dir="result"/>
<delete file="get_content.ant"/>
<delete file="get_ressources.ant"/>-->
<!--<delete dir="${tmp}"/>-->
<!--<delete file="prepare_hdoc.ant"/>-->
...
...
hdoc_to_pdf/xsl/find_content.xsl
0 → 100644
View file @
5f0b0521
<?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>
hdoc_to_pdf/xsl/hdoc_flattenizer.xsl
0 → 100644
View file @
5f0b0521
<?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>
hdoc_to_pdf/xsl/ns_remover.xsl
0 → 100644
View file @
5f0b0521
<?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>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment