Commit c853c8cc authored by Aghiles's avatar Aghiles
Browse files

Merge branch 'master' of https://gitlab.utc.fr/crozatst/hdoc

parents 2ea5f2f6 16fe948d
@echo off
set lib=lib
set ant=hdoc_to_epub.ant
set ant=hdoc_to_epub2.ant
set antparam=-Dprogram.param=%1
set scJarList=%lib%\*
......
#!/bin/sh
lib="lib"
ant="hdoc_to_epub.ant"
ant="hdoc_to_epub2.ant"
antparam="-Dprogram.param=$1"
#Recherche de java et controle que se soit une version SUN
......
......@@ -59,6 +59,9 @@
<xsl:template match="section" priority="3">
<xsl:element name="h{count(ancestor::section)+1}">
<xsl:if test="section[@data-hdoc-type='exercise']">
Exercice :
</xsl:if>
<xsl:value-of select="header/h1"/>
</xsl:element>
<xsl:apply-templates select="div|section"/>
......@@ -66,116 +69,126 @@
<xsl:template match="h6" priority="3"/>
<xsl:template match="//div[@data-hdoc-type='remark']" priority="4">
<div class="noCut">
<xsl:template match="//div[@data-hdoc-type='emphasis']" priority="4">
<h3>
Fondamental :
<xsl:if test="h6">
<span class="textTitle"><xsl:value-of select="h6"/></span>
<xsl:value-of select="h6"/>
</xsl:if>
<span class="title">Remarque</span>
</h3>
<div class="border">
<div class="border-top-bot">
<xsl:apply-templates/>
</div>
</div>
</xsl:template>
<xsl:template match="//div[@data-hdoc-type='emphasis']" priority="4">
<div class="noCut">
<xsl:template match="//div[@data-hdoc-type='definition']" priority="4">
<h3>
Définition :
<xsl:if test="h6">
<span class="textTitle"><xsl:value-of select="h6"/></span>
<xsl:value-of select="h6"/>
</xsl:if>
<span class="title">Fondamental</span>
</h3>
<div class="border">
<div class="border-top-bot">
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template match="//div[@data-hdoc-type='remark']" priority="4">
<h3>
Remarque :
<xsl:if test="h6">
<xsl:value-of select="h6"/>
</xsl:if>
</h3>
<div>
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template match="//div[@data-hdoc-type='complement']" priority="4">
<div class="noCut">
<h3>
Complément :
<xsl:if test="h6">
<span class="textTitle"><xsl:value-of select="h6"/></span>
<xsl:value-of select="h6"/>
</xsl:if>
<span class="title">Complément</span>
</h3>
<div class="border">
<div>
<xsl:apply-templates/>
</div>
</div>
</xsl:template>
<xsl:template match="//div[@data-hdoc-type='example']" priority="4">
<div class="noCut">
<h3>
Exemple :
<xsl:if test="h6">
<span class="textTitle"><xsl:value-of select="h6"/></span>
<xsl:value-of select="h6"/>
</xsl:if>
<span class="title">Example</span>
</h3>
<div class="border">
<div>
<xsl:apply-templates/>
</div>
</div>
</xsl:template>
<xsl:template match="//div[@data-hdoc-type='syntax']" priority="4">
<div class="noCut">
<h3>
Syntaxe :
<xsl:if test="h6">
<span class="textTitle"><xsl:value-of select="h6"/></span>
<xsl:value-of select="h6"/>
</xsl:if>
<span class="title">Syntaxe</span>
</h3>
<div class="border">
<div>
<xsl:apply-templates/>
</div>
</div>
</xsl:template>
<xsl:template match="//div[@data-hdoc-type='warning']" priority="4">
<div class="noCut">
<h3 class="warning">
<h3>
Attention :
<xsl:if test="h6">
<span class="textTitle"><xsl:value-of select="h6"/></span>
<xsl:value-of select="h6"/>
</xsl:if>
<span class="title">Attention</span>
</h3>
<div class="borderWarning">
<div>
<xsl:apply-templates/>
</div>
</div>
</xsl:template>
<xsl:template match="//div[@data-hdoc-type='advice']" priority="4">
<div class="noCut">
<h3>
Conseil :
<xsl:if test="h6">
<span class="textTitle"><xsl:value-of select="h6"/></span>
<xsl:value-of select="h6"/>
</xsl:if>
<span class="title">Conseil</span>
</h3>
<div class="border">
<div>
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template match="//div[@data-hdoc-type='description']" priority="4">
<h4>
Description :
</h4>
<div>
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template match="//div[@data-hdoc-type='definition']" priority="4">
<div class="noCut">
<h3>
<xsl:if test="h6">
<span class="textTitle"><xsl:value-of select="h6"/></span>
</xsl:if>
<span class="title">Définition</span>
</h3>
<div class="border">
<xsl:template match="//div[@data-hdoc-type='question']" priority="4">
<h4>
Question :
</h4>
<div>
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template match="//div[@data-hdoc-type='solution']" priority="4">
<h4>
Solution :
</h4>
<div>
<xsl:apply-templates/>
</div>
</xsl:template>
......@@ -184,23 +197,10 @@
</xsl:template>
<xsl:template match="//img" priority="4">
<!--<div class="imageWrapperHi">
<xsl:element name="img">
<xsl:attribute name="src">../images/<xsl:value-of select="./@alt"/></xsl:attribute>
<xsl:attribute name="alt"><xsl:value-of select="./@alt"/></xsl:attribute>
</xsl:element>
</div>-->
<div class="imgContainer1">
<div class="imgContainer2">
<xsl:element name="img">
<img width="300px">
<xsl:attribute name="src">../images/<xsl:value-of select="./@alt"/></xsl:attribute>
<xsl:attribute name="alt"><xsl:value-of select="./@alt"/></xsl:attribute>
</xsl:element>
</div>
</div>
</img>
</xsl:template>
<xsl:template match="//a[not(starts-with(@href,'http'))]" priority="4">
......
......@@ -8,6 +8,9 @@
<xsl:template name="metadata">
<metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
<dc:title><xsl:value-of select="head/title"/></dc:title>
<xsl:for-each select="head/meta[@name='keywords']">
<dc:subject><xsl:value-of select="."/></dc:subject>
</xsl:for-each>
<dc:creator><xsl:value-of select="head/meta[@name='author']/@content"/></dc:creator>
<dc:language>fr</dc:language>
<dc:identifier id="BookID">V2.0</dc:identifier>
......
......@@ -12,16 +12,30 @@ Kapilraj Thangeswaran
This module is able to extract data from a file in Hdoc format and insert them into MongoDB.
## Dependencies
In order to work properly this module needs
- In order to make this module work you have to download and install Node.js from the [Node.js download page](https://nodejs.org/en/).
- If needed, download and install MongoDB from the [MongoDB download page](https://www.mongodb.com/download-center#community).
In order to work properly this module needs :
- to download and install Node.js
- For windows :
- from the [Node.js download page](https://nodejs.org/en/)
- For linux (instruction for debian 8, may vary depending on your distrbution) execute the followings commands :
- `su`
- `apt install nodejs`
- `apt install node`
- `apt install npm`
- `npm link mongodb` from hdoc_to_mongo folder
- to download and install MongoDB
- For Windows :
- from the [MongoDB download page](https://www.mongodb.com/download-center#community)
- For linux :
- `su & apt install mongodb`
## Instructions
1. Install dependencies
2. Add all your hdoc documents in an "input" folder
3. Add or edit "config.xml" file in "input" folder (for more details, please check "Input configuration")
4. Edit "config.json" file from "mongo" folder (for more details, please check "Mongo configuration")
5. Execute run.bat or run.sh
5. Make sure that MongoDB is running (`mongod.exe --rest --jsonp` command from "MongoDB/Server/3.2/bin" folder)
6. Execute run.bat or chmod +x run.sh & ./run.sh
## Web
This module provides a Web application to access MongoDB and execute simples requests.
......
......@@ -58,9 +58,27 @@
<delete dir="${tmpdir}" />
</target>
<target name="mongoDB" depends="main">
<condition property="isWindows">
<os family="windows" />
</condition>
<condition property="isUnix">
<os family="unix" />
</condition>
<target name="windowsMongoDB" if="isWindows" depends="main">
<exec executable="node" dir="mongo">
<arg line="main.js"/>
</exec>
</target>
<target name="linuxMongoDB" if="isUnix" depends="main">
<exec executable="nodejs" dir="mongo">
<arg line="main.js"/>
</exec>
</target>
<target name="mongoDB" depends="windowsMongoDB, linuxMongoDB">
<echo>End</echo>
</target>
</project>
\ No newline at end of file
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