Commit f75c2ed0 authored by Decorde Jeffrey's avatar Decorde Jeffrey

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

parents 28def063 c3c45f29
......@@ -5,10 +5,12 @@ License GPL3.0
http://www.gnu.org/licenses/gpl-3.0.txt
## Crédits
- Jean-Côme Douteau
- Gabrielle Rit
- Jean Vintache
- Fecherolle Cécile
- 2015
- Jean-Côme Douteau
- Gabrielle Rit
- Jean Vintache
- 2014
- Fecherolle Cécile
## Presentation
This module is able to convert several [etherpad](http://etherpad.org/) files (exported as html files) to the hdoc format.
......@@ -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>
<?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>This schema describes the content file for hdoc format</a:documentation>
<a:documentation>This schema is a restriction of XHTML (it validates XHTML
schema, if namespace is changed to http://www.w3.org/1999/xhtml)</a:documentation>
<a:documentation>Last update : 2014-12-22</a:documentation>
<a:documentation>Changes since last update :
Adding biblio management via a href='' data-hdoc-type='bibtexml'
</a:documentation>
<start>
<element name="html">
<ref name="Head"/>
<ref name="Body"/>
</element>
</start>
<define name="Head">
<element name="head">
<!-- mandatory : document title -->
<element name="title">
<text/>
</element>
<!-- mandatory : charset=utf-8 -->
<element name="meta">
<attribute name="charset">
<value>utf-8</value>
</attribute>
</element>
<!-- optional : hdoc source generator -->
<optional>
<element name="meta">
<attribute name="name">
<value>generator</value>
</attribute>
<attribute name="content">
<choice>
<value>SimpleOptim</value>
<value>HdocConverter/SimpleChain</value>
<value>SimpleChain</value>
<value>HdocConverter/Etherpad</value>
<value>HdocConverter/Opale3.4</value>
<value>HdocConverter/Dokiel4.0</value>
<value>HdocConverter/Optim1.2</value>
<value>HdocConverter/Topaze1.3</value>
<value>HdocConverter/wikipedia</value>
<value>HdocConverter/Wordpress</value>
<value>HdocConverter/OpenDocumentText</value>
<value>HdocConverter/LaTeX</value>
<value>HdocConverter/OPML</value>
<value>HdocConverter/DITA</value>
</choice>
</attribute>
</element>
</optional>
<!-- optional : metadata about content ; TODO : date...-->
<zeroOrMore>
<element name="meta">
<attribute name="name">
<choice>
<value>description</value>
<value>keywords</value>
<value>author</value>
<value>rights</value>
<value>date</value>
</choice>
</attribute>
<attribute name="content">
<text/>
</attribute>
</element>
</zeroOrMore>
</element>
</define>
<define name="Body">
<element name="body">
<ref name="Structure"/>
</element>
</define>
<define name="Structure">
<oneOrMore>
<ref name="Section"/>
</oneOrMore>
</define>
<!-- Recursive and hierachical organization of the document -->
<define name="Section">
<element name="section">
<!-- optional typing -->
<ref name="SectionType"/>
<!-- mandatory : title (header > h1) -->
<element name="header">
<element name="h1">
<text/>
</element>
<optional>
<element name="div">
<attribute name="data-hdoc-type">
<value>author</value>
</attribute>
<text/>
</element>
</optional>
<optional>
<element name="div">
<attribute name="data-hdoc-type">
<value>date</value>
</attribute>
<data type="date"/>
</element>
</optional>
<optional>
<element name="div">
<attribute name="data-hdoc-type">
<value>rights</value>
</attribute>
<text/>
</element>
</optional>
<optional>
<element name="div">
<attribute name="data-hdoc-type">
<value>introduction</value>
</attribute>
<text/>
</element>
</optional>
</element>
<!-- optional content of the section-->
<optional>
<ref name="Content"/>
</optional>
<!-- optional internal sub-structrure -->
<optional>
<ref name="Structure"/>
</optional>
<!-- optional footer -->
<optional>
<element name="footer">
<optional>
<element name="div">
<attribute name="data-hdoc-type">
<value>conclusion</value>
</attribute>
<text/>
</element>
</optional>
<optional>
<element name="div">
<attribute name="data-hdoc-type">
<value>tags</value>
</attribute>
<oneOrMore>
<element name="span">
<text/>
</element>
</oneOrMore>
</element>
</optional>
<optional>
<element name="div">
<attribute name="data-hdoc-type">
<value>categories</value>
</attribute>
<oneOrMore>
<element name="span">
<text/>
</element>
</oneOrMore>
</element>
</optional>
</element>
</optional>
</element>
</define>
<!-- A content is a sequence of blocs -->
<define name="Content">
<oneOrMore>
<element name="div">
<!-- optional typing attribute -->
<ref name="DivType"/>
<!-- Optional title of a div -->
<optional>
<element name="h6">
<text/>
</element>
</optional>
<ref name="Flow"/>
</element>
</oneOrMore>
</define>
<!-- A flow is a sequence of media : text, table, image, audio, video, others -->
<define name="Flow">
<oneOrMore>
<choice>
<ref name="Text"/>
<ref name="Table"/>
<ref name="Image"/>
<ref name="Audio"/>
<ref name="Video"/>
<ref name="Object"/>
</choice>
</oneOrMore>
</define>
<!-- Text -->
<define name="Text">
<oneOrMore>
<choice>
<ref name="P"/>
<ref name="L"/>
</choice>
</oneOrMore>
</define>
<!-- Paragraphe -->
<define name="P">
<element name="p">
<ref name="Inline"/>
</element>
</define>
<!-- Inline elements -->
<define name="Inline">
<!-- TODO : cite, code, sub, sup... -->
<zeroOrMore>
<choice>
<text/>
<element name="em">
<ref name="Inline"/>
</element>
<element name="i">
<ref name="Inline"/>
</element>
<element name="q">
<ref name="Inline"/>
</element>
<element name="sub">
<ref name="Inline"/>
</element>
<element name="sup">
<ref name="Inline"/>
</element>
<element name="a">
<attribute name="href">
<data type="anyURI"/>
</attribute>
<optional>
<!-- Biblio reference management -->
<attribute name="data-hdoc-type">
<value>bibtexml</value>
</attribute>
</optional>
<ref name="Inline"/>
</element>
<element name="span">
<ref name="SpanType"/>
<ref name="Inline"/>
</element>
</choice>
</zeroOrMore>
</define>
<!-- List -->
<define name="L">
<choice>
<element name="ul">
<ref name="I"/>
</element>
<element name="ol">
<ref name="I"/>
</element>
</choice>
</define>
<!-- List item -->
<define name="I">
<oneOrMore>
<element name="li">
<ref name="Text"/>
</element>
</oneOrMore>
</define>
<!-- Table -->
<define name="Table">
<element name="table">
<optional>
<element name="caption"><text/></element>
</optional>
<oneOrMore>
<element name="tr">
<oneOrMore>
<element name="td">
<ref name="Text"></ref>
</element>
</oneOrMore>
</element>
</oneOrMore>
</element>
</define>
<!-- Image -->
<define name="Image">
<element name="img">
<attribute name="src">
<data type="anyURI"/>
</attribute>
<attribute name="alt">
<text/>
</attribute>
</element>
</define>
<!-- Audio -->
<define name="Audio">
<element name="audio">
<attribute name="src">
<data type="anyURI"/>
</attribute>
</element>
</define>
<!-- Vidéo -->
<define name="Video">
<element name="video">
<attribute name="src">
<data type="anyURI"/>
</attribute>
<ref name="VideoType"/>
</element>
</define>
<!-- Other external resources -->
<define name="Object">
<element name="object">
<ref name="ObjectType"/>
<attribute name="data">
<data type="anyURI"/>
</attribute>
<empty/>
</element>
</define>
<!-- Microdata and other Types -->
<include href="type.rng"/>
</grammar>
<?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.
\ No newline at end of file
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)
Il y a deux façons de réaliser votre conversion:
- 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.
- En ligne de commande:
ant -buildfile hdoc_to_optim.ant
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.
Exemple:
ant -buildfile hdoc_to_optim.ant -DDocType slideshow -DInputFile sample.hdoc
\ No newline at end of file
Converter hdoc_to_optim
-----------------------
The purpose of this converter is to obtain an Optim document (paper or slideshow) from a html file that complies the hdoc schema.
License GPL3.0
--------------
http://www.gnu.org/licenses/gpl-3.0.txt
Credits
-------
Rihab HACHEM, Perrine RAVAUD (2014).
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"