Commit f48c7084 authored by qaomia's avatar qaomia
Browse files

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

parents 25335a63 4b9bc80a
...@@ -3,17 +3,19 @@ ...@@ -3,17 +3,19 @@
License GPL3.0 License GPL3.0
http://www.gnu.org/licenses/gpl-3.0.txt http://www.gnu.org/licenses/gpl-3.0.txt
Credits : Université de Technologie de Compiègne, NF29 course students Credits :
Université de Technologie de Compiègne (http://www.utc.fr)
NF29 students (http://www4.utc.fr/~nf29)
## What is Hdoc ? ## What is Hdoc ?
Please refer to the [Hdoc converter project website](http://hdoc.crzt.fr)
>The aim of the project is to propose: Please refer to the Hdoc Converter Project website:
>- a generic XML schema based on XHTML5 for documentary purpose (Hdoc format);
>- a set of converters to transform document formats from and to Hdoc; http://hdoc.crzt.fr
>- a web site to manage the converters (Hdoc Converter Portal).
## What is this repository ? ## What is this repository ?
This repository gathers some of the Hdoc converters, if not all of them. This repository gathers some of the Hdoc converters, if not all of them.
Project URL : https://gitlab.utc.fr/crozatst/hdoc.git Project URL : https://gitlab.utc.fr/crozatst/hdoc.git
## How to use Hdoc Converters ? ## How to use Hdoc Converters ?
......
# Etherpad To Opale -- HDOC CONVERTER PROJECT # Etherpad2Opale -- HDOC CONVERTER PROJECT
Comment récupérer un document de type Etherpad et le transformer en document opale. ## License
[GPL 3.0](http://www.gnu.org/licenses/gpl-3.0.txt)
*les chemins d'accès indiqués sont relatifs à ce fichier readme* ## Credits
- Rit Gabrielle
1. Télécharger un document Etherpad en format HTML - Vintache Jean
1. Créer ou rejoindre un document etherpad puis l'exporter sous un format html (bouton `Importer/Exporter`) dans le dossier `/input` (si le dossier n'existe pas, le créer) - Douteau Jean-Côme
2. Exécuter le fichier `/run.bat` ou `/run.sh` selon l'OS ; un fichier `.scar` est créé dans le dossier `/output` - Fecherolle Cécile (2014)
*si le dossier `/input` contient plusieurs fichiers html, ils sont tous traités* ##Presentation
3. Ouvrir le document produit avec opale How to transform an etherpad document in opale document.
1. Ouvrir Scenari, ouvrir la liste des entrepôts distants et choisir UTC-etu_opale. Filepath in this document are relative to this file readme.
2. Aller dans le dossier sandBox/etherpad-to-opale. ## Dependence
3. Réaliser un cliquer glisser avec votre fichier `.scar` dans le dossier ou bien faire un clic droit sur le dossier puis Importer. - Etherpad2Hdoc
4. Ouvrir le fichier Main.xml nouvellement créé. - Hdoc2Opale
## 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. 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 will be all treated.
3. Open the document with Opale
1. Open Scenari, and choose "UTC-etu_opale" as distant depot.
2. Go in the directory `sandBox/etherpad-to-opale.`
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 give you up.
</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
# Etherpad To Optim -- HDOC CONVERTER PROJECT # Etherpad2Optim -- HDOC CONVERTER PROJECT
Comment récupérer un document de type Etherpad et le transformer en document optim. ## License
[GPL 3.0](http://www.gnu.org/licenses/gpl-3.0.txt)
*les chemins d'accès indiqués sont relatifs à ce fichier readme* ## Credits
- Rit Gabrielle
1. Télécharger un document Etherpad en format HTML - Vintache Jean
1. Créer ou rejoindre un document etherpad puis l'exporter sous un format html (bouton `Importer/Exporter`) - Douteau Jean-Côme
2. **Enregistrer le document sous le nom `pad.html`** dans le dossier `/input` (si le dossier n'existe pas, le créer) - Fecherolle Cécile (2014)
NB: il ne doit pour le moment n'y avoir qu'un seul fichier nommé de cette façon. ##Presentation
2. Exécuter le fichier `/run.bat` ou `/run.sh` selon l'OS ; un fichier `.scar` est créé dans le dossier `/output` How to transform an etherpad document in optim document.
3. Ouvrir le document produit avec optim Filepath in this document are relative to this file readme.
1. Ouvrir Scenari, ouvrir la liste des entrepôts distants et choisir UTC-etu_optim. ## Dependence
2. Aller dans le dossier sandBox/etherpad-to-optim. - Etherpad2Hdoc
3. Réaliser un cliquer glisser avec votre fichier `.scar` dans le dossier ou bien faire un clic droit sur le dossier puis Importer. - Hdoc2Optim
4. Ouvrir le fichier Main.xml nouvellement créé. ## 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 Optim
1. Open Scenari, and choose "UTC-etu_opale" 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.
##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
...@@ -11,12 +11,12 @@ Credits ...@@ -11,12 +11,12 @@ Credits
### Autumn 2015 ### Autumn 2015
* Ivan D'HALLUIN * Ivan D'HALLUIN
* JEFFREY DECORDE * Jeffrey DECORDE
* Jean-Baptiste MARTIN * Jean-Baptiste MARTIN
Presentation Presentation
------------ ------------
`optim_to_opale` is an ANT script that converts a file from Optim format to Opale format. It simply calls `optim_to_hdoc`and `hdoc_to_opale`scripts. `optim_to_opale` is an ANT script that converts a file from Optim format to Opale format. It simply calls `optim_to_hdoc` and `hdoc_to_opale` scripts.
Dependencies Dependencies
------------ ------------
...@@ -30,25 +30,28 @@ User Documentation ...@@ -30,25 +30,28 @@ User Documentation
### Running the script ### Running the script
1. Put the file you want to convert into the `input` directory 1. Put the file you want to convert into the `input` directory
2. Run the `run.sh`file on a Unix system (Linux, Mac OS, etc.) or the `run.bat`on Windows 2. Run the `run.sh` file on a Unix system (Linux, Mac OS, etc.) or the `run.bat` on Windows
3. Your converted file is placed into the `output` directory (a log file is also placed into the `log`directory) 3. Your converted file is placed into the `output` directory (a log file is also placed into the `log` directory)
4. Enjoy! 4. Enjoy!
### How is this script working ### How is this script working
1. The script first determines what OS you are using so it then can call the right scripts 1. The script first determines what OS you are using so it then can call the right scripts
2. It cleans the `log`, `tmp`and `output`directories 2. It cleans the `log`, `tmp` and `output` directories
3. It copies the files that are inside the `input`directory to the `input` directory of `optim_to_hdoc` 3. It copies the files that are inside the `input` directory to the `input` directory of `optim_to_hdoc`
4. It calls `optim_to_hdoc`run script (`.bat` on windows, `.sh`on Unix) 4. It calls `optim_to_hdoc` run script (`.bat` on windows, `.sh` on Unix)
5. It copies the files that are inside the `output`directory of `optim_to_hdoc` to the `input` directory of `hdoc_to_opale` 5. It copies the files that are inside the `output` directory of `optim_to_hdoc` to the `input` directory of `hdoc_to_opale`
6. It calls `hdoc_to_opale`run script (`.bat` on windows, `.sh`on Unix) 6. It calls `hdoc_to_opale` run script (`.bat` on windows, `.sh` on Unix)
7. It copies the files that are inside the `output`directory of `hdoc_to_opale` to the `output` directory of `optim_to_opale` 7. It copies the files that are inside the `output` directory of `hdoc_to_opale` to the `output` directory of `optim_to_opale`
During all the process it also prints some basic information both on screen and in the log file. During all the process it also prints some basic information both on screen and in the log file.
Unsupported Unsupported
----------- -----------
* The script currently doesn't support any paramater to specify the file to convert. If multiple files are in the `input`directory, the script will convert all these files.
### Single file conversion with parameter
The script currently doesn't support any paramater to specify the file to convert. If multiple files are in the `input` directory, the script will convert all these files.
Known bugs Known bugs
---------- ----------
...@@ -57,6 +60,14 @@ N/A for now. ...@@ -57,6 +60,14 @@ N/A for now.
Todo Todo
---- ----
### Single file conversion with parameter
This feature requires that the same feature has been implementing in `optim_to_hdoc` and `hdoc_to_opale` first.
1. Add a parameter to the `ant` script and to both the `.bat` and `.sh` scripts to accept a filename (refering to a file placed into the `input` directory) to convert only one file
2. Don't clean `optim_to_hdoc` and `hdoc_to_opale` `input` directories: simply remove the lines in the `clean` target
3. Call `optim_to_hdoc` and `hdoc_to_opale` scripts by passing a parameter with the filename (this feature first needs to be implementing in `optim_to_hdoc` and `hdoc_to_opale`
Technical notes Technical notes
--------------- ---------------
......
Converter : Wikipedia_to_Hdoc Converter : Wikipedia_to_Hdoc
--------------- ===============
Licence : Licence :
--------------- ---------------
...@@ -17,8 +17,11 @@ Lhomme Nicolas ...@@ -17,8 +17,11 @@ Lhomme Nicolas
Previous developers Previous developers
Presentation
---------------
This converter transforms a wkipedia page (from a link or a saved page) to a Hdoc document.
Getting started User Documentation
--------------- ---------------
Use a terminal and go to the root of the folder (Wikipedia_to_hdoc). Use a terminal and go to the root of the folder (Wikipedia_to_hdoc).
......
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