Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Stephane Crozat
hdoc
Commits
504a266b
Commit
504a266b
authored
Dec 08, 2015
by
Ivan D'halluin
Browse files
fix url /optim and allow multiple scar at a time, need to be tested
parent
d2db9473
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
optim_to_hdoc/input/.wspmeta
deleted
100644 → 0
View file @
d2db9473
This diff is collapsed.
Click to expand it.
optim_to_hdoc/myantce.ant
View file @
504a266b
<?xml version="1.0" encoding="UTF-8"?>
<project
basedir=
"."
name=
"myantce"
>
<property
name=
"in"
location=
"${basedir}/input"
/>
<property
name=
"out"
location=
"${basedir}/output"
/>
<property
name=
"tmp"
location=
"${basedir}/tmp"
/>
<property
name=
"xsl"
location=
"${basedir}/xsl"
/>
<taskdef
resource=
"net/sf/antcontrib/antlib.xml"
/>
<property
name=
"in"
location=
"${basedir}/input"
/>
<property
name=
"out"
location=
"${basedir}/output"
/>
<property
name=
"tmp"
location=
"${basedir}/tmp"
/>
<property
name=
"xsl"
location=
"${basedir}/xsl"
/>
<property
name=
"lib"
location=
"${basedir}/lib"
/>
<property
name=
"log"
location=
"${basedir}/log"
/>
<delete
dir=
"${tmp}"
failonerror=
"false"
/>
<mkdir
dir=
"${tmp}"
/>
<delete
dir=
"${out}"
failonerror=
"false"
/>
<mkdir
dir=
"${out}"
/>
<delete
dir=
"${log}"
failonerror=
"false"
/>
<mkdir
dir=
"${log}"
/>
<mkdir
dir=
"${tmp}/extract"
/>
<mkdir
dir=
"${tmp}/internationalisation"
/>
<echo
message=
"Extract files..."
/>
<unzip
dest=
"${tmp}/extract"
>
<fileset
dir=
"${in}"
>
<include
name=
"**/*.scar"
/>
</fileset>
</unzip>
<echo
message=
"Internationalize files..."
/>
<property
name=
"lib"
location=
"${basedir}/lib"
/>
<property
name=
"log"
location=
"${basedir}/log"
/>
<delete
dir=
"${tmp}"
failonerror=
"false"
/>
<mkdir
dir=
"${tmp}"
/>
<delete
dir=
"${out}"
failonerror=
"false"
/>
<mkdir
dir=
"${out}"
/>
<delete
dir=
"${log}"
failonerror=
"false"
/>
<mkdir
dir=
"${log}"
/>
<mkdir
dir=
"${tmp}/extract"
/>
<mkdir
dir=
"${tmp}/internationalisation"
/>
<echo
message=
"Extract files..."
/>
<for
param=
"archive"
>
<path>
<fileset
dir=
"${in}"
includes=
"*"
/>
</path>
<sequential>
<echo
message=
"@{archive}"
></echo>
<unzip
src=
"@{archive}"
dest=
"${tmp}/extract"
></unzip>
</sequential>
</for>
<echo
message=
"Internationalize files..."
/>
<xslt
useImplicitFileset=
"false"
destdir=
"${tmp}/internationalisation"
style=
"${xsl}/internalisation.xsl"
>
<param
name=
"currentDir"
expression=
"${basedir}"
/>
<fileset
dir=
"${tmp}/extract"
>
<include
name=
"*/*"
/>
<!-- only converting the root files, not the ressources of subfolders -->
</fileset>
</xslt>
<xslt
useImplicitFileset=
"false"
destdir=
"${tmp}/internationalisation"
style=
"${xsl}/internalisation.xsl"
>
<param
name=
"currentDir"
expression=
"."
/>
<fileset
dir=
"${tmp}/extract"
>
<!-- only converting the root files -->
<include
name=
"*/*.paper"
/>
<include
name=
"*/*.section"
/>
<include
name=
"*/*.website"
/>
<include
name=
"*/*.slideshow"
/>
<include
name=
"*/*.webpage"
/>
</fileset>
</xslt>
<echo
message=
"Convert to hdoc..."
/>
<xslt
basedir=
"${tmp}/internationalisation"
destdir=
"${out}"
style=
"${xsl}/optim_to_hdoc.xsl"
/>
<echo
message=
"Convert to hdoc..."
/>
<xslt
basedir=
"${tmp}/internationalisation"
destdir=
"${out}"
style=
"${xsl}/optim_to_hdoc.xsl"
/>
<echo
message=
"Copy ressources files..."
/>
<echo
message=
"Copy ressources files..."
/>
<copy
todir=
"${out}"
>
<fileset
dir=
"${tmp}/extract"
>
<exclude
name=
"*/*"
/>
<!-- only copying resources files -->
</fileset>
</copy>
<echo
message=
"Zip result..."
/>
<antcall
target=
"createApplicationDAA"
/>
<target
name=
"createApplicationDAA"
>
<for
param=
"folder"
>
<path>
<fileset
dir=
"${out}/*"
/>
</path>
<sequential>
<echo>
@{folder}
</echo>
<zip
basedir=
"${folder}"
destfile=
"${folder}.zip"
>
</zip>
</sequential>
</for>
</target>
<copy
todir=
"${out}"
>
<fileset
dir=
"${tmp}/extract"
>
<!-- only copying resources files -->
<exclude
name=
"*/*.paper"
/>
<exclude
name=
"*/*.section"
/>
<exclude
name=
"*/*.website"
/>
<exclude
name=
"*/*.slideshow"
/>
<exclude
name=
"*/*.webpage"
/>
</fileset>
</copy>
<echo
message=
"Zip result..."
/>
<for
param=
"folder"
>
<path>
<dirset
dir=
"${out}"
includes=
"*"
/>
</path>
<sequential>
<local
name=
"folder_name"
/>
<basename
property=
"folder_name"
file=
"@{folder}"
/>
<zip
destfile=
"${out}/${folder_name}.zip"
basedir=
"@{folder}"
></zip>
</sequential>
</for>
</project>
\ No newline at end of file
optim_to_hdoc/output/02hdocConverterPortal/demo.html
deleted
100644 → 0
View file @
d2db9473
<?xml version="1.0" encoding="UTF-8"?>
<?oxygen RNGSchema="http://scenari.utc.fr/hdoc/schemas/xhtml/hdoc1-xhtml.rng" type="xml"
?>
<html
xmlns:of=
"scpf.org:office"
xmlns:sp=
"http://www.utc.fr/ics/scenari/v3/primitive"
xmlns:sc=
"http://www.utc.fr/ics/scenari/v3/core"
xmlns=
"http://www.utc.fr/ics/hdoc/xhtml"
>
<head>
<title>
Hdoc Converter Portal (v0.2) Demo
</title>
<meta
charset=
"utf-8"
/>
<meta
name=
"author"
content=
""
/>
</head>
<body>
<div>
<h6>
Hdoc Converter Portal (v0.2) Demo
</h6>
<img
src=
"optim//home/ivan/Downloads/projets/hdoc/optim_to_hdoc/re/screen1.png/screen1.png"
alt=
""
/>
<img
src=
"optim//home/ivan/Downloads/projets/hdoc/optim_to_hdoc/re/screen2.png/screen2.png"
alt=
""
/>
</div>
</body>
</html>
optim_to_hdoc/output/02hdocConverterPortal/hdocConverter.html
View file @
504a266b
...
...
@@ -32,10 +32,8 @@
<h6>
Hdoc Converter Portal (v0.2) Demo
</h6>
<img
src=
"optim//home/ivan/Downloads/projets/hdoc/optim_to_hdoc/re/screen1.png/screen1.png"
alt=
""
/>
<img
src=
"optim//home/ivan/Downloads/projets/hdoc/optim_to_hdoc/re/screen2.png/screen2.png"
alt=
""
/>
<img
src=
"./re/screen1.png/screen1.png"
alt=
""
/>
<img
src=
"./re/screen2.png/screen2.png"
alt=
""
/>
</div>
</section>
...
...
@@ -49,7 +47,7 @@
<div>
<h6>
Code
</h6>
<p>
<a
href=
"
optim//home/ivan/Downloads/projets/hdoc/optim_to_hdoc
/re/hdoc_converter.zip/hdoc_converter.zip"
>
hdoc_converter.zip
</a>
<a
href=
"
.
/re/hdoc_converter.zip/hdoc_converter.zip"
>
hdoc_converter.zip
</a>
</p>
</div>
...
...
optim_to_hdoc/tmp/internationalisation/02hdocConverterPortal/demo.html
deleted
100644 → 0
View file @
d2db9473
<?xml version="1.0" encoding="UTF-8"?>
<sc:item
xmlns:sc=
"http://www.utc.fr/ics/scenari/v3/core"
>
<of:gallery
xmlns:of=
"scpf.org:office"
xmlns:sp=
"http://www.utc.fr/ics/scenari/v3/primitive"
>
<of:galleryM>
<sp:title>
Hdoc Converter Portal (v0.2) Demo
</sp:title>
</of:galleryM>
<sp:img
xmlns=
"http://www.utc.fr/ics/hdoc/xhtml"
role=
"ref"
sc:refUri=
"/home/ivan/Downloads/projets/hdoc/optim_to_hdoc/re/screen1.png"
/>
<sp:img
xmlns=
"http://www.utc.fr/ics/hdoc/xhtml"
role=
"ref"
sc:refUri=
"/home/ivan/Downloads/projets/hdoc/optim_to_hdoc/re/screen2.png"
/>
</of:gallery>
</sc:item>
optim_to_hdoc/tmp/internationalisation/02hdocConverterPortal/hdocConverter.html
View file @
504a266b
...
...
@@ -36,10 +36,10 @@
</of:galleryM>
<sp:img
xmlns=
"http://www.utc.fr/ics/hdoc/xhtml"
role=
"ref"
sc:refUri=
"
/home/ivan/Downloads/projets/hdoc/optim_to_hdoc
/re/screen1.png"
/>
sc:refUri=
"
.
/re/screen1.png"
/>
<sp:img
xmlns=
"http://www.utc.fr/ics/hdoc/xhtml"
role=
"ref"
sc:refUri=
"
/home/ivan/Downloads/projets/hdoc/optim_to_hdoc
/re/screen2.png"
/>
sc:refUri=
"
.
/re/screen2.png"
/>
</of:gallery>
</of:fragment>
</sp:content>
...
...
@@ -61,7 +61,7 @@
<of:flow>
<sp:txt>
<of:txt>
<sc:para
xml:space=
"preserve"
sc:id=
"t42"
>
<!--sc:uLink src =
/home/ivan/Downloads/projets/hdoc/optim_to_hdoc
/ refUri = re/hdoc_converter.zip-->
<sc:uLink
xmlns=
"http://www.utc.fr/ics/hdoc/xhtml"
role=
"ref"
sc:refUri=
"
/home/ivan/Downloads/projets/hdoc/optim_to_hdoc
/re/hdoc_converter.zip"
>
hdoc_converter.zip
</sc:uLink></sc:para>
<sc:para
xml:space=
"preserve"
sc:id=
"t42"
>
<!--sc:uLink src =
.
/ refUri = re/hdoc_converter.zip-->
<sc:uLink
xmlns=
"http://www.utc.fr/ics/hdoc/xhtml"
role=
"ref"
sc:refUri=
"
.
/re/hdoc_converter.zip"
>
hdoc_converter.zip
</sc:uLink></sc:para>
</of:txt>
</sp:txt>
</of:flow>
...
...
optim_to_hdoc/xsl/optim_to_hdoc.xsl
View file @
504a266b
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
version=
"1.0"
xmlns:xsl=
"http://www.w3.org/1999/XSL/Transform"
xmlns:xsl=
"http://www.w3.org/1999/XSL/Transform"
xmlns:of=
"scpf.org:office"
xmlns:sp=
"http://www.utc.fr/ics/scenari/v3/primitive"
xmlns:sc=
"http://www.utc.fr/ics/scenari/v3/core"
...
...
@@ -49,7 +49,7 @@
<!--<xsl:template match="//*[@sc:refUri]">
<xsl:variable name="refUri" select="@sc:refUri" />
<xsl:variable name="refDoc" select="document($refUri)" />
<xsl:variable name="refDoc" select="document($refUri)" />
<xsl:choose >
<xsl:when test="../self::sc:para">
<xsl:apply-templates select="$refDoc/sc:item/of:def" />
...
...
@@ -89,12 +89,12 @@
<!--<h1><xsl:value-of select="of:sectionM/sp:title"/> </h1>-->
<xsl:choose>
<xsl:when
test=
"string(of:sectionM/sp:title)"
>
<h1><xsl:value-of
select=
"of:sectionM/sp:title"
/>
 
