Commit b91fb2d1 authored by qaomia's avatar qaomia

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

parents 1d5b9e15 c60f2227
# Etherpad To Lexique -- HDOC CONVERTER PROJECT
Comment récupérer un document de type Etherpad et le transformer en document lexique.
*les chemins d'accès indiqués sont relatifs à ce fichier readme*
1. Télécharger un document Etherpad en format HTML
1. Créer ou rejoindre un document etherpad puis l'exporter sous un format html (bouton `Importer/Exporter`)
2. **Enregistrer le document sous le nom `pad.html`** dans le dossier `/input` (si le dossier n'existe pas, le créer)
NB: il ne doit pour le moment n'y avoir qu'un seul fichier nommé de cette façon.
2. Exécuter le fichier `/run.bat` ou `/run.sh` selon l'OS ; un fichier `.scar` est créé dans le dossier `/output`
3. Ouvrir le document produit avec lexique
1. Ouvrir Scenari, ouvrir la liste des entrepôts distants et choisir UTC-etu_lexique.
2. Aller dans le dossier sandBox/etherpad-to-lexique.
3. Réaliser un cliquer glisser avec votre fichier `.scar` dans le dossier ou bien faire un clic droit sur le dossier puis Importer.
4. Ouvrir le fichier Main.xml nouvellement créé.
\ No newline at end of file
# Etherpad2Lexique -- HDOC CONVERTER PROJECT
## License
[GPL 3.0](http://www.gnu.org/licenses/gpl-3.0.txt)
## Credits
- Rit Gabrielle
- Vintache Jean
- Douteau Jean-Côme
- Fecherolle Cécile (2014)
##Presentation
How to transform an etherpad document in lexique document.
Filepath in this document are relative to this file readme.
## Dependence
- Etherpad2Hdoc
- Hdoc2Lexique
## User Documentation
1. Download an etherpad document in html format.
1. Create or join an etherpad document then export it in html format (Import/Export Button) in the `/input` directory (if the directory does not exists, you have to create it).
2. Name it pad.html
2. Execute the file `/run.bat` or `/run.sh` depending on the OS. A `.scar` file is created in the directory `/output`
*If the `/input` directory contains multiple files, they won't be all treated.
3. Open the document with Scenari
1. Open Scenari, and choose "UTC-etu_lexique" as distant depot.
2. Go in the directory `sandBox/etherpad-to-lexique.`
3. Import your `.scar` file in the directory.
4. Open the file Main.xml created.
##Unsupported
- MarkDown
- Timeline and author paternity
- Chat
##Known bugs
Nested lists in lists are not supported
example :
`<ul>
<li>
<ul>
<li>
Never gonna let you down.
</li>
</ul>
</li>
<ul>`
## TODO
- Work with markdown
- Correct nested lists
## Technical notes
### Description of etherpad_to_hdoc.ant
#### Prelude
- Importation of necessary classes (antlib, htmlcleaner, jing)
- Creation of directories architecture tree
#### Transformations
- Use of htmlcleaner to transform the input file from html to xhtml. For more info, see http://htmlcleaner.sourceforge.net/index.php.
- Apply html2xhtml.xsl : this xsl extracts the content into <body> tags
- Apply html2xhtmlv1.xsl : this xsl is used as a fix and adds br tag at the end of lists (ul and ol)
- Apply html2xhtmlv2.xsl : this xsl surround text line with p tags and transforms non-hdoc tags into hdoc tags as s, u, strong tags.
- Apply html2xhtml3.xsl : this xsl is used as a fix, it deletes p tags when its child is ul or ol
- Apply xhtml2hdoc.xsl : this xsl transforms the content into hdoc structure
#### Post-transformations actions
- Build hdoc structure
- Jing checks if the output file is validated with the right rng schema
- Zip the directory into hdoc archive
## Capitalisation
......@@ -18,8 +18,8 @@ Filepath in this document are relative to this file readme.
2. Name it pad.html
2. Execute the file `/run.bat` or `/run.sh` depending on the OS. A `.scar` file is created in the directory `/output`
*If the `/input` directory contains multiple files, they won't be all treated.
3. Open the document with Optim
1. Open Scenari, and choose "UTC-etu_opale" as distant depot.
3. Open the document with Scenari
1. Open Scenari, and choose "UTC-etu_optim" as distant depot.
2. Go in the directory `sandBox/etherpad-to-otpim.`
3. Import your `.scar` file in the directory.
4. Open the file Main.xml created.
......
Mindmapping to HDOC
===================
Mindmapping to Opale
=================
Conversion of Freemind file(s) (.mm) to Opale
**Conversion of Freemind file(s) (.mm) to Opale**
# How to use the converter
## Licence
-------------------------------
http://www.gnu.org/licenses/gpl-3.0.txt
Use a terminal and go to the root of the folder (mindmapping_to_opale).
## Credits
-------------------------------
This section has been written by
* Thibault BROCHETON
* Bastien FREMONDIERE
* Amélie PERDRIAUD
It is based on the work of Guillaume GOMEZ in 2014.
## Dependence
-------------------------------
In dependence with mindmapping_to_hdoc and hdoc_to_opale
## User documentation
-------------------------------
#1 : You want to convert SEVERAL Freemind files in Opale
- Put your files in a folder mindmapping_to_opale/input
- Enter the command line corresponding to your OS :
- On Linux : sh run.sh
- On Windows : run.bat
Use a terminal and go to the root of the folder (mindmapping_to_opale).
#2 : You want to convert ONE specific freemindFile in Opale
- Put your file in a folder mindmapping_to_opale/input
- Enter the command line corresponding to your OS :
- On Linux : sh run.sh -DinputPath input/<yourFilename>
- On Windows : run.bat -DinputPath input/<yourFilename>
### 1. You want to convert SEVERAL Freemind files in Opale
You will find the result in the folder mindmapping_to_opale/output
* Please refer to the part *Rules to follow* to understand the rules that can help you to personalize the output
* Put your files in a folder 'mindmapping_to_opale/input'
* Enter the command line corresponding to your OS :
* On Linux : 'sh run.sh'
* On Windows : 'run.bat'
If you want to convert one specific file that is in the input folder, use the parameters ' -DinputPath input/<yourFilename>' (ex : 'sh run.sh -DinputPath input/<yourFilename>')
*You will find the result of the conversion in the folder mindmapping_to_opale/output*
*You can find a sample file il the folder /samples.*
IMPORTANT
=========
### Rules to follow
You can use special rules in Freemind to personnalize your Scenari Module :
- By default, a "Division" is created with the name of the main node of your MindMap
- Then :
A node without children is transformed in grain content
A node with children is transformed in division
- You can add introduction and conclusion using the hashtag #intro and #conclu on all the node that has no child
- You can use #p to create a paragraph, and #a to create a link
- You can use the hashtag :
#rmk : a remark
#adv : an advice
#emph : an emphasis
#compl : a complement
#wrng : a warning
#ex : an example
#def : a definition
Then you can add some #p inside these node to create the content
- You can arrange the order of the node usine the hashtag #1, #2, #3 etc.
* By default, a "Division" is created with the name of the main node of your MindMap
* Then :
* A node without children is transformed in **grain content**
* A node with children is transformed in **division**
* You can add introduction and conclusion using the hashtag **#intro** and **#conclu** on all the node that has no child
* You can use **#p** to create a paragraph, and **#a** to create a link
* You can use some hashtags to create specific contents :
* **#rmk** : a remark
* **#adv** : an advice
* **#emph** : an emphasis
* **#compl** : a complement
* **#wrng** : a warning
* **#ex** : an example
* **#def** : a definition
* *Then you can add some **#p** inside these node to create the content*
- You can arrange the order of the node usine the hashtag **#1, #2, #3** etc.
## Unsupported
* Convert colors
* Convert icon into summary elements
* HTML node
## Known bugs
## TODO
* Develop new hashtags to create other type of Opale contents (such as QCM, self-evaluation etc.)
## Technicals notes
### Preamble
This subsection will explain precisely how the conversion process works. If you are reading this, we assume you are familiar with XML technologies seen in NF29 (i.e. ANT scripts, XSL-XSLT transformations and Hdoc format). We also recommend you to open sources files and read the comments.
Besides, the converter have been tested on recent ANT versions (> 1.7.0) only. It depends on hdoc_to_opale module.
### How does the converter works
This converter is using standard NF29 conversion project structure : a main ANT file (mindmapping_to_opale.ant), which handles routine tasks (zipping archives, copying files, order tasks), XSL-XSLT transformation scripts calls. This main ANT file is composed of several targets, and supports both Windows or Linux platforms.
This ant file is called by a script (run.sh or run.bat), with ou without parameters.
### Hdoc files
During the conversion process, the converter is using the converter mindmapping_to_hodc. The result of this conversion is also available in the folder output.
### What does the main ANT file do ?
* Delete and create folder temp, output, output/hdoc and output/scar
* Check if the OS is Windows or Mac, and call the appropriate target
* If there is no input path in parameters, it converts all the files present in the input folder
* It calls the converter mindmapping_to_hdoc to convert .mm files in .hdoc files.
* Copy the results of the conversion in the folder /output/hdoc
* It calls the converter hdoc_to_opale to convert .hdoc files in .scar files
* Copy the results of the conversion in the folder /output/scar
* Finally, clean temporary files
## Capitalization
### New technologies/languages discovered
* ANT
* XPath
* XSL-XSLT
### New IDEs/frameworks discovered
* Oxygen XML editor
* Scenario chain (Opale advanced)
\ No newline at end of file
......@@ -166,9 +166,6 @@
</for>
</target>
<!--<target name="hdoc_conversion" depends="hdoc_conversion.input-path, hdoc_conversion.no-input-path" />
-->
<target name="preparation">
<echo>Setting up the conversion</echo>
<delete dir="${basedir}/temp"/>
......@@ -182,25 +179,4 @@
<echo>--- End ----</echo>
</target>
<!-- Convert a mindMap file into a hdoc, with a xsl schema specified in the parameter -->
<target name="Makehdoc">
<echo>Begin data conversion</echo>
<mkdir dir="${basedir}/temp/${hdocName}"/>
<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 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 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}/${hdocName}.hdoc" basedir="${basedir}/temp/${hdocName}"/>
<!-- </condition> -->
<echo>end data conversion</echo>
</target>
</project>
......@@ -4,8 +4,7 @@ Optim to Hdoc
Licence
-------
License GPL3.0
http://www.gnu.org/licenses/gpl-3.0.txt
This project is under [GPL 3.0](http://www.gnu.org/licenses/gpl-3.0.txt).
Credits
......
......@@ -73,4 +73,6 @@ Technical notes
Capitalization
--------------
While working on this project, we have learned more about ANT scripting (more specifically bulding an multi-os script and running scripts by detecting the OS) and about problem solving in general (how to go from one specific need to a result).
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