Commit de42c2de authored by Bastien FREMONDIERE's avatar Bastien FREMONDIERE

Merge branch 'mindmapping'

parents 9a764966 664b8ccb
...@@ -4,4 +4,12 @@ ...@@ -4,4 +4,12 @@
wikipedia_to_hdoc/result/* wikipedia_to_hdoc/result/*
wikipedia_to_hdoc/tmp/* wikipedia_to_hdoc/tmp/*
wikipedia_to_hdoc/hdoc_to_opale/tmp/* wikipedia_to_hdoc/hdoc_to_opale/tmp/*
wikipedia_to_hdoc/output/* wikipedia_to_hdoc/output/*
\ No newline at end of file mindmapping_to_opale/result/*
mindmapping_to_opale/tmp/*
mindmapping_to_lexique/result/*
mindmapping_to_lexique/tmp/*
mindmapping_to_optim/result/*
mindmapping_to_optim/tmp/*
mindmapping_to_hdoc/result/*
mindmapping_to_hdoc/tmp/*
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="no"?><map version="0.8.1"><node CREATED="1450312359766" ID="2nngtspni6hi1484pfec44c8lk" MODIFIED="1450312359766" TEXT="MindMapping"><node CREATED="1450312359766" ID="00lp6bpfm6jibhcjrpdonrhoqb" MODIFIED="1450312359766" POSITION="right" TEXT="#1 MindMapping to Hdoc"><node CREATED="1450312359766" ID="3qm1jgu7dfgs328jthlek5fd4e" MODIFIED="1450312359766" TEXT="Prendre en main le projet existant"/><node CREATED="1450312359766" ID="0u38ectmhqqp4p08p5guvgij71" MODIFIED="1450312359766" TEXT="Corriger les bugs existants"/><node CREATED="1450312359766" ID="3b1t9o2te6enh59j4iv48f4mdi" MODIFIED="1450312359766" TEXT="Restructurer le ant"/></node><node CREATED="1450312359766" ID="6lohsep5crh5g3ngj8ld8loei6" MODIFIED="1450312359766" POSITION="right" TEXT="#2 MindMapping to Opale"><node CREATED="1450312359766" ID="5pl3210hq6if3nv7r2chtjstmo" MODIFIED="1450312359766" TEXT="Faire la connexion avec le transformateur Hdoc to Opale"/><node CREATED="1450312359766" ID="3haa2fgohe9j4n04ilddco84uh" MODIFIED="1450312359766" TEXT="Permettre la personnalisation de l'organisation du module"/><node CREATED="1450312359766" ID="11k2hbkcu415e1mgk5c5ucr48k" MODIFIED="1450312359766" TEXT="Permettre la personnalisation dy type de noeud (Intro, conclusion etc.)"/><node CREATED="1450312359766" ID="4npf8jpvak3lffn9c1rsogi0sq" MODIFIED="1450312359766" TEXT="Permettre la personnalisation grâce aux couleurs/icônes"/></node><node CREATED="1450312359766" ID="3n8v43p8qb005puq3qiv7aiubc" MODIFIED="1450312359766" POSITION="right" TEXT="#3 MindMapping to Optim"><node CREATED="1450312359766" ID="2bn1la3apnjf1fi8qqfqde226t" MODIFIED="1450312359766" TEXT="Faire la connexion avec le transformateur Hdoc to Optim"/></node><node CREATED="1450312359766" ID="3s00si3hquol4pldg7lo9opjd6" MODIFIED="1450312359766" POSITION="right" TEXT="#4 MindMapping to Lexique"><node CREATED="1450312359766" ID="37jlfl25iuaoe6f2cpiv30qksd" MODIFIED="1450312359766" TEXT="Faire la connexion avec le transformateur Hdoc to Lexique"/></node><node CREATED="1450312359767" ID="27gnl6pgottjfiukpa3ulfdjrj" MODIFIED="1450312359767" POSITION="left" TEXT="#5 Prendre d'autres outils de carte mentales en entrée"/><node CREATED="1450312359767" ID="24d41nnnnvvu7fv5m8m4vegu0g" MODIFIED="1450312359767" POSITION="left" TEXT="#intro This converter aims at convert a given MindMapping file into a Hdoc file which then will be imported in Opale (advanced only)."/><node CREATED="1450312359767" ID="6a7pr2b5vvmq6na5964dhf9e13" MODIFIED="1450312359767" POSITION="left" TEXT="#conclu Ma conclusion"/></node></map>
\ No newline at end of file
<map version="1.0.1"> <map version="1.0.1">
<!-- To view this file, download free mind mapping software FreeMind from http://freemind.sourceforge.net --> <!-- To view this file, download free mind mapping software FreeMind from http://freemind.sourceforge.net -->
<node CREATED="1449485059502" ID="ID_1970904157" MODIFIED="1449733283013"> <node CREATED="1449485059502" ID="ID_1970904157" MODIFIED="1449733283013">
<node CREATED="1449486713098" ID="ID_983701334" MODIFIED="1449486715515" TEXT="#intro Une introduction"/>
<node CREATED="1449486720318" ID="ID_737906523" MODIFIED="1449486722975" TEXT="#conclu Une conclusion"/>
<richcontent TYPE="NODE"><html> <richcontent TYPE="NODE"><html>
<head> <head>
...@@ -36,8 +38,6 @@ ...@@ -36,8 +38,6 @@
</node> </node>
<node CREATED="1449485926526" ID="ID_289476678" MODIFIED="1449486753624" POSITION="left" TEXT="Sc&#xe9;nario"> <node CREATED="1449485926526" ID="ID_289476678" MODIFIED="1449486753624" POSITION="left" TEXT="Sc&#xe9;nario">
<node CREATED="1449485946398" ID="ID_596698657" MODIFIED="1449734206316" TEXT="#p Mon personnage bien a&#xee;m&#xe9; attaque tous les monstres alentours pour de l&apos;argent"/> <node CREATED="1449485946398" ID="ID_596698657" MODIFIED="1449734206316" TEXT="#p Mon personnage bien a&#xee;m&#xe9; attaque tous les monstres alentours pour de l&apos;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 CREATED="1449486747017" ID="ID_1777634105" MODIFIED="1449486750554" TEXT="#mcq"/>
</node> </node>
</node> </node>
......
...@@ -5,8 +5,10 @@ ...@@ -5,8 +5,10 @@
<!-- This is wrong -> xpath-default-namespace="http://www.utc.fr/ics/hdoc/xhtml"--> <!-- This is wrong -> xpath-default-namespace="http://www.utc.fr/ics/hdoc/xhtml"-->
<xsl:output method="xml" indent="yes"/> <xsl:output method="xml" indent="yes"/>
<!-- Remove spaces/tabs -->
<xsl:strip-space elements="*"/> <xsl:strip-space elements="*"/>
<!-- Entry point -->
<xsl:template match="map"> <xsl:template match="map">
<xsl:processing-instruction name="oxygen"> <xsl:processing-instruction name="oxygen">
RNGSchema="http://scenari.utc.fr/hdoc/schemas/xhtml/hdoc1-xhtml.rng" type="xml" RNGSchema="http://scenari.utc.fr/hdoc/schemas/xhtml/hdoc1-xhtml.rng" type="xml"
...@@ -22,7 +24,7 @@ ...@@ -22,7 +24,7 @@
</xsl:template> </xsl:template>
<!-- Header in hdoc -->
<xsl:template match="node[1]" mode="header"> <xsl:template match="node[1]" mode="header">
<title> <title>
<xsl:value-of select="@TEXT"/> <xsl:value-of select="@TEXT"/>
...@@ -41,7 +43,31 @@ ...@@ -41,7 +43,31 @@
<xsl:value-of select="richcontent"/> <xsl:value-of select="richcontent"/>
</h1> </h1>
</header> </header>
<!--Introduction-->
<xsl:if test="child::*[contains(@TEXT, '#intro')]">
<xsl:element name="section">
<header><h1>Introduction</h1>
<xsl:element name="div">
<xsl:attribute name="data-hdoc-type">introduction</xsl:attribute>
<xsl:value-of select="utc:string-remove-order(utc:string-remove-all(child::*[contains(@TEXT, '#intro')][1]/@TEXT, '#intro '))"/>
</xsl:element>
</header>
</xsl:element>
</xsl:if>
<!-- Process children -->
<xsl:apply-templates select="node"/> <xsl:apply-templates select="node"/>
<!--Conclusion-->
<xsl:if test="child::*[contains(@TEXT, '#conclu')]">
<xsl:element name="section">
<header><h1>Concluson</h1></header>
<footer>
<xsl:element name="div">
<xsl:attribute name="data-hdoc-type">conclusion</xsl:attribute>
<xsl:value-of select="utc:string-remove-order(utc:string-remove-all(child::*[contains(@TEXT, '#conclu')][1]/@TEXT, '#conclu '))"/>
</xsl:element>
</footer>
</xsl:element>
</xsl:if>
</xsl:element> </xsl:element>
</xsl:template> </xsl:template>
...@@ -49,13 +75,13 @@ ...@@ -49,13 +75,13 @@
<xsl:template <xsl:template
match="node[not(node)]|node[child::*[contains(@TEXT, '#p')]]|node[child::*[contains(@TEXT, '#a')]]" match="node[not(node)]|node[child::*[contains(@TEXT, '#p')]]|node[child::*[contains(@TEXT, '#a')]]"
priority="1"> priority="1">
<xd:doc xmlns:xd="http://www.oxygenxml.com/ns/doc/xsl">
<xd:desc>
<xd:p/>
</xd:desc>
</xd:doc>
<xsl:element name="section"> <xsl:element name="section">
<xsl:attribute name="data-hdoc-type">unit-of-content</xsl:attribute> <xsl:attribute name="data-hdoc-type">unit-of-content</xsl:attribute>
<xsl:if test="child::attribute[@NAME='anchor']">
<xsl:attribute name="id">
<xsl:value-of select="child::attribute[@NAME='anchor'][1]/@VALUE"></xsl:value-of>
</xsl:attribute>
</xsl:if>
<header> <header>
<h1> <h1>
<xsl:value-of select="@TEXT"/> <xsl:value-of select="@TEXT"/>
...@@ -66,28 +92,32 @@ ...@@ -66,28 +92,32 @@
</xsl:element> </xsl:element>
</xsl:template> </xsl:template>
<!-- Paragraph -->
<xsl:template match="node[contains(@TEXT, '#p')]" priority="2"> <xsl:template match="node[contains(@TEXT, '#p')]" priority="2">
<xsl:element name="p"> <xsl:element name="p">
<xsl:value-of select="utc:string-remove-all(@TEXT, '#p ')"/> <xsl:value-of select="utc:string-remove-order(utc:string-remove-all(@TEXT, '#p '))"/>
</xsl:element> </xsl:element>
</xsl:template> </xsl:template>
<!-- Link : need to use anchor attribute ? -->
<xsl:template match="node[contains(@TEXT, '#a')]" priority="2"> <xsl:template match="node[contains(@TEXT, '#a')]" priority="2">
<xsl:element name="a"> <xsl:element name="a">
<xsl:attribute name="href"> <xsl:attribute name="href">
<xsl:text>#</xsl:text> <xsl:text>#</xsl:text>
<xsl:value-of select="utc:string-remove-all(@TEXT, '#a ')"/> <xsl:value-of select="utc:string-remove-order(utc:string-remove-all(@TEXT, '#a '))"/>
</xsl:attribute> </xsl:attribute>
<xsl:value-of select="utc:string-remove-all(@TEXT, '#a ')"/> <xsl:value-of select="utc:string-remove-order(utc:string-remove-all(@TEXT, '#a '))"/>
</xsl:element> </xsl:element>
</xsl:template> </xsl:template>
<!-- Default behavior for intro and conclu nodes : do nothing -->
<xsl:template match="node[contains(@TEXT, '#intro')] | node[contains(@TEXT, '#conclu')]" priority="3"/>
<xsl:template match="richcontent"> <xsl:template match="richcontent">
<xsl:value-of select="html/body/p"/> <xsl:value-of select="html/body/p"/>
</xsl:template> </xsl:template>
<!-- Utility functions --> <!-- Utility functions -->
<xsl:function name="utc:string-remove-all" as="xs:string"> <xsl:function name="utc:string-remove-all" as="xs:string">
<xsl:param name="text" as="xs:string"/> <xsl:param name="text" as="xs:string"/>
<xsl:param name="replace" as="xs:string"/> <xsl:param name="replace" as="xs:string"/>
...@@ -97,7 +127,7 @@ ...@@ -97,7 +127,7 @@
<xsl:with-param name="replace" select="$replace"/> <xsl:with-param name="replace" select="$replace"/>
</xsl:call-template> </xsl:call-template>
</xsl:variable> </xsl:variable>
<xsl:value-of select="$ret"></xsl:value-of> <xsl:value-of select="$ret"/>
</xsl:function> </xsl:function>
<xsl:template name="string-remove-all"> <xsl:template name="string-remove-all">
...@@ -116,4 +146,11 @@ ...@@ -116,4 +146,11 @@
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:template> </xsl:template>
<xsl:function name="utc:string-remove-order" as="xs:string">
<xsl:param name="text" as="xs:string?" />
<xsl:variable name="text2" select="string($text)"/>
<xsl:value-of select="replace($text2,'#[1-9][0-9]* ','')"></xsl:value-of>
</xsl:function>
</xsl:stylesheet> </xsl:stylesheet>
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
<target name="opale_conversion.windows"> <target name="opale_conversion.windows">
<echo>This is a Windows machine.</echo> <echo>This is a Windows machine.</echo>
<copy file="${resultFile}/hdoc/${hdocName}.hdoc" todir="${basedir}/../hdoc_to_opale/input/${hdocName}.hdoc"/> <copy file="${resultFile}/hdoc/${hdocName}.hdoc" todir="${basedir}/../hdoc_to_opale/input"/>
<exec dir="." executable="cmd"> <exec dir="." executable="cmd">
<arg value="${basedir}/../hdoc_to_opale/run.bat"/> <arg value="${basedir}/../hdoc_to_opale/run.bat"/>
</exec> </exec>
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
<target name="opale_conversion.unix"> <target name="opale_conversion.unix">
<echo>This is an Unix machine.</echo> <echo>This is an Unix machine.</echo>
<copy file="${resultFile}/hdoc/${hdocName}.hdoc" todir="${basedir}/../hdoc_to_opale/input/${hdocName}.hdoc"/> <copy file="${resultFile}/hdoc/${hdocName}.hdoc" todir="${basedir}/../hdoc_to_opale/input"/>
<exec dir="." executable="/bin/sh"> <exec dir="." executable="/bin/sh">
<arg value="${basedir}/../hdoc_to_opale/run.sh"/> <arg value="${basedir}/../hdoc_to_opale/run.sh"/>
</exec> </exec>
......
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