Commit f75c2ed0 authored by Decorde Jeffrey's avatar Decorde Jeffrey

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

parents 28def063 c3c45f29
......@@ -5,9 +5,11 @@ License GPL3.0
http://www.gnu.org/licenses/gpl-3.0.txt
## Crédits
- 2015
- Jean-Côme Douteau
- Gabrielle Rit
- Jean Vintache
- 2014
- Fecherolle Cécile
## Presentation
......@@ -28,7 +30,7 @@ This module is able to convert several [etherpad](http://etherpad.org/) files (e
- Chat
## Known bugs
Nested lists in lists are not supported
- Nested lists in lists are not supported
Example :
`<ul>
<li>
......@@ -39,6 +41,7 @@ Example :
</ul>
</li>
<ul>`
- As a consequence, etherpad indentation is not supported because it is coded as nested lists.
## TODO
- Markdown
......
......@@ -4,6 +4,6 @@ tmp = ${basedir}/tmp
xsl = ${basedir}/xsl
lib = ${basedir}/lib
log = ${basedir}/log
schema = ${basedir}/schema
schema = ../schemas
rootfilename = content.xml
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<grammar
xmlns="http://relaxng.org/ns/structure/1.0"
xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
ns="urn:utc.fr:ics:hdoc:container"
>
<a:documentation>This schema describes the META-INF/container.xml file for hdoc format</a:documentation>
<a:documentation>This schema is a derivation of http://www.idpf.org/epub/30/schema/ocf-container-30.rnc
from EPUB Open Container Format (http://www.idpf.org/epub/30/spec/epub30-ocf.html)
</a:documentation>
<start>
<element name="container">
<attribute name="version">
<value>1.0</value>
</attribute>
<element name="rootfiles">
<element name="rootfile">
<attribute name="full-path">
<data type="anyURI"/>
</attribute>
<attribute name="media-type">
<value>text/xml</value>
</attribute>
</element>
</element>
</element>
</start>
</grammar>
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<grammar xmlns="http://relaxng.org/ns/structure/1.0"
xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
ns="http://www.utc.fr/ics/hdoc/xhtml">
<a:documentation>Last update : 2014-12-04</a:documentation>
<a:documentation>Changes since last update :
In order to manage quiz :
- Adding multiple-choice-question and fill-in-the-blank to section
- Adding question, choice-correct, choice-uncorrect and explanation to div
- Adding blank to span
- Externalizing ObjectType and VideoType from main schema
</a:documentation>
<!-- Type Microdata -->
<define name="SectionType">
<optional>
<attribute name="data-hdoc-type">
<choice>
<value>introduction</value>
<value>conclusion</value>
<value>unit-of-content</value>
<value>multiple-choice-question</value>
<value>fill-in-the-blank</value>
</choice>
</attribute>
</optional>
</define>
<define name="DivType">
<optional>
<attribute name="data-hdoc-type">
<choice>
<!-- block management -->
<value>emphasis</value>
<value>complement</value>
<value>definition</value>
<value>example</value>
<value>remark</value>
<value>warning</value>
<value>advice</value>
<!-- quiz management -->
<value>question</value>
<value>choice-correct</value>
<value>choice-incorrect</value>
<value>explanation</value>
</choice>
</attribute>
</optional>
</define>
<define name="SpanType">
<optional>
<attribute name="data-hdoc-type">
<choice>
<value>syntax</value>
<value>latex</value>
<!-- quiz management -->
<value>blank</value>
</choice>
</attribute>
</optional>
</define>
<define name="ObjectType">
<attribute name="type">
<choice>
<value>application/vnd.oasis.opendocument.graphics </value>
<value>application/vnd.oasis.opendocument.spreadsheet</value>
<value>application/pdf</value>
</choice>
</attribute>
</define>
<define name="VideoType">
<attribute name="type">
<choice>
<value>video/mp4</value>
<value>video/ogg</value>
<value>video/webm</value>
</choice>
</attribute>
</define>
</grammar>
# Converter hdoc_to_lexique
License GPL3.0
http://www.gnu.org/licenses/gpl-3.0.txt
##Crédits
Antoine Aufrechter, Estelle de Magondeaux, Marouane Hammi
##Install
In order to use this converter, follow those steps :
1. Copy your hdoc file (.scar or .zip) into the input directory. Do not put more than one file into the input directory.
2. Execute the run that correspond to your OS.
3. You will find the result into the output directory.
##User documentation
##Known bugs
>- Cannot put multiple input files
##TODO
>- Change the name of the file (.term) to the definition associated
>- Manage multiple input files (e.g. see lexique_to_opale)
>- list of element to convert :
>>- src url
>>- image
>>- pronounciation
>>- type (female, male,...) and (abbreviation, expanded,...)
>>- array
>>- multimedia
##Technical notes
>- The converter have to respect the same schema as the lexique_to_hdoc converter for the xslt
##Capitalisation
Ce convertisseur permet de convertir des fichiers du format Hdoc (.hdoc) en contenus Optim de type papier (.paper) ou diaporama (.slideshow)
Converter hdoc_to_optim
-----------------------
Il y a deux façons de réaliser votre conversion:
The purpose of this converter is to obtain an Optim document (paper or slideshow) from a html file that complies the hdoc schema.
- Lancer le script run. Dans ce cas vous devez ajouter votre fichier .hdoc dans le dossier input. Veillez à ne placer qu'un seul fichier dans ce dossier. Le format par défaut utilisé pour le fichier cible est le type papier.
License GPL3.0
--------------
http://www.gnu.org/licenses/gpl-3.0.txt
- En ligne de commande:
ant -buildfile hdoc_to_optim.ant
Credits
-------
Vous pouvez spécifier le fichier input, avec le paramètre -DInputFile, et le format de sortie avec le paramètre -DDocType (paper ou slideshow). Les deux paramètres sont optionnels.
Rihab HACHEM, Perrine RAVAUD (2014).
Exemple:
ant -buildfile hdoc_to_optim.ant -DDocType slideshow -DInputFile sample.hdoc
\ No newline at end of file
Dependance
----------
No dependance needed.
User documentation
------------------
There are two different ways to use the converter hdoc_to_optim: by running a script run.bat/run.sh or by command line using a terminal.
--- Running the script run.bat/run.sh:
Use this method if you do not want to use a terminal. D1. Download hdoc_converter.zip and unzip it.2. Add your source file to the Input folder.
3. Place only one file in that folder.
4. If you are using Linux, run the script run.sh. If you are using Windows, run the script run.bat.
5. Your file has been converted, the result is in the Output folder.
6. You can now open it with OptimOffice.
The default output document type used by this script is an Optim paper.
--- Terminal:
By using the terminal you can specify some parameters to the conversion : the source file, or the output type (either a paper or a slideshow).
1. Download hdoc_converter.zip and unzip it.
2. Open your terminal and go into the folder hdoc_to_optim.
3. Run the following command:
"ant -buildfile hdoc_to_optim.ant"
You can specify the source file, and the output document type by adding parameters to that command.
Use -DInputFile to specify the source file.
Use -DDocType to specify if it's a paper or a slideshow.
Exemple :"ant -buildfile hdoc_to_optim.ant -DDocType slideshow -DInputFile sample.hdoc"
Both parameters are optional.Your file has been converted, you can open your paper with OptimOffice.
Unsupported
-----------
- In paper and slideshow :
Inline : Superscript, Subscript
SpanType : Latex , Syntax- In slideshow :
Metadata : Description, Keywords
Known bugs
----------
No known bugs now.
Todo
----
- Offer the possibility of creating a website, or a webmedia document.
- For the slideshow, find a way to transform the metadata information (description, keywords) into something similar.- Integrate Concept trees.
Technical notes
---------------
The converter contains 5 files:
- hdoc_to_optim.ant :
When you launch the Converter (whether through the script or a terminal) it's the file hdoc_to_optim.ant that is launched, and executes the following files.
- find_content.xsl :
This XSLT program runs through the hdoc file container.xml to retrieve the path of the file to convert and creates a ANT script get_content.ant.
- find_ressources.xsl :
This XSLT program runs through the content file of hdoc to retrieve the path of each audio files, images and objects used in it and creates a ANT script get_ressources.ant.
- transfo.xsl (paper) :
This XSLT program runs through the content file of hdoc and convert each hdoc tag in Optim tags if possible. It converts it to a paper.
- transfo2.xsl (slideshow) :
This XSLT program runs through the content file of hdoc and convert each hdoc tag in Optim tags if possible. It converts it to a slideshow.
- .wspmeta :
This file contains Optim metadata informations, it must be placed in the result of the conversion
Capitalisation
--------------
Thanks to this project I deepened my knowledge in XSLT, ANT, RelaxNG Schema, and HTML.
I learned how to use OptimOffice.
......
<?xml version="1.0" encoding="UTF-8"?>
<sfm:jpg_jpeg xmlns:sc="http://www.utc.fr/ics/scenari/v3/core" xmlns:sfm="http://www.utc.fr/ics/scenari/v3/filemeta" xmlns:lx="scpf.org:lexicon">
<lx:imgM xmlns:sp="http://www.utc.fr/ics/scenari/v3/primitive">
<sp:title>Toronto, Canada</sp:title>
<sp:common>
<lx:commonM>
<sp:copyrightRes>Taxiarchos228</sp:copyrightRes>
<sp:licenseRes>
<lx:licenseM>
<sp:license>by</sp:license>
</lx:licenseM>
</sp:licenseRes>
</lx:commonM>
</sp:common>
<sp:alt>
<lx:altM>
<sp:alt>Vue nocturne sur le centre-ville</sp:alt>
</lx:altM>
</sp:alt>
</lx:imgM>
</sfm:jpg_jpeg>
\ No newline at end of file
<imgProps standardCharSize="10.319917440660474" rotateForbidden="true"/>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<sfm:jpg_jpeg xmlns:sc="http://www.utc.fr/ics/scenari/v3/core" xmlns:sfm="http://www.utc.fr/ics/scenari/v3/filemeta" xmlns:lx="scpf.org:lexicon">
<lx:imgM xmlns:sp="http://www.utc.fr/ics/scenari/v3/primitive">
<sp:alt>
<lx:altM>
<sp:alt>Répartition géographique des cinq types de climats français.</sp:alt>
<sp:desc>
<lx:sTxt>
<sc:para xml:space="preserve">Les cinq types de climats en France sont :</sc:para>
<sc:itemizedList>
<sc:listItem>
<sc:para xml:space="preserve">Hyper-océanique : Bretagne,</sc:para>
</sc:listItem>
<sc:listItem>
<sc:para xml:space="preserve">Montagnard : Pyrénées et Alpes,</sc:para>
</sc:listItem>
<sc:listItem>
<sc:para xml:space="preserve">Méditerranéen : côtes méditerranéennes et Corse,</sc:para>
</sc:listItem>
<sc:listItem>
<sc:para xml:space="preserve">Océanique : à l'ouest d'une ligne entre la Meuse et le Gers,</sc:para>
</sc:listItem>
<sc:listItem>
<sc:para xml:space="preserve">Océanique de transition : à l'est de cette même ligne.</sc:para>
</sc:listItem>
</sc:itemizedList>
</lx:sTxt>
</sp:desc>
</lx:altM>
</sp:alt>
</lx:imgM>
</sfm:jpg_jpeg>
\ No newline at end of file
<imgProps standardCharSize="15.29051987767584" rotateForbidden="true"/>
\ No newline at end of file
README.md
# Converter lexique_to_hdoc
License GPL.3.0
http://www.gnu.org/licenses/gpl-3.0.txt
Crédits
Estelle de Magondeaux
Antoine Aufrechter
Marouane Hammi
Install
In order to use this converter, follow those steps :
1. Copy your Lexique file (.scar or .zip) into the input directory.
2. Execute the run that correspond to your OS. (run.sh for linux, run.bat for ubuntu
3. You will find the result into the output directory.
1. Create a dictionnary "dictionnaire.xml" which referenciate every definition you want to put ini your hdoc. This dictionnary must respect the "dictionnaire.rng" schema
2. Copy the referenciated definitions in the same current path as the dictionnary (input)
3. Your input folder must contains the dictionnary (dictionnaire.xml) and the lexique definition (**.term).
4. Execute the run that correspond to your OS. (run.sh for linux, run.bat for ubuntu)
5. You will find the result into the output directory: it is named "content.xml".
Dependances
none.
User documentation
You will find a "help" directory taht contains:
- A saple of dictionnary that you neef to write and call "dictionnaire.xml".
- the lexique definition that you can choose to put into your hdoc (help/available_definition folder).
The generated folder is a .xml . If you desire to see the output in you browser, you need to rename it as a .html.
If you want to create more definitions with images and tables, you will need to put this ressources in the folder naed "&". It contains all the ressources which are copy-pasted in the output folder so they can de seen in the hdoc.
Unsupported
Audio and video transformation
Known bugs
TODO
create a better transformation for the ressources. At the moment the user needs to copy the ressources in a folder named "&". The best would be tomatch the ressources in every definitions, and to call an aNT which automatically copy the ressources needed in this folder.
Create a transformation which allows every audio resources to be seen in the hdoc.
Technical notes
If folders names are changed, you will need to change the tasks of the ANT file.
Capitalisation
README.md
# Converter lexique_to_hdoc
License GPL.3.0
http://www.gnu.org/licenses/gpl-3.0.txt
Crédits
Estelle de Magondeaux
Antoine Aufrechter
Marouane Hammi
Install
In order to use this converter, follow those steps :
1. Create a dictionnary "dictionnaire.xml" which referenciate every definition you want to put ini your hdoc. This dictionnary must respect the "dictionnaire.rng" schema
2. Copy the referenciated definitions in the same current path as the dictionnary (input)
3. Copy your ressources in a folder named "&", placed in the same current path as the dictionnary (input)
4. Your input folder must contains the dictionnary (dictionnaire.xml), the lexique definition (**.term), and the ressources folder(&).
5. Execute the run that correspond to your OS. (run.sh for linux, run.bat for ubuntu)
3. You will find the result into the output directory.
Dependance
User documentation
You will find a "help" directory taht contains:
- A saple of dictionnary that you neef to write and call "dictionnaire.xml".
- the lexique definition that you can choose to put into your hdoc (help/available_definition folder).
- a sample of the "&" folder that you need to copy in the input directory. At the moment the only 2 resources referenciated in all the definitions are there, so you can simply copy-paste this directory to the input directory.
The generated folder is a .xml . If you desire to see the output in you browser, you need to rename it as a .html.
Unsupported
Audio and video transformation
Known bugs
TODO
create a better transformation for the ressources. At the moment the user needs to copy the ressources in a folder named "&". The best would be tomatch the ressources in every definitions, and to call an aNT which automatically copy the ressources needed in this folder.
Create a transformation which allows every audio resources to be seen in the hdoc.
Technical notes
If folders names are changed, you will need to change the tasks of the ANT file.
Capitalisation
<?xml version="1.0" encoding="UTF-8"?>
<sfm:png xmlns:sc="http://www.utc.fr/ics/scenari/v3/core" xmlns:sfm="http://www.utc.fr/ics/scenari/v3/filemeta" xmlns:lx="scpf.org:lexicon">
<lx:imgM xmlns:sp="http://www.utc.fr/ics/scenari/v3/primitive">
<sp:alt>
<lx:altM>
<sp:alt>\nabla^2</sp:alt>
</lx:altM>
</sp:alt>
</lx:imgM>
</sfm:png>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<sfm:png xmlns:sc="http://www.utc.fr/ics/scenari/v3/core" xmlns:sfm="http://www.utc.fr/ics/scenari/v3/filemeta" xmlns:lx="scpf.org:lexicon">
<lx:imgM xmlns:sp="http://www.utc.fr/ics/scenari/v3/primitive">
<sp:alt>
<lx:altM>
<sp:alt>\nabla^2~f(M)=div[\overrightarrow{grad}~f(M)]</sp:alt>
</lx:altM>
</sp:alt>
</lx:imgM>
</sfm:png>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<sfm:png xmlns:sc="http://www.utc.fr/ics/scenari/v3/core" xmlns:sfm="http://www.utc.fr/ics/scenari/v3/filemeta" xmlns:lx="scpf.org:lexicon">
<lx:imgM xmlns:sp="http://www.utc.fr/ics/scenari/v3/primitive">
<sp:alt>
<lx:altM>
<sp:alt>\nabla^2f=\frac{\partial^2f}{\partial x^2}~+~\frac{\partial^2f}{\partial y^2}~+~\frac{\partial^2f}{\partial z^2}</sp:alt>
</lx:altM>
</sp:alt>
</lx:imgM>
</sfm:png>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<sfm:png xmlns:sc="http://www.utc.fr/ics/scenari/v3/core" xmlns:sfm="http://www.utc.fr/ics/scenari/v3/filemeta" xmlns:lx="scpf.org:lexicon">
<lx:imgM xmlns:sp="http://www.utc.fr/ics/scenari/v3/primitive">
<sp:alt>
<lx:altM>
<sp:alt>\nabla^2f=\frac{\partial^2f}{\partial \rho^2}~+\frac{1}{\rho}\frac{\partial f}{\partial \rho}~+~\frac{1}{\rho^2}\frac{\partial^2f}{\partial \phi^2}~+~\frac{\partial^2f}{\partial z^2</sp:alt>
</lx:altM>
</sp:alt>
</lx:imgM>
</sfm:png>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<sfm:png xmlns:sc="http://www.utc.fr/ics/scenari/v3/core" xmlns:sfm="http://www.utc.fr/ics/scenari/v3/filemeta" xmlns:lx="scpf.org:lexicon">
<lx:imgM xmlns:sp="http://www.utc.fr/ics/scenari/v3/primitive">
<sp:alt>
<lx:altM>
<sp:alt>\nabla^2f=\frac{\partial^2f}{\partial r^2}~+~\frac2r\frac{\partial f}{\partial r}~+~\frac1{r^2}\frac{\partial^2f}{\partial\theta^2}~+~\frac{\cot\theta}{r^2}\frac{\partial f}{\partial\theta}+\frac1{r^2~\sin^2\theta}\frac{\partial^2f}{\partial\phi^2}</sp:alt>
</lx:altM>
</sp:alt>
</lx:imgM>
</sfm:png>
\ No newline at end of file
<imgProps standardCharSize="10.204081632653061" rotateForbidden="true"/>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<sc:item xmlns:sc="http://www.utc.fr/ics/scenari/v3/core">
<lx:webSite xmlns:sp="http://www.utc.fr/ics/scenari/v3/primitive" xmlns:lx="scpf.org:lexicon">
<lx:webSiteM>
<sp:title>Demo Lexique</sp:title>
<sp:license>
<lx:licenseM/>
</sp:license>
<sp:optsPubWebM>
<lx:optsPubWebM/>
</sp:optsPubWebM>
<sp:optsSearch>
<sp:dynamicSearch>no</sp:dynamicSearch>
</sp:optsSearch>
</lx:webSiteM>
<sp:lexicon>
<lx:lexicon>
<lx:lexiconM>
<sp:title>Classique</sp:title>
</lx:lexiconM>
<sp:query>
<lx:lexiconQry>
<sc:where>
<exp uiCrit="critSrcScope" type="RootFolder" path="/Exemple"/>
</sc:where>
</lx:lexiconQry>
</sp:query>
</lx:lexicon>
</sp:lexicon>
</lx:webSite>
</sc:item>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<sc:item xmlns:sc="http://www.utc.fr/ics/scenari/v3/core">
<lx:webSite xmlns:sp="http://www.utc.fr/ics/scenari/v3/primitive" xmlns:lx="scpf.org:lexicon">
<lx:webSiteM>
<sp:title>Demo Lexique</sp:title>
<sp:license>
<lx:licenseM/>
</sp:license>
<sp:optsPubWebM>
<lx:optsPubWebM/>
</sp:optsPubWebM>
<sp:optsSearch>
<sp:dynamicSearch>yes</sp:dynamicSearch>
</sp:optsSearch>
</lx:webSiteM>
<sp:lexicon>
<lx:lexicon>
<lx:lexiconM>
<sp:title>Dynamique</sp:title>
</lx:lexiconM>
<sp:query>
<lx:lexiconQry>
<sc:where>
<exp uiCrit="critSrcScope" type="RootFolder" path="/Exemple"/>
</sc:where>
</lx:lexiconQry>
</sp:query>
</lx:lexicon>
</sp:lexicon>
</lx:webSite>
</sc:item>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<sc:item xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"><lx:source xmlns:sp="http://www.utc.fr/ics/scenari/v3/primitive" xmlns:sc="http://www.utc.fr/ics/scenari/v3/core" xmlns:lx="scpf.org:lexicon"><lx:sourceM><sp:title>Glossaire Unisciel</sp:title></lx:sourceM></lx:source></sc:item>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<sc:item xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"><lx:source xmlns:sp="http://www.utc.fr/ics/scenari/v3/primitive" xmlns:lx="scpf.org:lexicon"><lx:sourceM><sp:title>Journal Officiel</sp:title><sp:url>http://www.dglf.culture.gouv.fr/publications/vocabulaires/Vocabulaire_TIC_09.pdf</sp:url></lx:sourceM></lx:source></sc:item>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<sc:item xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"><lx:source xmlns:sp="http://www.utc.fr/ics/scenari/v3/primitive" xmlns:sc="http://www.utc.fr/ics/scenari/v3/core" xmlns:lx="scpf.org:lexicon"><lx:sourceM><sp:title>Service de « Travaux publics et Services gouvernementaux Canada »</sp:title><sp:url>http://www.btb.termiumplus.gc.ca</sp:url></lx:sourceM></lx:source></sc:item>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<sc:item xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"><lx:source xmlns:sp="http://www.utc.fr/ics/scenari/v3/primitive" xmlns:sc="http://www.utc.fr/ics/scenari/v3/core" xmlns:lx="scpf.org:lexicon"><lx:sourceM><sp:title>http://www.cnrtl.fr</sp:title><sp:url>http://www.cnrtl.fr</sp:url></lx:sourceM></lx:source></sc:item>
\ No newline at end of file