</h1>
<h1><xsl:value-of
select=
"of:sectionM/sp:title"
/>
 
</h1>
</xsl:when>
<xsl:otherwise>
<h1>
 
</h1>
<h1>
 
</h1>
</xsl:otherwise>
</xsl:choose>
</xsl:choose>
<xsl:call-template
name=
"author"
></xsl:call-template>
</header>
<xsl:apply-templates
select=
"sp:sec | sp:content | of:section"
/>
...
...
@@ -108,12 +108,12 @@
<!--<h1><xsl:value-of select="of:sectionM/sp:title"/> </h1>-->
<xsl:choose>
<xsl:when
test=
"string(of:sectionM/sp:title)"
>
<h1><xsl:value-of
select=
"of:sectionM/sp:title"
/>
 
</h1>
<h1><xsl:value-of
select=
"of:sectionM/sp:title"
/>
 
</h1>
</xsl:when>
<xsl:otherwise>
<h1>
 
</h1>
<h1>
 
</h1>
</xsl:otherwise>
</xsl:choose>
</xsl:choose>
<xsl:call-template
name=
"author"
></xsl:call-template>
</header>
<xsl:apply-templates
select=
"sp:sec | sp:content | of:section"
/>
...
...
@@ -124,14 +124,14 @@
</xsl:template>
<xsl:template
name=
"block"
match=
"of:block"
>
<div>
<div>
<xsl:apply-templates
select=
"of:blockM/sp:title"
/>
<xsl:apply-templates
select=
"sp:co/of:flow/sp:txt/of:txt"
/>
</div>
</xsl:template>
<xsl:template
name=
"block_emphasis"
match=
"sp:emphasis/of:block"
>
<div>
<div>
<xsl:attribute
name=
"data-hdoc-type"
>
emphasis
</xsl:attribute>
<xsl:apply-templates
select=
"of:blockM/sp:title"
/>
<xsl:apply-templates
select=
"sp:co/of:flow/sp:txt/of:txt"
/>
...
...
@@ -139,7 +139,7 @@
</xsl:template>
<xsl:template
name=
"block_complementaire"
match=
"sp:extra/of:block"
>
<div>
<div>
<xsl:attribute
name=
"data-hdoc-type"
>
complement
</xsl:attribute>
<xsl:apply-templates
select=
"of:blockM/sp:title"
/>
<xsl:apply-templates
select=
"sp:co/of:flow/sp:txt/of:txt"
/>
...
...
@@ -364,8 +364,8 @@
<xsl:with-param
name=
"value"
select=
"$src"
/>
</xsl:call-template>
</xsl:param>
<!--<img src="
optim/
{$src}/{$fileName}" alt="{$alt}"/>-->
<img
src=
"
optim/
{$src}/{$fileName}"
alt=
"{$alt}"
/>
<!--<img src="{$src}/{$fileName}" alt="{$alt}"/>-->
<img
src=
"{$src}/{$fileName}"
alt=
"{$alt}"
/>
</xsl:template>
<xsl:template
name=
"parseUriImgHref"
>
...
...
@@ -378,7 +378,7 @@
</xsl:call-template>
</xsl:param>
<!--<a href="optim/{$src}"><xsl:value-of select="$alt"/></a>-->
<a
href=
"
optim/
{$src}/{$fileName}"
><xsl:value-of
select=
"$alt"
/></a>
<a
href=
"{$src}/{$fileName}"
><xsl:value-of
select=
"$alt"
/></a>
</xsl:template>
<xsl:template
name=
"parseUriAudio"
>
...
...
@@ -390,7 +390,7 @@
</xsl:call-template>
</xsl:param>
<!--<audio src="optim/{$src}" />-->
<audio
src=
"
optim/
{$src}/{$fileName}"
/>
<audio
src=
"{$src}/{$fileName}"
/>
</xsl:template>
<xsl:template
name=
"parseUriAudioHref"
>
...
...
@@ -403,7 +403,7 @@
</xsl:call-template>
</xsl:param>
<!--<a href="optim/{$src}" ><xsl:value-of select="$alt"/></a>-->
<a
href=
"
optim/
{$src}/{$fileName}"
><xsl:value-of
select=
"$alt"
/></a>
<a
href=
"{$src}/{$fileName}"
><xsl:value-of
select=
"$alt"
/></a>
</xsl:template>
<xsl:template
name=
"parseUriOdg"
>
...
...
@@ -415,7 +415,7 @@
</xsl:call-template>
</xsl:param>
<!--<object type="application/vnd.oasis.opendocument.graphics " data="optim/{$src}"/>-->
<object
type=
"application/vnd.oasis.opendocument.graphics "
data=
"
optim/
{$src}/{$fileName}"
/>
<object
type=
"application/vnd.oasis.opendocument.graphics "
data=
"{$src}/{$fileName}"
/>
</xsl:template>
<xsl:template
name=
"parseUriOdgHref"
>
...
...
@@ -428,7 +428,7 @@
</xsl:call-template>
</xsl:param>
<!--<a href="optim/{$src}"><xsl:value-of select="$alt"/></a>-->
<a
href=
"
optim/
{$src}/{$fileName}"
><xsl:value-of
select=
"$alt"
/></a>
<a
href=
"{$src}/{$fileName}"
><xsl:value-of
select=
"$alt"
/></a>
</xsl:template>
<xsl:template
name=
"parseUriOds"
>
...
...
@@ -440,7 +440,7 @@
</xsl:call-template>
</xsl:param>
<!--<object type="application/vnd.oasis.opendocument.spreadsheet" data="optim/{$src}"/>-->
<object
type=
"application/vnd.oasis.opendocument.spreadsheet"
data=
"
optim/
{$src}/{$fileName}"
/>
<object
type=
"application/vnd.oasis.opendocument.spreadsheet"
data=
"{$src}/{$fileName}"
/>
</xsl:template>
<xsl:template
name=
"parseUriOdsHref"
>
...
...
@@ -453,14 +453,14 @@
</xsl:call-template>
</xsl:param>
<!--<a href="optim/{$src}"><xsl:value-of select="$alt"/></a>-->
<a
href=
"
optim/
{$src}/{$fileName}"
><xsl:value-of
select=
"$alt"
/></a>
<a
href=
"{$src}/{$fileName}"
><xsl:value-of
select=
"$alt"
/></a>
</xsl:template>
<xsl:template
name=
"eventList"
match=
"of:eventList"
>
<!--<div>
<xsl:apply-templates select="of:eventListM/sp:title"/>
</div>-->
<xsl:apply-templates
select=
"sp:event"
/>
<xsl:apply-templates
select=
"sp:event"
/>
</xsl:template>
<xsl:template
name=
"event"
match=
"sp:event"
>
...
...
@@ -490,30 +490,30 @@
<!--<h1><xsl:value-of select="of:pageM/sp:title"/></h1>-->
<xsl:choose>
<xsl:when
test=
"string(of:pageM/sp:title)"
>
<h1><xsl:value-of
select=
"of:pageM/sp:title"
/>
 
