Commit 64c99ecf authored by Neveux Anais's avatar Neveux Anais

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

parents 21b7303a 8a4c068a
......@@ -30,26 +30,6 @@ Vous êtes un utilisateur de framapad et en créez un pour un projet. Après avo
3. run the `run.[bat|sh]` script of your choice depending on your OS
4. and retrieve the hdoc outputs in the `/output` folder
## Unsupported
- Markdown
- Author paternity
- Etherpad timeline
- Chat
## Known bugs
- Nested lists in lists are not supported
Example :
`<ul>
<li>
<ul>
<li>
Never gonna give you up.
</li>
</ul>
</li>
<ul>`
- As a consequence, etherpad indentation is not supported because it is coded as nested lists.
## Product Backlog
Currently available on: https://framemo.org/framapad_to_opale
......@@ -57,15 +37,13 @@ Currently available on: https://framemo.org/framapad_to_opale
See also : https://bimestriel.framapad.org/p/nf29_framapad_to_opale for the full documentation of our working process.
## TODO
- Nested Lists
- Indentation
- Titles (and therefore Structure of the doc)
- Coloured text
- Code
- Markdown
## Technical notes
### Description of etherpad_to_hdoc.ant
### Description of framapad_to_hdoc.ant
#### Prelude
- Importation of necessary classes (antlib, htmlcleaner, jing)
......
......@@ -10,7 +10,7 @@
- Fecherolle Cecile (2014)
## Presentation
How to transform an framapad document in opale document.
How to transform a framapad document in opale document.
Filepaths in this document are relative to this readme file.
......@@ -19,8 +19,7 @@ Filepaths in this document are relative to this readme file.
- Hdoc2Opale
## User Documentation
1. Download a framapad document in html format.
1. Create or join a framapad 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).
1. Create a framapad document then export it in html format (Import/Export Button) and put it 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
......@@ -29,29 +28,6 @@ Filepaths in this document are relative to this readme file.
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.
Here's an 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 framapad_to_hdoc.ant
......
# This script allows for creation of a data base in baseX from the xml files in the folder output
# Before executing this script, please make sure that you have successfully finished the transformation in the step 1 in the "user story" of the README.md
# This script will a database that includes all the xml files in the folder /hdoc_to_basex/output automatically
# Before executing this script, please make sure that you have successfully finished the transformation in the step 1 in the part "user story" of the README.md
# Syntax : CREATE DB [name] ([input])
# Example :
CREATE DB myDB D:\School\UTC\GI04\NF29\Projet\hdoc\hdoc_to_basex\output
#CREATE DB myDB [..the repertory of the projet in your local disk..]/hdoc/hdoc_to_basex/output
# Example :
CREATE DB myDB D:/School/UTC/GI04/NF29/Projet/hdoc/hdoc_to_basex/output
# P.S. If you get error message : Resource "..." not found, please confirm your file repertory is correct
\ No newline at end of file
......@@ -3,6 +3,7 @@
(: For example, $author := '^Baptiste Montangé$', to search for an exact name:)
(: For example, $name := 'Montangé', to search for documents whose author named Coutant:)
(: Remark : Accents in the authors' names have been taken care of :)
declare function local:searchDocByAuthor($name as xs:string, $docs as node()*) as node()*
{
let $name_noAcc := translate($name, 'áàâäéèêëíìîïóòôöúùûü','aaaaeeeeiiiioooouuuu')
......
......@@ -39,11 +39,19 @@ Image : JPEG; JPG, PNG, SVG (non testé pour SVG)
Gestion du multifichiers en input
Hypertexte
Unsupported
-----------
ODG : non supporté en EPUB => "Élément non supporté en EPUB : <xsl:value-of select="@data"/>"
Problème sur la liseuse vis à vis du CSS (à détailler)
Exercices
Méthode et Rappels (data-hdoc-type)
Known bugs
----------
......@@ -57,8 +65,13 @@ Problème avec les keywords : le hdoc contient des keywords mais nous ne savons
Todo list
---------
Étude compatibilité entre EPUB2 et EPUB3
Trouver une solution pour le dimentionnement des images
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
---------------
This diff is collapsed.
body{
margin: 0px;
padding: 0px;
height: 100%;
font: 12px Tahoma, Arial, Sans-serif;
}
h1, h2, h3, h4, h5, h6{
font-weight: bold;
}
h1{
font-size: 1.8em;
color: #4463A1;
text-align: center;
}
h2{
font-size:1.8em;
color:#4463A1;
}
h3{
font-size: 1.4em;
color: #4463A1;
}
h4, h5, h6{
font-size: 1.3em;
color: #4463A1;
}
p{
text-align: justify;
font-size: 1.2em;
margin: 0.2em 1em 0.7em 1em;
}
table, td, th {
border: 1px solid #4463A1;
text-align: center;
font-size: 1.2em;
}
td p, th p{
text-align: center;
font-size: 15px;
}
tr:first-child {
font-weight: bold;
color : white;
background-color : #4463A1;
}
table {
border-collapse: collapse;
width: 100%;
}
th {
padding: 10px;
}
td{
padding: 5px;
}
.textTitle{
float : left;
}
.title{
float : right;
}
.border{
background: #f5fcff;
border: 2px solid #4463A1;
box-shadow: 0px 5px 5px #888888;
padding: 5px;
clear: both;
}
.warning{
color:#cc0000;
}
.borderWarning{
background: #ffcccc;
border: 2px solid #cc0000;
box-shadow: 0px 5px 5px #888888;
padding: 5px;
clear: both;
}
.noCut{
page-break-inside: avoid;
}
.titlePage{
margin: 30vh 0 0 0;
text-align: center;
-webkit-transform: translateY(-50%);
transform: translateY(-50%);
font-size: 30px;
}
.subTitlePage{
text-align: center;
font-size: 15px;
}
.bold{
font-weight: bold;
}
.imgContainer1{
text-indent:0;
text-align:center;
margin-right:auto;
margin-left:auto;
width:99%;
page-break-before:auto;
page-break-inside:avoid;
page-break-after:auto;
}
.imgContainer2{
margin-left:0;
margin-right:0;
text-align:center;
text-indent:0;
height:100%;
width:100%;
}
p .imgContainer3{
display:inline-block;
text-indent:0;
width:100%;
}
img{
max-width:99%;
max-height:75%;
}
body{
margin: 0px;
padding: 0px;
height: 100%;
font: 12px Tahoma, Arial, Sans-serif;
}
h1, h2, h3, h4, h5, h6{
font-weight: bold;
}
h1{
font-size: 1.8em;
color: #4463A1;
text-align: center;
}
h2{
font-size:1.8em;
color:#4463A1;
}
h3{
font-size: 1.4em;
color: #4463A1;
}
h4, h5, h6{
font-size: 1.3em;
color: #4463A1;
}
p{
text-align: justify;
font-size: 1.2em;
margin: 0.2em 1em 0.7em 1em;
}
table, td, th {
border: 1px solid #4463A1;
text-align: center;
font-size: 1.2em;
}
td p, th p{
text-align: center;
font-size: 15px;
}
tr:first-child {
font-weight: bold;
color : white;
background-color : #4463A1;
}
table {
border-collapse: collapse;
width: 100%;
}
th {
padding: 10px;
}
td{
padding: 5px;
}
.textTitle{
float : left;
}
.title{
float : right;
}
.border{
background: #f5fcff;
border: 2px solid #4463A1;
box-shadow: 0px 5px 5px #888888;
padding: 5px;
clear: both;
}
.warning{
color:#cc0000;
}
.borderWarning{
background: #ffcccc;
border: 2px solid #cc0000;
box-shadow: 0px 5px 5px #888888;
padding: 5px;
clear: both;
}
.noCut{
page-break-inside: avoid;
}
.titlePage{
margin: 30vh 0 0 0;
text-align: center;
-webkit-transform: translateY(-50%);
transform: translateY(-50%);
font-size: 30px;
}
.subTitlePage{
text-align: center;
font-size: 15px;
}
.bold{
font-weight: bold;
}
.imgContainer1{
text-indent:0;
text-align:center;
margin-right:auto;
margin-left:auto;
width:99%;
page-break-before:auto;
page-break-inside:avoid;
page-break-after:auto;
}
.imgContainer2{
margin-left:0;
margin-right:0;
text-align:center;
text-indent:0;
height:100%;
width:100%;
}
p .imgContainer3{
display:inline-block;
text-indent:0;
width:100%;
}
img{
max-width:99%;
max-height:75%;
}
......@@ -2,8 +2,8 @@
set ant=hdoc_to_neo4j.ant
set antparam=-DNode true;
IF NOT EXIST ./node_modules call npm install
ant -buildfile %ant% %antparam%
pause
IF NOT EXIST ./node_modules npm install & ant -buildfile %ant% %antparam% & pause
ant -buildfile %ant% %antparam% & pause
REM start /MIN java.exe -classpath "%scJarList%" -Xmx150m org.apache.tools.ant.Main -buildfile %ant% %antparam%
......@@ -33,7 +33,9 @@ scJarList="$lib/*"
#test si les packages ont été installés
if [ ! -d "$node_modules" ]; then
cd ../hdoc_to_neo4j/
npm install
cd ../opale_to_neo4j
fi
$vJavaCmd -classpath "$scJarList:" -Xmx150m org.apache.tools.ant.Main -buildfile $ant $antparam
<map version="1.0.1">
<node ID="ID_1" TEXT="testListe">
<node ID="ID_2" POSITION="right" STYLE="fork" TEXT="#list liste">
<node ID="ID_3" POSITION="right" STYLE="fork" TEXT="#p noeud1"/>
<node ID="ID_4" POSITION="right" STYLE="fork" TEXT="#p noeud2"/>
</node>
</node>
</map>
\ No newline at end of file
......@@ -54,7 +54,8 @@
</header>
<!-- Process children -->
<xsl:apply-templates select="node"/>
<!--<xsl:apply-templates select="node"/>-->
<xsl:apply-templates/>
<footer>
<!--Conclusion-->
<xsl:if test="child::*[contains(@TEXT, '#conclu')]">
......@@ -104,6 +105,28 @@
<xsl:value-of select="utc:remove-language(@TEXT)"/>
</xsl:element>
</xsl:template>
<xsl:template match="node[contains(@TEXT, '#p')]" priority="3" mode="list">
<xsl:element name="li">
<xsl:element name="p">
<xsl:value-of select="utc:remove-language(@TEXT)"/>
</xsl:element>
</xsl:element>
</xsl:template>
<!-- Liste -->
<xsl:template match="node[contains(@TEXT, '#list')]" priority="2">
<xsl:element name="section">
<xsl:element name="header">
<xsl:element name="h1"><xsl:value-of select="utc:remove-language(@TEXT)"/></xsl:element>
</xsl:element>
<xsl:element name="div">
<xsl:element name="ul">
<xsl:apply-templates mode="list"></xsl:apply-templates>
</xsl:element>
</xsl:element>
</xsl:element>
</xsl:template>
<!-- Definition -->
<xsl:template match="node[contains(@TEXT, '#def')]" priority="2">
......@@ -223,6 +246,24 @@
</xsl:element>
</xsl:element>
</xsl:template>
<!-- Emphasis with bold -->
<xsl:template match="node/font[@BOLD ='true']" priority="3">
<xsl:comment>passage par bold</xsl:comment>
<xsl:element name="section">
<xsl:element name="header">
<xsl:element name="h1">Emphase</xsl:element>
</xsl:element>
<xsl:element name="div">
<xsl:attribute name="data-hdoc-type">emphasis</xsl:attribute>
<xsl:element name="h6">
<xsl:value-of select="../utc:remove-language(@TEXT)"/>
</xsl:element>
<xsl:element name="p"/>
<xsl:apply-templates mode="sub"/>
</xsl:element>
</xsl:element>
</xsl:template>
<!-- Link : need to use anchor attribute ? -->
<xsl:template match="node[contains(@TEXT, '#a')]" priority="2">
......
......@@ -13,14 +13,22 @@
</node>
<node ID="ID_5" POSITION="right" STYLE="fork" TEXT="#rmk Remarque"/>
<node ID="ID_8" POSITION="right" STYLE="fork" TEXT="#compl Compl&#233;ment"/>
<node ID="ID_32" POSITION="right" STYLE="fork" TEXT="#singlechoicequestion Ceci est l'&#233;nonc&#233; de la question pour un QCU">
<node ID="ID_36" POSITION="right" STYLE="fork" TEXT="#choice-qcu Ceci est une r&#233;ponse"/>
<node ID="ID_37" POSITION="right" STYLE="fork" TEXT="#choice-qcu Ceci est une autre r&#233;ponse"/>
<node ID="ID_38" POSITION="right" STYLE="fork" TEXT="#solution 2"/>
<node ID="ID_35" POSITION="right" STYLE="fork" TEXT="#explanation Ceci est l'explication de la r&#233;ponse"/>
</node>
<node ID="ID_9" POSITION="right" STYLE="fork" TEXT="#wrng Attention"/>
<node ID="ID_10" POSITION="right" STYLE="fork" TEXT="#ex Exemple"/>
<node ID="ID_7" POSITION="right" STYLE="fork" TEXT="#emph Emphase"/>
<node ID="ID_25" POSITION="right" STYLE="fork" TEXT="#question Ceci est l'&#233;nonc&#233; de la question">
<node ID="ID_25" POSITION="right" STYLE="fork" TEXT="#question Ceci est l'&#233;nonc&#233; de la question pour un QCM">
<node ID="ID_26" POSITION="right" STYLE="fork" TEXT="#choice-correct Ceci est une bonne r&#233;ponse">
<node ID="ID_29" POSITION="right" STYLE="fork" TEXT="#explanation-choice-correct Ceci est l'explication locale de la bonne r&#233;ponse"/>
</node>
<node ID="ID_27" POSITION="right" STYLE="fork" TEXT="#choice-incorrect Ceci est une mauvaise r&#233;ponse"/>
<node ID="ID_27" POSITION="right" STYLE="fork" TEXT="#choice-incorrect Ceci est une mauvaise r&#233;ponse">
<node ID="ID_30" POSITION="right" STYLE="fork" TEXT="#explanation-choice-incorrect Ceci est l'explication locale de la mauvaise r&#233;ponse"/>
</node>
<node ID="ID_28" POSITION="right" STYLE="fork" TEXT="#explanation Ceci est l'explication de la r&#233;ponse"/>
</node>
</node>
......@@ -34,6 +42,9 @@
<node ID="ID_21" POSITION="left" STYLE="fork" TEXT="Paragraphe"/>
</node>
</node>
<node ID="ID_31" POSITION="right" STYLE="fork">
<edge COLOR="#9900ff"/>
</node>
<node ID="ID_3" POSITION="right" STYLE="fork" TEXT="#2 Noeud2"/>
<node ID="ID_4" POSITION="right" STYLE="fork" TEXT="#intro Intro"/>
<node ID="ID_15" POSITION="right" STYLE="fork" TEXT="#conclu Conclusion">
......
......@@ -22,6 +22,8 @@
<!-- Beginning -->
<target name="convert">
<delete dir="${OutputPath}"/>
<mkdir dir="${OutputPath}"/>
<for param="filename">
<path>
<fileset dir="./input" includes="*.scar"/>
......
......@@ -21,7 +21,7 @@
<target name="clean_everything">
<delete dir="../opale_to_hdoc/input"/>
<delete dir="../opale_to_hdoc/output/result.hdoc"/>
<delete dir="../opale_to_hdoc/output/"/>
<delete dir="../hdoc_to_neo4j/input"/>
<delete dir="../hdoc_to_neo4j/output/"/>
</target>
......@@ -38,7 +38,7 @@
<echo message="The value of property DocType is ${DocType}" />
<!-- get input hdoc file path -->
<copy todir="../opale_to_hdoc/input/sample.scar">
<copy todir="../opale_to_hdoc/input/">
<fileset dir="${InputPath}"/>
</copy>
<ant antfile="../opale_to_hdoc/opale_to_hdoc.ant" inheritAll="false"/>
......
......@@ -2,8 +2,8 @@
set ant=opale_to_neo4j.ant
set antparam=-DNode true;
IF NOT EXIST ./node_modules call npm install
ant -buildfile %ant% %antparam%
IF NOT EXIST ../hdoc_to_neo4j/node_modules cd ../hdoc_to_neo4j/ & npm install & cd ../opale_to_neo4j & ant -buildfile %ant% %antparam% & pause
ant -buildfile %ant% %antparam% & pause
pause
REM start /MIN java.exe -classpath "%scJarList%" -Xmx150m org.apache.tools.ant.Main -buildfile %ant% %antparam%
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