Commit c853c8cc authored by Aghiles's avatar Aghiles
Browse files

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

parents 2ea5f2f6 16fe948d
......@@ -8,10 +8,17 @@
</taskdef>
<property file="build.properties"/>
<!-- Parcours la liste des fichiers pour les transformer -->
<target name="targetAllFiles">
<!-- Check if input directory is empty -->
<target name="check.dir">
<fileset dir="${inputPath}" id="fileset">
<include name="*.scar"/>
</fileset>
<pathconvert refid="fileset" property="dir.contains-files" setonempty="false"/>
</target>
<!-- Use converter on all files in input -->
<target name="targetAllFiles" depends="check.dir" if="dir.contains-files">
<delete>
<fileset dir="${outputPath}">
<include name="*.json"/>
......@@ -35,9 +42,18 @@
</target>
<!-- Tell user that he needs to provide input -->
<target name="noFileToUse" depends="check.dir" unless="dir.contains-files">
<delete>
<fileset dir="${outputPath}">
<include name="*.json"/>
</fileset>
</delete>
<echo message="You need to provide file in input directory." />
</target>
<!-- Clear tmp files -->
<target name="clean" depends="targetAllFiles">
<target name="clean" depends="targetAllFiles, noFileToUse" if="dir.contains-files">
<echo message="Clean files" />
<!-- -->
<delete includeemptydirs="true" verbose="true">
......
Hdoc to Epub
------------
License
-------
http://www.gnu.org/licenses/gpl-3.0.txt
Credits
-------
### Autumn 2016
* Biagianti Marie
* Couturier Valentin
Presentation
------------
"Opale to Epub2" is an opale converter to epub2 files. It's a set of ANT scripts and XSL files
Dependencies
------------
There's no particular dependencies needed to run the converter.
User Documentation
------------------
### Scenario
Supported
---------
Image : JPEG, JPG, PNG
Gestion du multifichiers en input
Hypertexte
Unsupported
-----------
### EPUB2
ODG : non supporté en EPUB => "Élément non supporté en EPUB : <xsl:value-of select="@data"/>"
CSS3
HTML5
SVG
(voir https://mpsltd.wordpress.com/2011/05/25/epub-3-vs-epub-2-0-2/)
### Conversion
Exercices
Méthode et Rappels (data-hdoc-type)
Known bugs
----------
Problème dans le hdoc : contient des images mais ne sont pas référencées.
Problème dans le hdoc : impossible de savoir quand il y a du code.
Problème avec les keywords : le hdoc contient des keywords mais nous ne savons pas où les utiliser.
Todo list
---------
tester avec SVG
Repérer le problème avec le css
Faire l'affichage des exercices
Faire l'affichage des nouveaux types : Méthode et Rappels
Technical Notes
---------------
Il est déconseillé de justifier le texte pour des raisons de lisibilité sur les liseuses.
input=${basedir}/input
output=${basedir}/output
inputOpaleToHdoc=${basedir}/../opale_to_hdoc/input
outputOpaleToHdoc=${basedir}/../opale_to_hdoc/output
antOpaleToHdoc=${basedir}/../opale_to_hdoc/opale_to_hdoc.ant
inputHdocToEpub2=${basedir}/../hdoc_to_epub2/input
outputHdocToEpub2=${basedir}/../hdoc_to_epub2/output
antHdocToEpub2=${basedir}/../hdoc_to_epub2/hdoc_to_epub2.ant
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project name="hdoc_to_epub2" basedir="." default="preparation">
<taskdef resource="net/sf/antcontrib/antlib.xml"/>
<taskdef name="jing" classname="com.thaiopensource.relaxng.util.JingTask"/>
<property file="build.properties"/>
<target name="preparation">
<delete>
<fileset dir="${inputOpaleToHdoc}" includes="**/*.scar"/>
</delete>
<delete>
<fileset dir="${inputHdocToEpub2}" includes="**/*.hdoc"/>
</delete>
<delete dir="${output}"/>
<mkdir dir="${output}"/>
<chmod perm="777" dir="${output}"></chmod>
<sequential>
<antcall target="opaleToHdoc">
<param name="filename" value="${filename}"/>
</antcall>
<antcall target="hdocToEpub2">
<param name="filename" value="${filename}"/>
</antcall>
<antcall target="opaleToEpub2">
<param name="filename" value="${filename}"/>
</antcall>
</sequential>
</target>
<target name="opaleToHdoc">
<copy todir="${inputOpaleToHdoc}" >
<fileset dir="${input}" includes="**/*.scar"/>
</copy>
<ant antfile="${antOpaleToHdoc}" inheritAll="false"/>
</target>
<target name="hdocToEpub2">
<copy todir="${inputHdocToEpub2}" >
<fileset dir="${outputOpaleToHdoc}" includes="**/*.hdoc"/>
</copy>
<ant antfile="${antHdocToEpub2}" inheritAll="false"/>
</target>
<target name="opaleToEpub2">
<copy todir="${output}" >
<fileset dir="${outputHdocToEpub2}" includes="**/*.epub"/>
</copy>
</target>
</project>
@echo off
set lib=lib
set ant=opale_to_epub2.ant
set antparam=-Dprogram.param=%1
set scJarList=%lib%\*
java.exe -classpath "%scJarList%" -Xmx150m org.apache.tools.ant.Main -buildfile %ant% %antparam%
pause
REM start /MIN java.exe -classpath "%scJarList%" -Xmx150m org.apache.tools.ant.Main -buildfile %ant% %antparam%
#!/bin/sh
lib="lib"
ant="opale_to_epub2.ant"
antparam="-Dprogram.param=$1"
#Recherche de java et controle que se soit une version SUN
vJavaCmd="java"
xCheckJava () {
vInputVarName=\$"$1"
vInputVarVal=`eval "expr \"$vInputVarName\" "`
if [ -z "$vInputVarVal" ];then
eval "$1=false"
return
fi
vSunJavaFound=`$vInputVarVal -version 2>&1 | grep -Eo -m 1 "(HotSpot)|(OpenJDK)"`
if [ "$vSunJavaFound" != "HotSpot" ] && [ "$vSunJavaFound" != "OpenJDK" ] ; then
eval "$1=false"
return
fi
}
xCheckJava vJavaCmd
if [ "$vJavaCmd" = "false" ]; then
vJavaCmd="$JAVA_HOME/bin/java"
xCheckJava vJavaCmd
if [ "$vJavaCmd" = "false" ]; then
echo "ERREUR: JRE de SUN introuvable. Veuillez déclarer la variable d'environnement JAVA_HOME."
exit 1
fi
fi
#Lancer la commande
scJarList="$lib/*"
$vJavaCmd -classpath "$scJarList:" -Xmx150m org.apache.tools.ant.Main -buildfile $ant $antparam
!input/.gitkeep
!output/.gitkeep
\ No newline at end of file
......@@ -32,6 +32,14 @@
<!-- MODULE's COMPONENTS -->
<body>
<xsl:apply-templates select="child::*[name() != 'op:ueM']"/>
<section data-hdoc-type="references">
<header>
<h1>Liste des grains liés</h1>
</header>
<li>
<xsl:apply-templates mode="ref" select=".//sp:comp[op:pbTi/sp:title = 'Voir aussi']"/>
</li>
</section>
</body>
</html>
</xsl:template>
......@@ -536,5 +544,11 @@
</xsl:template>
<xsl:template match="*"/>
<xsl:template mode="ref" match="sp:comp[op:pbTi/sp:title = 'Voir aussi']">
<xsl:for-each select="./op:res//sc:uLink">
<ul><xsl:value-of select="."/> - <xsl:value-of select="./@sc:refUri"/></ul>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
......@@ -12,18 +12,32 @@ Kapilraj Thangeswaran
This module is able to extract data from a file in Opale 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 :
- [`opale_to_hdoc`](https://gitlab.utc.fr/crozatst/hdoc/tree/master/opale_to_hdoc) (Opale to Hdoc conversion)
- [`hdoc_to_mongo`](https://gitlab.utc.fr/crozatst/hdoc/tree/master/hdoc_to_mongo) (Hdoc to Mongo conversion)
- 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 in "hdoc_to_mongo" module (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
## Input configuration
You can add or edit "config.xml" in "input" folder to provide more information about your documents.
......
#!/bin/sh
#!/bin/bash
lib="lib"
ant="opale_to_mongo.ant"
antparam="-Dprogram.param=$1"
......@@ -31,6 +31,4 @@ fi
#Lancer la commande
scJarList="$lib/*"
npm link mongodb
$vJavaCmd -classpath "$scJarList:" -Xmx150m org.apache.tools.ant.Main -buildfile $ant $antparam
rm -rf node_modules
$vJavaCmd -classpath "$scJarList:" -Xmx150m org.apache.tools.ant.Main -buildfile $ant $antparam
\ No newline at end of file
Converter hdoc_to_neo4j
-----------------------
The purpose of this converter is to obtain a file of Neo4j requests from .scar format.
License GPL3.0
--------------
http://www.gnu.org/licenses/gpl-3.0.txt
Credits
-------
* Alié Félix
* Routier Clément
Dependance
----------
This project can be used alone if you only want to convert a .scar into a Neo4j requests file or directly insert data in neo4j local database.
WARNINGS:
1) If you want to insert data automatically in a database, you need to have nodeJS installed!
Windows: https://nodejs.org/en/ and download + install the last stable version
Linux: install with your distribution's package manager
2) You need to configure the ../hdoc_to_neo4j/node/config.json file properly to fit with the parameters of the dabase you want to insert in. (host, db and password).
User documentation
------------------
You have to respect the following steps :
1 - Placer un ou plusieurs archives (format scar) dans le dossier input
2 - Modifier le fichier config.json (dans le dossier ../hdoc_to_neo4j/node) avec la base de données locale et le mot de passe personnel (base publique à venir)
3 - Lancer le fichier runWithNode (choisissez l'extension selon votre OS)
4 - Admirez le graph créé avec neo4j dans votre navigateur (sur localhost:7474)
Unsupported
-----------
There is no shared public database for now.
The "References" links are not fully supported yet. The opale_to_hdoc part is done, but needs an implementation in hdoc_to_neo4j.
Known bugs
----------
Todo
----
Technical notes
---------------
Capitalisation
--------------
\ 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