</h1>
<h1><xsl:value-of
select=
"of:pageM/sp:title"
/>
 
</h1>
</xsl:when>
<xsl:otherwise>
<h1>
 
</h1>
<h1>
 
</h1>
</xsl:otherwise>
</xsl:choose>
</xsl:choose>
</header>
<xsl:apply-templates
select=
"sp:main | sp:margin | of:page | sp:subPage | of:section"
/>
</section>
</section>
</xsl:template>
<xsl:template
match=
"sp:main"
>
<xsl:apply-templates
select=
"sp:sec | sp:content | of:section | sp:margin"
/>
<xsl:apply-templates
select=
"sp:sec | sp:content | of:section | sp:margin"
/>
</xsl:template>
<xsl:template
match=
"sp:title"
>
<xsl:choose>
<xsl:when
test=
"string(.)"
>
<h6><xsl:value-of
select=
"."
/>
 
</h6>
<h6><xsl:value-of
select=
"."
/>
 
</h6>
</xsl:when>
<xsl:otherwise>
<h6>
 
</h6>
<h6>
 
</h6>
</xsl:otherwise>
</xsl:choose>
</xsl:choose>
</xsl:template>
<xsl:template
match=
"sp:margin"
>
...
...
@@ -522,7 +522,7 @@
<h1>
En Marge
</h1>
</header>
<xsl:apply-templates/>
</section>
</section>
</xsl:template>
<xsl:template
name=
"getLastPart"
>
...
...
@@ -555,19 +555,19 @@
<header>
<xsl:choose>
<xsl:when
test=
"string(of:folderM/sp:title)"
>
<h1><xsl:value-of
select=
"of:folderM/sp:title"
/></h1>
<h1><xsl:value-of
select=
"of:folderM/sp:title"
/></h1>
</xsl:when>
<xsl:otherwise>
<h1>
 
</h1>
<h1>
 
</h1>
</xsl:otherwise>
</xsl:choose>
</xsl:choose>
</header>
<xsl:apply-templates
select=
"sp:subPage | sp:page | of:section"
/>
</section>
</section>
</xsl:template>
<xsl:template
match=
"of:gallery"
>
<div>
<div>
<xsl:apply-templates/>
</div>
</xsl:template>
...
...
Write
Preview
Supports
Markdown
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