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
b708820a
Commit
b708820a
authored
Dec 12, 2016
by
Baptiste Perraud
Browse files
Merge branch 'master' of
https://gitlab.utc.fr/crozatst/hdoc
parents
21a81fe8
92eca99d
Changes
14
Expand all
Hide whitespace changes
Inline
Side-by-side
framapad_to_hdoc/README.md
View file @
b708820a
...
...
@@ -6,8 +6,8 @@ http://www.gnu.org/licenses/gpl-3.0.txt
## Credits
-
2016
-
- Etienne Chognard
-
- Fabien Boucaud
-
Etienne Chognard
-
Fabien Boucaud
-
2015
-
Jean-Côme Douteau
-
Gabrielle Rit
...
...
@@ -85,4 +85,4 @@ Currently available on: https://framemo.org/framapad_to_opale
-
br -> p
## Capitalisation
Using regular expression with xsl is a good way to parse a non xml file.
\ No newline at end of file
Using regular expression with xsl is a good way to parse a non xml file.
framapad_to_hdoc/
ether
pad_to_hdoc.ant
→
framapad_to_hdoc/
frama
pad_to_hdoc.ant
View file @
b708820a
<?xml version="1.0" encoding="UTF-8"?>
<project
basedir=
"."
name=
"myantce"
default=
"main"
>
<property
file=
"
ether
pad_to_hdoc.properties"
/>
<property
file=
"
frama
pad_to_hdoc.properties"
/>
<!-- import classes -->
<taskdef
resource=
"net/sf/antcontrib/antlib.xml"
/>
<taskdef
name=
"htmlcleaner"
classname=
"org.htmlcleaner.HtmlCleanerForAnt"
/>
...
...
framapad_to_hdoc/
ether
pad_to_hdoc.properties
→
framapad_to_hdoc/
frama
pad_to_hdoc.properties
View file @
b708820a
File moved
framapad_to_hdoc/run.bat
View file @
b708820a
@echo
off
set
lib
=
lib
set
ant
=
ether
pad_to_hdoc
.ant
set
ant
=
frama
pad_to_hdoc
.ant
set
antparam
=
-Dprogram
.param
=
%
1
set
scJarList
=
%lib%
\
*
...
...
framapad_to_hdoc/run.sh
View file @
b708820a
#!/bin/sh
lib
=
"lib"
ant
=
"
ether
pad_to_hdoc.ant"
ant
=
"
frama
pad_to_hdoc.ant"
antparam
=
"-Dprogram.param=
$1
"
#Recherche de java et controle que se soit une version SUN
...
...
framapad_to_opale/
ether
pad_to_opale.ant
→
framapad_to_opale/
frama
pad_to_opale.ant
View file @
b708820a
<?xml version="1.0" encoding="UTF-8"?>
<project
basedir=
"."
name=
"myantce"
default=
"main"
>
<property
file=
"
ether
pad_to_opale.properties"
/>
<property
file=
"
frama
pad_to_opale.properties"
/>
<!-- CHECK FOR OS FAMILY -->
<condition
property=
"is_windows"
>
<os
family=
"windows"
/>
...
...
@@ -24,7 +24,7 @@
<include
name=
"*.html"
/>
</fileset>
</copy>
<exec
dir=
"../
ether
pad_to_hdoc"
executable=
"run.bat"
/>
<exec
dir=
"../
frama
pad_to_hdoc"
executable=
"run.bat"
/>
</target>
<target
name=
"to_hdoc_unix"
if=
"${is_unix}"
>
...
...
@@ -38,8 +38,8 @@
<include
name=
"*.html"
/>
</fileset>
</copy>
<exec
executable=
"/bin/bash"
dir=
"../
ether
pad_to_hdoc"
>
<arg
value=
"../
ether
pad_to_hdoc/run.sh"
/>
<exec
executable=
"/bin/bash"
dir=
"../
frama
pad_to_hdoc"
>
<arg
value=
"../
frama
pad_to_hdoc/run.sh"
/>
</exec>
</target>
...
...
@@ -90,4 +90,4 @@
<antcall
target=
"to_opale_windows"
/>
<antcall
target=
"to_opale_end"
/>
</target>
</project>
\ No newline at end of file
</project>
framapad_to_opale/
ether
pad_to_opale.properties
→
framapad_to_opale/
frama
pad_to_opale.properties
View file @
b708820a
...
...
@@ -5,8 +5,8 @@ xsl = ${basedir}/xsl
lib
=
${basedir}/lib
log
=
${basedir}/log
eth_in
=
../
ether
pad_to_hdoc/input
eth_out
=
../
ether
pad_to_hdoc/output
eth_in
=
../
frama
pad_to_hdoc/input
eth_out
=
../
frama
pad_to_hdoc/output
opa_in
=
../hdoc_to_opale/input
opa_out
=
../hdoc_to_opale/output
rootfilename
=
content.xml
\ No newline at end of file
rootfilename
=
content.xml
framapad_to_opale/run.bat
View file @
b708820a
@echo
off
set
lib
=
lib
set
ant
=
ether
pad_to_opale
.ant
set
ant
=
frama
pad_to_opale
.ant
set
antparam
=
-Dprogram
.param
=
%
1
set
scJarList
=
%lib%
\
*
...
...
framapad_to_opale/run.sh
View file @
b708820a
#!/bin/sh
lib
=
"lib"
ant
=
"
ether
pad_to_opale.ant"
ant
=
"
frama
pad_to_opale.ant"
antparam
=
"-Dprogram.param=
$1
"
#Recherche de java et controle que se soit une version SUN
...
...
hdoc_to_basex/build.properties
View file @
b708820a
libdir
=
${basedir}/lib
rngdir
=
${basedir}/rng
xsldir
=
${basedir}/xsl
srcdir
=
${basedir}/in
outdir
=
${basedir}/out
InputPath
=
${basedir}/input
OutputPath
=
${basedir}/output
lib
=
${basedir}/lib
log
=
${basedir}/log
xsl
=
${basedir}/xsl
in
=
${basedir}/input
out
=
${basedir}/output
tmp
=
${basedir}/tmp
\ No newline at end of file
hdoc_to_basex/hdoc_to_basex.ant
View file @
b708820a
...
...
@@ -3,49 +3,42 @@
<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"
/>
<target
name=
"convert"
>
<echo
message=
"DEBUT"
/>
<mkdir
dir=
"${tmp}"
/>
<delete
dir=
"${out}"
failonerror=
"false"
/>
<mkdir
dir=
"${out}"
/>
<delete
dir=
"${log}"
failonerror=
"false"
/>
<mkdir
dir=
"${log}"
/>
<for
param=
"inputFile"
>
<path>
<fileset
dir=
"${in}"
includes=
"**/*.hdoc"
/>
</path>
<sequential>
<local
name=
"filename"
/>
<basename
property=
"filename"
file=
"@{inputFile}"
/>
<antcall
target=
"UnzipHdocFile"
>
<param
name=
"filename"
value=
"${filename}"
/>
</antcall>
<antcall
target=
"content"
>
<param
name=
"filename"
value=
"${filename}"
/>
</antcall>
<echo
message=
"FIN"
/>
</sequential>
</for>
</target>
<property
file=
"build.properties"
/>
<target
name=
"convert"
>
<!-- Preparation for the file transformation : delete old folders and create new folders -->
<mkdir
dir=
"${tmp}"
/>
<delete
dir=
"${out}"
failonerror=
"false"
/>
<mkdir
dir=
"${out}"
/>
<delete
dir=
"${log}"
failonerror=
"false"
/>
<mkdir
dir=
"${log}"
/>
<echo
message=
"DEBUT"
/>
<!-- Convert all the hdoc files in the directory ${in} to data xml files that will be imported to basex later.
Fonctions "UnzipHdocFile" and "content" will be called. -->
<for
param=
"inputFile"
>
<path>
<fileset
dir=
"${in}"
includes=
"**/*.hdoc"
/>
</path>
<sequential>
<local
name=
"filename"
/>
<basename
property=
"filename"
file=
"@{inputFile}"
/>
<antcall
target=
"UnzipHdocFile"
>
<param
name=
"filename"
value=
"${filename}"
/>
</antcall>
<antcall
target=
"content"
>
<param
name=
"filename"
value=
"${filename}"
/>
</antcall>
<echo
message=
"FIN"
/>
</sequential>
</for>
<!-- Clean-->
<delete
dir=
"${tmp}"
failonerror=
"false"
/>
</target>
<target
name=
"UnzipHdocFile"
>
<!-- Unzip the input hdoc file. Decompressed folder is named "decompressedHdoc" : this name is the only one which
...
...
@@ -56,15 +49,13 @@
</target>
<target
name=
"content"
>
<xslt
in=
"${tmp}/${filename}/decompressedHdoc/content.xml"
out=
"${out}/${filename}_data.xml"
style=
"${xsl}/transformation.xsl"
processor=
"org.apache.tools.ant.taskdefs.optional.TraXLiaison"
>
<param
name=
"filename"
expression=
"${filename}"
/>
<param
name=
"lib"
expression=
"${lib}"
/>
</xslt>
<echo
message=
"${filename}"
/>
<delete
dir=
"${tmp}"
failonerror=
"false"
/>
<!-- Transformation of a xml file decompressed from hdoc file to data xml file to be imported to basex.
The transformation will be done in terms of the xsl file in ${xsl}.-->
<xslt
in=
"${tmp}/${filename}/decompressedHdoc/content.xml"
out=
"${out}/${filename}_data.xml"
style=
"${xsl}/transformation.xsl"
processor=
"org.apache.tools.ant.taskdefs.optional.TraXLiaison"
>
<param
name=
"filename"
expression=
"${filename}"
/>
<param
name=
"lib"
expression=
"${lib}"
/>
</xslt>
<echo
message=
"${filename}"
/>
</target>
</project>
\ No newline at end of file
opale_to_hdoc/README.md
View file @
b708820a
...
...
@@ -149,3 +149,11 @@ The opale_to_hdoc converter transcribes an Opale publication to a hdoc format. O
The source code converter is available and can be completed in order to
improve it and manage more Opale elements.
Modified by Benoit Villain (12/12/2016)
------------------
Les divisions et les parties d'un grain n'étaient pas traitées... Contrairement à ce que mentionne le README...
J'ai donc apporté les modifications nécessaires pour que les divisions et les parties (récursives) soient bel et bien transformées en "section" hdoc.
opale_to_hdoc/xsl/opale_to_hdoc_regle2.xsl
View file @
b708820a
This diff is collapsed.
Click to expand it.
wikipedia_to_hdoc/xslt/wiki_to_hdoc.xsl
View file @
b708820a
...
...
@@ -423,8 +423,10 @@
<xsl:template
match=
"div[@id='toctitle']/h2"
priority=
"1"
/>
<!-- Ignoring end of file h2: see also, etc... -->
<xsl:template
match=
"h2[not(following-sibling::p intersect following-sibling::h2[1]/preceding-sibling::p)]"
/>
<!-- <xsl:template match="h2[not(following-sibling::p intersect following-sibling::h2[1]/preceding-sibling::p)]"/>-->
<xsl:template
match=
" h2[following-sibling::ul[li/a[@class='external text'] and preceding-sibling::h2]][last()]"
/>
<xsl:template
match=
" h2[following-sibling::div[@class='references-small decimal'] and preceding-sibling::h2][last()]"
/>
<xsl:template
match=
"div[@id='mw-navigation']/h2"
/>
<!-- Ignoring divs by default: they are not relevant to us -->
<xsl:template
match=
"div"
mode=
"#all"
/>
...
...
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