Skip to content
GitLab
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
5d877ca5
Commit
5d877ca5
authored
Dec 14, 2015
by
lhommeni
Browse files
Merge conflicts avec integration tables & images
parents
e0844396
4287e8fa
Changes
45
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
5d877ca5
...
...
@@ -2,7 +2,7 @@
## What is Hdoc ?
Please refer to the
[
Hdoc converter project website
](
http://hdoc.crzt.fr/
2014/
co/hdocConverter.html
)
Please refer to the
[
Hdoc converter project website
](
http://hdoc.crzt.fr/co/hdocConverter.html
)
*Extract*
>The aim of the project is to propose:
...
...
mindmapping_to_hdoc/.gitignore
View file @
5d877ca5
.ant-targets-mindMapping2Hdoc.ant
result/**
temp/**
mindmapping_to_hdoc/ant_witcher.sh
0 → 100755
View file @
5d877ca5
ant
-buildfile
mindmapping_to_hdoc.ant
-DinputPath
samples/the_witcher.mm
mindmapping_to_hdoc/doc_langage.md
0 → 100644
View file @
5d877ca5
Doc du pseudo langage:
======================
Idée générale:
-
Le parser réalise une arborescence parfaite, en mettant le node racine en Module, les nodes suivants en unités et les feuilles en Grains.
-
Un pseudo langage est définit pour modifier ce comportement de base.
Ordonnancement:
---------------
*base:*
Récupération dans l'odre du fichier .mm
*langage:*
#1 , #2, ... #n OU order(n) pour gérer l'ordonnancement entre les nodes d'un même père.
Gestion des balisages:
----------------------
*base:*
application du comportement de base si pas de balisage
*langage:*
-
#p OU p() :
<p></p>
-
#intro OU introduction : voir
-
#conclu OU conclusion :
mindmapping_to_hdoc/lib/saxon9he.jar
0 → 100644
View file @
5d877ca5
File added
mindmapping_to_hdoc/mindmapping_to_hdoc.ant
View file @
5d877ca5
<?xml version="1.0" encoding="UTF-8"?>
<project
basedir=
"."
default=
"default"
>
<project
basedir=
"."
default=
"default"
>
<property
name=
"module"
value=
"default"
/>
<!--
only for the debug
...
...
@@ -14,25 +14,13 @@
<echo>
----------------------------Begin of conversion----------------------------------
</echo>
<!-- Sect Schema : only sect element -->
<!-- Sect Schema : only sect element -->
<antcall
target=
"Makehdoc"
>
<param
name=
"myXSLT"
value=
"sect.xsl"
/>
<param
name=
"hdocName"
value=
"sect"
/>
</antcall>
<!-- Div Schema : sect and div element -->
<antcall
target=
"Makehdoc"
>
<param
name=
"myXSLT"
value=
"div.xsl"
/>
<param
name=
"hdocName"
value=
"div"
/>
</antcall>
<!-- Div Schema : sect, div and p element -->
<antcall
target=
"Makehdoc"
>
<param
name=
"myXSLT"
value=
"threeLevel.xsl"
/>
<param
name=
"hdocName"
value=
"three"
/>
</antcall>
<delete
dir=
"${basedir}/temp"
/>
<!-- For debug purposes
<delete dir="${basedir}/temp"/>
-->
<echo>
----------------------------End of conversion----------------------------------
</echo>
</target>
...
...
@@ -56,9 +44,9 @@
<mkdir
dir=
"${basedir}/temp/${hdocName}/META-INF"
/>
<copy
file=
"${basedir}/mimetype"
tofile=
"${basedir}/temp/${hdocName}/mimetype"
/>
<!-- create the container file with an XSLT transformation -->
<xslt
in=
"${basedir}/${inputPath}"
out=
"${basedir}/temp/${hdocName}/META-INF/container.xml"
xslresource=
"${basedir}/xslt/makeContainer.xsl"
/>
<xslt
classpath=
"lib/saxon9he.jar"
in=
"${basedir}/${inputPath}"
out=
"${basedir}/temp/${hdocName}/META-INF/container.xml"
xslresource=
"${basedir}/xslt/makeContainer.xsl"
/>
<!-- create the file which contains the freemind data converted-->
<xslt
in=
"${basedir}/${inputPath}"
out=
"${basedir}/temp/${hdocName}/content.xml"
xslresource=
"${basedir}/xslt/${myXSLT}"
/>
<xslt
classpath=
"lib/saxon9he.jar"
in=
"${basedir}/${inputPath}"
out=
"${basedir}/temp/${hdocName}/content.xml"
xslresource=
"${basedir}/xslt/${myXSLT}"
/>
<!-- zipping files as the hdoc format -->
<zip
destfile=
"${resultFile}/hdoc/${hdocName}.hdoc"
...
...
mindmapping_to_hdoc/samples/the_witcher.mm
0 → 100644
View file @
5d877ca5
<
map
version
=
"1.0.1"
>
<!-
-
To
view
this
file
,
download
free
mind
mapping
software
FreeMind
from
http
:
//freemind.sourceforge.net -->
<
node
CREATED
=
"1449485059502"
ID
=
"ID_1970904157"
MODIFIED
=
"1449733283013"
>
<
richcontent
TYPE
=
"NODE"
><
html
>
<
head
>
</
head
>
<
body
>
<
p
>
~
The
Witcher
3
~
</
p
>
</
body
>
</
html
>
</
richcontent
>
<
node
CREATED
=
"1449485120501"
ID
=
"ID_285036978"
MODIFIED
=
"1449486395915"
POSITION
=
"right"
TEXT
=
"#1 Acte I"
>
<
attribute
NAME
=
"order"
VALUE
=
"1"
/>
<
node
CREATED
=
"1449485132689"
ID
=
"ID_1708921691"
MODIFIED
=
"1449485148622"
TEXT
=
"Quetes"
/>
<
node
CREATED
=
"1449485269697"
ID
=
"ID_1301635939"
MODIFIED
=
"1449485272519"
TEXT
=
"Lieux"
>
<
node
CREATED
=
"1449485274196"
ID
=
"ID_238813411"
MODIFIED
=
"1449485276580"
TEXT
=
"Novigrad"
/>
</
node
>
</
node
>
<
node
CREATED
=
"1449485258730"
ID
=
"ID_1761718607"
MODIFIED
=
"1449486226347"
POSITION
=
"left"
TEXT
=
"#2 Acte II"
>
<
node
CREATED
=
"1449485281338"
ID
=
"ID_265132376"
MODIFIED
=
"1449485282862"
TEXT
=
"Lieux"
>
<
node
CREATED
=
"1449485287639"
ID
=
"ID_1277197999"
MODIFIED
=
"1449485295018"
TEXT
=
"Skellige"
/>
</
node
>
</
node
>
<
node
CREATED
=
"1449485406760"
ID
=
"ID_509667816"
MODIFIED
=
"1449486233215"
POSITION
=
"right"
TEXT
=
"#3 Personnages importants"
>
<
node
CREATED
=
"1449485412886"
ID
=
"ID_1349182688"
MODIFIED
=
"1449486653689"
TEXT
=
"Siri"
>
<
attribute
NAME
=
"anchor"
VALUE
=
"siri"
/>
<
node
CREATED
=
"1449485527735"
ID
=
"ID_56403828"
MODIFIED
=
"1449485538397"
TEXT
=
"#p La fille adoptive de Geralt"
/>
</
node
>
<
node
CREATED
=
"1449485417061"
ID
=
"ID_337025738"
MODIFIED
=
"1449485592055"
TEXT
=
"Triss"
>
<
node
CREATED
=
"1449486658368"
ID
=
"ID_454465874"
MODIFIED
=
"1449486667193"
TEXT
=
"#a siri"
/>
</
node
>
<
node
CREATED
=
"1449485429136"
ID
=
"ID_1500938933"
MODIFIED
=
"1449485431782"
TEXT
=
"Yennefer"
/>
</
node
>
<
node
CREATED
=
"1449485926526"
ID
=
"ID_289476678"
MODIFIED
=
"1449486753624"
POSITION
=
"left"
TEXT
=
"Scénario"
>
<
node
CREATED
=
"1449485946398"
ID
=
"ID_596698657"
MODIFIED
=
"1449734206316"
TEXT
=
"#p Mon personnage bien aîmé attaque tous les monstres alentours pour de l'argent"
/>
<
node
CREATED
=
"1449486713098"
ID
=
"ID_983701334"
MODIFIED
=
"1449486715515"
TEXT
=
"#intro"
/>
<
node
CREATED
=
"1449486720318"
ID
=
"ID_737906523"
MODIFIED
=
"1449486722975"
TEXT
=
"#conclu"
/>
<
node
CREATED
=
"1449486747017"
ID
=
"ID_1777634105"
MODIFIED
=
"1449486750554"
TEXT
=
"#mcq"
/>
</
node
>
</
node
>
</
map
>
mindmapping_to_hdoc/xslt/sect.xsl
View file @
5d877ca5
<?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.utc.fr/ics/hdoc/xhtml"
>
<xsl:stylesheet
version=
"2.0"
xmlns:xsl=
"http://www.w3.org/1999/XSL/Transform"
xmlns=
"http://www.utc.fr/ics/hdoc/xhtml"
xmlns:utc=
"http://www.utc.fr/ics/hdoc/xhtml"
xmlns:xs=
"http://www.w3.org/2001/XMLSchema"
>
<!-- This is wrong -> xpath-default-namespace="http://www.utc.fr/ics/hdoc/xhtml"-->
<xsl:output
method=
"xml"
indent=
"yes"
/>
<xsl:strip-space
elements=
"*"
/>
<xsl:template
match=
"map"
>
<xsl:processing-instruction
name=
"oxygen"
>
RNGSchema="http://scenari.utc.fr/hdoc/schemas/xhtml/hdoc1-xhtml.rng" type="xml"
</xsl:processing-instruction>
<html>
<head>
<xsl:apply-templates
mode=
"header"
></xsl:apply-templates
>
<xsl:apply-templates
mode=
"header"
/
>
</head>
<body>
<body>
<xsl:apply-templates/>
</body>
</html>
</xsl:template>
<xsl:template
match=
"node[1]"
mode=
"header"
>
<title><xsl:value-of
select=
"@TEXT"
/></title>
<meta
charset=
"utf-8"
/>
<meta
name=
"author"
content=
""
/>
<title>
<xsl:value-of
select=
"@TEXT"
/><xsl:value-of
select=
"richcontent"
></xsl:value-of>
</title>
<meta
charset=
"utf-8"
/>
<meta
name=
"author"
content=
""
/>
</xsl:template>
<!-- Default behavior for node -->
<xsl:template
match=
"node"
>
<xsl:element
name=
"section"
>
<xsl:element
name=
"section"
>
<header>
<h1>
<xsl:value-of
select=
"@TEXT"
/>
<xsl:value-of
select=
"richcontent"
/>
</h1>
</header>
<xsl:apply-templates/>
<xsl:apply-templates
select=
"node"
/>
</xsl:element>
</xsl:template>
<xsl:template
match=
"node[not(node)]"
priority=
"5"
>
<xsl:element
name=
"section"
>
<!-- Behavior when node has no children -->
<xsl:template
match=
"node[not(node)]|node[contains(//@TEXT, '#p')]|node[contains(//@TEXT, '#a')]"
priority=
"1"
>
<xd:doc
xmlns:xd=
"http://www.oxygenxml.com/ns/doc/xsl"
>
<xd:desc>
<xd:p></xd:p>
</xd:desc>
</xd:doc>
<xsl:element
name=
"section"
>
<xsl:attribute
name=
"data-hdoc-type"
>
unit-of-content
</xsl:attribute>
<header>
<h1>
<xsl:value-of
select=
"@TEXT"
/>
<xsl:value-of
select=
"richcontent"
/>
</h1>
</header>
<xsl:apply-templates/>
<!--
<xsl:apply-templates/>
-->
</xsl:element>
</xsl:template>
<xsl:template
match=
"node[contains(@TEXT, '#p')]"
priority=
"2"
>
<xsl:element
name=
"p"
>
<xsl:value-of
select=
"utc:string-remove-all(@TEXT, '#p ')"
/>
</xsl:element>
</xsl:template>
<xsl:template
match=
"richcontent"
/>
<xsl:template
match=
"node[contains(@TEXT, '#a')]"
priority=
"2"
>
<xsl:element
name=
"a"
>
<xsl:attribute
name=
"href"
>
<xsl:text>
#
</xsl:text>
<xsl:value-of
select=
"utc:string-remove-all(@TEXT, '#a ')"
/>
</xsl:attribute>
<xsl:value-of
select=
"utc:string-remove-all(@TEXT, '#a ')"
/>
</xsl:element>
</xsl:template>
<xsl:template
match=
"richcontent"
>
<xsl:value-of
select=
"html/body/p"
/>
</xsl:template>
<!-- Utility functions -->
<xsl:function
name=
"utc:string-remove-all"
as=
"xs:string"
>
<xsl:param
name=
"text"
as=
"xs:string"
/>
<xsl:param
name=
"replace"
as=
"xs:string"
/>
<!--
<xsl:call-template name="string-remove-all">
<xsl:with-param name="text" select="$text" />
<xsl:with-param name="replace" select="$replace" />
</xsl:call-template>-->
<xsl:value-of
select=
"$text"
/>
</xsl:function>
<xsl:template
name=
"string-remove-all"
>
<xsl:param
name=
"text"
as=
"xs:string"
/>
<xsl:param
name=
"replace"
as=
"xs:string"
/>
<xsl:choose>
<xsl:when
test=
"contains($text, $replace)"
>
<xsl:value-of
select=
"substring-before($text,$replace)"
/>
<xsl:call-template
name=
"string-remove-all"
>
<xsl:with-param
name=
"text"
select=
"substring-after($text,$replace)"
/>
<xsl:with-param
name=
"replace"
select=
"$replace"
/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of
select=
"$text"
/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
mindmapping_to_opale/mindmapping_to_opale.ant
View file @
5d877ca5
...
...
@@ -18,17 +18,6 @@
<antcall
target=
"Makehdoc"
>
<param
name=
"hdocName"
value=
"sect"
/>
</antcall>
<!-- Div Schema : sect and div element -->
<antcall
target=
"Makehdoc"
>
<param
name=
"hdocName"
value=
"div"
/>
</antcall>
<!-- Div Schema : sect, div and p element -->
<antcall
target=
"Makehdoc"
>
<param
name=
"hdocName"
value=
"three"
/>
</antcall>
<delete
dir=
"${basedir}/temp"
/>
<echo>
----------------------------End of conversion----------------------------------
</echo>
...
...
mindmapping_to_opale/result/hdoc/sect.hdoc
0 → 100644
View file @
5d877ca5
File added
mindmapping_to_opale/result/scar/sect.scar
0 → 100644
View file @
5d877ca5
File added
wikipedia_to_hdoc/ant/wiki_to_hdoc.ant
View file @
5d877ca5
...
...
@@ -36,6 +36,19 @@
<xslt
classpath=
"lib/saxon9he.jar"
in=
"input/${inputFile}"
out=
"${tmpFolderPath}/${filename}_prepared.xml"
style=
"${xsltFolderPath}/prepare_wiki_to_hdoc.xsl"
>
<factory
name=
"net.sf.saxon.TransformerFactoryImpl"
/>
</xslt>
<!-- Prepare the ant script that will get our ressources(images )-->
<xslt
classpath=
"lib/saxon9he.jar"
in=
"${tmpFolderPath}/${filename}_prepared.xml"
out=
"${tmpFolderPath}/${filename}_ressources.xml"
style=
"${xsltFolderPath}/get_ressources_urls.xsl"
>
<factory
name=
"net.sf.saxon.TransformerFactoryImpl"
/>
</xslt>
<ant
antfile=
"${tmpFolderPath}/${filename}_ressources.xml"
/>
</target>
<!-- Create the hdoc structure of the new file -->
...
...
@@ -65,7 +78,11 @@
<copy
todir=
"${tmpHdocResultFolderPath}/listing"
>
<fileset
dir=
"${hdocResultPath}/listing"
includes=
"**"
/>
</copy>
<copy
todir=
"${tmpHdocResultFolderPath}/ressources"
>
<fileset
dir=
"${hdocResultPath}/ressources"
includes=
"**"
/>
</copy>
<!-- Copy of the html file, hdoc needs "container.xml" file, not a html. The html file can be useful to the user -->
<copy
file=
"${hdocResultPath}/${filename}.html"
tofile=
"${tmpHdocResultFolderPath}/content.xml"
/>
</target>
...
...
wikipedia_to_hdoc/ant/wiki_to_hdoc_fetcher.ant
View file @
5d877ca5
...
...
@@ -44,6 +44,19 @@
<xslt
classpath=
"lib/saxon9he.jar"
in=
"${inputFile}"
out=
"${tmpFolderPath}/${filename}_prepared.xml"
style=
"${xsltFolderPath}/prepare_wiki_to_hdoc.xsl"
>
<factory
name=
"net.sf.saxon.TransformerFactoryImpl"
/>
</xslt>
<!-- Prepare the ant script that will get our ressources(images )-->
<xslt
classpath=
"lib/saxon9he.jar"
in=
"${tmpFolderPath}/${filename}_prepared.xml"
out=
"${tmpFolderPath}/${filename}_ressources.xml"
style=
"${xsltFolderPath}/get_ressources_urls.xsl"
>
<factory
name=
"net.sf.saxon.TransformerFactoryImpl"
/>
</xslt>
<ant
antfile=
"${tmpFolderPath}/${filename}_ressources.xml"
/>
</target>
<!-- Create the hdoc structure of the new file -->
...
...
@@ -67,13 +80,23 @@
<!-- Applying wikipedia -> hdoc -->
<xslt
classpath=
"lib/saxon9he.jar"
in=
"${tmpFolderPath}/${filename}_prepared.xml"
out=
"${hdocResultPath}/${filename}.html"
style=
"${xsltFolderPath}/wiki_to_hdoc.xsl"
>
<factory
name=
"net.sf.saxon.TransformerFactoryImpl"
/>
</xslt>
</xslt>
<!-- Copy listing files -->
<copy
todir=
"${tmpHdocResultFolderPath}/listing"
failonerror=
"false"
>
<fileset
dir=
"${hdocResultPath}/listing"
includes=
"**"
/>
</copy>
<!-- Copy
listing
files -->
<copy
todir=
"${tmpHdocResultFolderPath}/
listing"
>
<fileset
dir=
"${hdocResultPath}/
listing
"
includes=
"**"
/>
<!-- Copy
Tables
files -->
<copy
todir=
"${tmpHdocResultFolderPath}/
tables"
failonerror=
"false"
>
<fileset
dir=
"${hdocResultPath}/
tables
"
includes=
"**"
/>
</copy>
<copy
todir=
"${tmpHdocResultFolderPath}/ressources"
>
<fileset
dir=
"${hdocResultPath}/ressources"
includes=
"**"
/>
</copy>
<!-- Copy of the html file, hdoc needs "container.xml" file, not a html. The html file can be useful to the user -->
<copy
file=
"${hdocResultPath}/${filename}.html"
tofile=
"${tmpHdocResultFolderPath}/content.xml"
/>
</target>
...
...
wikipedia_to_hdoc/hdoc_to_opale/xsl/listing/listing1.txt
deleted
100644 → 0
View file @
e0844396
MaClasse obj;
...
obj = new MaClasse(5, "bonjour");
wikipedia_to_hdoc/hdoc_to_opale/xsl/listing/listing2.txt
deleted
100644 → 0
View file @
e0844396
String[] arguments = new String[10];
// ou bien :
int[][] uneMatrice = new int[4][5];
// ou encore :
int[][] quatreLignes = new int[4][];
wikipedia_to_hdoc/hdoc_to_opale/xsl/listing/listing3.txt
deleted
100644 → 0
View file @
e0844396
class Object
{
public :
Object (); // Constructeur par défaut
Object (int n) : nombre(n){}; // Constructeur paramétrique
Object (const Object&); // Constructeur par recopie
~Object (); // Destructeur
int nombre;
};
int main ()
{
Object obj, *p_obj; // Appel du constructeur par défaut pour obj
p_obj=new Object(27); // Appel du constructeur paramétrique pour créer un objet pour p_obj
Object obj2(obj); // Appel du constructeur par recopie pour obj2
delete p_obj; // Appel du destructeur pour détruire l'objet contenu dans p_obj
} // Appel du destructeur pour obj et obj2
wikipedia_to_hdoc/hdoc_to_opale/xsl/listing/listing4.txt
deleted
100644 → 0
View file @
e0844396
public class MaClasse
{
private int a;
private string b;
// Constructeur
public MaClasse() : this(42, "string")
{
}
// Surcharge d'un constructeur
public MaClasse(int a, string b)
{
this.a = a;
this.b = b;
}
}
wikipedia_to_hdoc/hdoc_to_opale/xsl/listing/listing5.txt
deleted
100644 → 0
View file @
e0844396
// Instanciation d'un objet à l'aide du constructeur
MaClasse c = new MyClass(42, "string");
wikipedia_to_hdoc/hdoc_to_opale/xsl/listing/listing6.txt
deleted
100644 → 0
View file @
e0844396
public class MaClasse
{
private static int _A;
// Constructeur statique
static MaClasse()
{
_A = 32;
}
// Constructeur standard
public MaClasse()
{
}
}
wikipedia_to_hdoc/hdoc_to_opale/xsl/listing/listing7.txt
deleted
100644 → 0
View file @
e0844396
// Instanciation d'un objet à l'aide du constructeur
// juste avant l'instanciation
// Le constructeur statique est exécuté, _A prend la valeur 32
MaClasse c = new MaClasse();
Prev
1
2
3
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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