Commit 462c3954 authored by Decorde Jeffrey's avatar Decorde Jeffrey

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

parents baa699bc d79d96cc
This diff is collapsed.
# HDOC CONVERTER PROJECT
# Hdoc Converter Projet
## What is Hdoc ?
License GPL3.0
http://www.gnu.org/licenses/gpl-3.0.txt
Credits : Université de Technologie de Compiègne, NF29 course students
Please refer to the [Hdoc converter project website](http://hdoc.crzt.fr/www/co/hdocConverter.html)
## What is Hdoc ?
Please refer to the [Hdoc converter project website](http://hdoc.crzt.fr)
>The aim of the project is to propose:
>- a generic XML schema based on XHTML5 for documentary purpose (Hdoc format);
>- a set of converters to transform document formats from and to Hdoc;
>- a web site to manage the converters (Hdoc Converter Portal).
## What is this repository ?
This repository gathers some of the Hdoc converters, if not all of them.
Project URL : https://gitlab.utc.fr/crozatst/hdoc.git
## How to use Hdoc Converters ?
This repository gathers some of the Hdoc converters, if not all of them.
\ No newline at end of file
In order to use a converter, choose the corresponding folder and consult README.md for instructions.
# antce
"antce" is not for use, it is just a base for autonomous multi-OS ANT launcher
......@@ -55,7 +55,7 @@
</target>
<target name="buildOutput" depends="unzipSource">
<xslt classpath="${libdir}/saxon9he.jar" style="${xsldir}/termToRef.xsl" basedir="${srcdir}" destdir="${OutputPath}" followsymlinks="false" extension=".ref">
<xslt classpath="${libdir}/saxon9he.jar" style="${xsldir}/termToRdf.xsl" basedir="${srcdir}" destdir="${OutputPath}" followsymlinks="false" extension=".rdf">
<include name="**/*.term"/>
</xslt>
<copy file="opale.wspmeta" tofile="${OutputPath}/.wspmeta"></copy>
......@@ -71,4 +71,4 @@
<delete dir="${outdir}" />
</target>
</project>
\ No newline at end of file
</project>
......@@ -4,11 +4,9 @@
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:ont="nf29ont"
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"
xmlns:op="utc.fr:ics/opale3"
exclude-result-prefixes="xs"
exclude-result-prefixes="xs sp sc lx"
version="2.0">
<xsl:output method="xml" indent="yes" />
......
This diff is collapsed.
Mindmapping to HDOC
===================
Converter Mindmapping2HDOC
==========================
Conversion of Freemind file(s) (.mm) to Hdoc
# How to use the converter
Licence
-------
GPL3.0
Credits
-------
* Amélie Perdriaud
* Thibault Brocheton
* Bastien Frémondière
* Guillaume Gomez
Presentation
------------
This project aims at converting mindmapping files to hdoc files.
User documentation
------------------
Use a terminal and go to the root of the folder (mindmapping_to_hdoc).
#1 : You want to convert SEVERAL Freemind files in Hdoc
......@@ -21,3 +37,38 @@ Use a terminal and go to the root of the folder (mindmapping_to_hdoc).
You will find the result in the folder mindmapping_to_hdoc/result
Unsupported
-----------
* Convert color
* Convert icon into summary elements.
* headers (especially keywords) are partially supported.
Known bugs
----------
* All hdoc samples given in the "Download" section have been tested and should work well. If you want to use your own hdoc files, make sure that container.xml's root contains version="1.0" and xmlns="urn:utc.fr:ics:hdoc:container" attributes. Otherwise ant building will fail.
* It is not specified in hdoc's standard but I assume that hdoc's content file (usually named "content.xml") fullpath is a relative path that begins at the root of the hdoc archive. That means that the full-path attribute of <rootfile> (in container.xml) begins with a character, and not a special sequence such as ".", ".." or "/". It is already the case for my samples, but if you want to use your own samples make sure this full-path attribute is ok.
Todo
----
* Get mindmap from Framamind
* Mindmap to lexique conversion
* Mindmap to optim conversion
Technical notes
---------------
This converter is using standard NF29 conversion project structure : I use a main ANT file (named mapMapping2Hdoc.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.
During the conversion process, I use a few temporary files stored in a temp folder : their content depends on hdoc's files (such as "container.xml", "content.xml" and ressource files). See details below.
You can comment the part of code where temp directory is deleted in order to view raw files directly instead of unzipping hdoc file.
What is META-INF folder ?
This is a simple folder with a xml file named 'content.xml' that contains useful information for Opale. Every .scar archives must contain this file, what it exactly does is not the purpose of this project.
Freemind / HDOC
-- INSERT doc_language.md --
Capitalisation
--------------
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Usage
-----
Optim to Hdoc
=============
Put `.scar` files in the input folder, run `run.bat` or `run.sh` and get results in output folder (one folder and a .hdoc per .scar).
Licence
-------
License GPL3.0
http://www.gnu.org/licenses/gpl-3.0.txt
Todo list
---------
- tests more files
- clean output of optim source files
- resolve bugs
- test the entier process from optim to opale
- the level of unit of content for the Opal conversion if basically set to sections witch doesn't contains any section but some could need it to be set to another level. Create a selection of this level could be a next step for this project.
Credits
-------
Bugs
----
Ivan D'halluin, Sylvain Lagache, Frédéric Le Feurmou.
User documentation
------------------
Use the project as describe in the root README. You can convert multiple files by putting all `.scar` in the input folder.
You can convert paper, section, website, slideshow and webpage.
Known bugs
----------
- references of sections or fragments inside a paragraphe
- can create divs with only h6
Transformation
--------------
Todo
----
- tests more files
- clean output of optim source files
- resolve bugs
- the level of unit of content for the Opal conversion if basically set to sections witch doesn't contains any section but some could need it to be set to another level. Create a selection of this level could be a next step for this project.
Technicals notes
----------------
| Optim start tag (or structures) | HDOC end tag | Note |
|---------------------------------|-------------------------------------|---------------------------------------------|
......@@ -79,4 +96,5 @@ Transformation
| tree | <div><h6/><p/></div> | The structure of trees cannot be converted |
| | | and the result is a list a blocks |
|---------------------------------|-------------------------------------|---------------------------------------------|
| title | <h6> | |
\ No newline at end of file
| title | <h6> | |
......@@ -198,6 +198,11 @@
<mkdir dir="${tmp}"/>
<delete dir="${out}" failonerror="false"/>
<mkdir dir="${out}"/>
<delete dir="${optim_to_hdoc_in}" failonerror="false"/>
<mkdir dir="${optim_to_hdoc_in}"/>
<delete dir="${hdoc_to_opale_in}" failonerror="false"/>
<mkdir dir="${hdoc_to_opale_in}"/>
</target>
</project>
\ No newline at end of file
Optim to Opale (optim_to_opale)
-------------------------------
Optim to Opale (`optim_to_opale`)
===============================
Last edit: January 4, 2016
Last edit: December 17, 2015
License
-------
This project is under [GPL 3.0 licence](http://www.gnu.org/licenses/gpl-3.0.txt).
# Purpose
Credits
-------
### Autumn 2015
`optim_to_opale` is an ANT script to convert a file from Optim format to Opale format.
* Ivan D'HALLUIN
* JEFFREY DECORDE
* Jean-Baptiste MARTIN
# Dependencies
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.
Dependencies
------------
In order to work properly this script needs
1. `optim_to_hdoc` (Optim to HDoc conversion)
2. `hdoc_to_opale` (HDoc to Opale conversion)
1. [`optim_to_hdoc`](https://gitlab.utc.fr/crozatst/hdoc/tree/master/optim_to_hdoc) (Optim to HDoc conversion)
2. [`hdoc_to_opale`](https://gitlab.utc.fr/crozatst/hdoc/tree/master/hdoc_to_opale) (HDoc to Opale conversion)
# Running the script
User Documentation
------------------
### Running the script
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
3. Your converted file is placed into the `output` directory (a log file is also placed into the `log`directory)
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
2. It cleans the `log`, `tmp`and `output`directories
......@@ -32,3 +45,21 @@ In order to work properly this script needs
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.
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.
Known bugs
----------
N/A for now.
Todo
----
Technical notes
---------------
Capitalization
--------------
Converter : Wikipedia_to_Hdoc
---------------
Licence :
---------------
GPL 3.0
http://www.gnu.org/licenses/gpl-3.0.txt
Credits :
---------------
Carrel Billiard Harold
Harriga Merouane
Lhomme Nicolas
Previous developers
Getting started
---------------
......@@ -45,9 +65,12 @@ To do
Concerning images :
1 - Extract the metadata information from the meta.xml file for each image. You can do that by creating an XSL file that will be called from the ant task generated by xslt/get_ressources_urls.xsl. In that file you have the hand on each meta.xml File.
2 - Verify that images are well zipped to avoid any problem while testing in Opale
3 - Images inside paragraphs break the validation of the hdoc schema, do a preposition to change the schema and handle that.
Concerning listings :
1 - Succeed in finding the language of the part of code of the wikipedia article
......@@ -56,8 +79,11 @@ Concerning listings :
Concerning tables :
1 - Solve the encoding problem,
2 - Change Hdoc Scheme in order to accept images in tables?
3 - Display complex tables as tables in Opale (not extern files)
3 - Display complex tables as tables in Opale (not as extern files)
Be aware of the following things
---------------------------------------------------------
......@@ -66,4 +92,11 @@ Be aware of the following things
BUG
---
1 - Linux sh files doesn't work with UTC proxy but works outside UTC
\ No newline at end of file
1 - Linux sh files doesn't work with UTC proxy but works outside of UTC.
2 - Random errors might occur
Wikipedia is a great tool : everyone can participe. However, it does not provide contributors with best practices that everyone follows. The result is a lot of different ways to write articles. This is why this converter might not handle some situations (even if all files I have tried worked), and it might not be able to output some Wikipedia articles at its current state.
3 - Small issues with Opale
Links can be invisible if you use an old version of Opale. This is not a problem coming from the Wikipedia to Hdoc converter. Make sure you use an updated version of Opale to test your scar archives.
Another thing is that Opale might indicate that the scar file contains errors once imported. Actually, these "errors" are warnings. The archives work, as they were validated when making the scar file. These warnings come from Opale, but you can ignore them.
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="xs"
version="2.0"
xmlns:saxon="http://saxon.sf.net/"
extension-element-prefixes="saxon"
>
<!-- This XSL create an ANT script that will download our ressources (images) using the GET TASK-->
<xsl:output method="xml" indent="yes" encoding="UTF-8"/>
<xsl:template match="/">
<xsl:param name="dest-rep">${hdocResultPath}/ressources</xsl:param>
<project name="getRessourcesFiles" basedir="." default="getRessourcesFiles">
<!-- Ccreation of the ressources folder -->
<mkdir dir="{$dest-rep}"/>
<target name="getRessourcesFiles">
<xsl:apply-templates select="//div[@class='thumb tleft' or @class='thumb tright']//img | //p//img | //center//img | //li//img"/>
<!-- If an image doesn't appear in final result you should add it to the apply-template above-->
</target>
</project>
</xsl:template>
<!-- What has been changed starts from here -->
<xsl:template match="img" priority="5">
<!-- Now the storage structure of the images will become :
ressources
image.jpeg (this is a folder)
image.jpeg
meta.xml
-->
<!-- The meta.xml contains the copyright file of the image -->
<!-- The meta.xml should respect the structure given to you in official-meta.xml (it's available in the same level as this file) )-->
<xsl:param name="dest-rep-image">${hdocResultPath}/ressources/<xsl:value-of select="translate(tokenize(@src, '/')[last()],'?%','_')"/></xsl:param>
<xsl:param name="dest-file">${hdocResultPath}/ressources/<xsl:value-of select="translate(tokenize(@src, '/')[last()],'?%','_')"/>/<xsl:value-of select="translate(tokenize(@src, '/')[last()],'?%','_')"/>
</xsl:param>
<xsl:param name="dest-file-meta">${hdocResultPath}/ressources/<xsl:value-of select="translate(tokenize(@src, '/')[last()],'?%','_')"/>/meta.xml</xsl:param>
<xsl:param name="copyright-link"><xsl:value-of select="following-sibling::a[1]/@href"/></xsl:param>
<mkdir dir="{$dest-rep-image}"/>
<get src="{@src}" dest="{$dest-file}" /><!-- Get The image -->
<!-- Get the copyright file of the image if it existt -->
<xsl:if test="$copyright-link !=''" >
<get src="{$copyright-link}" dest="{$dest-file-meta}" />
<!-- Here You should generate Your XSL transformation to extract the right information from the copyright file (final result should be similar as official-meta.xml)
Very Important, The title of the image is not present in the copyright file BUT We have prepared it already in the @alt attribute
-->
</xsl:if>
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<sfm:jpg_jpeg xmlns:op="utc.fr:ics/opale3" xmlns:sc="http://www.utc.fr/ics/scenari/v3/core" xmlns:sfm="http://www.utc.fr/ics/scenari/v3/filemeta">
<op:imgM xmlns:sp="http://www.utc.fr/ics/scenari/v3/primitive">
<sp:title>Principal title</sp:title>
<sp:info>
<op:infoBin>
<sp:cc>zero</sp:cc>
<sp:ccVersion>2.5</sp:ccVersion>
</op:infoBin>
</sp:info>
<sp:alt>
<sp:type>info</sp:type>
<sp:altTxt>remplacement text</sp:altTxt>
<sp:desc>
<op:sTxt>
<sc:para xml:space="preserve">Complete description</sc:para>
</op:sTxt>
</sp:desc>
</sp:alt>
</op:imgM>
</sfm:jpg_jpeg>
\ No newline at end of file
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