README.md 2.34 KB
Newer Older
Etienne Chognard's avatar
Etienne Chognard committed
1
# framapad2opale -- HDOC CONVERTER PROJECT
jcomedouteau's avatar
jcomedouteau committed
2 3 4
## License
[GPL 3.0](http://www.gnu.org/licenses/gpl-3.0.txt)
## Credits
Etienne Chognard's avatar
Etienne Chognard committed
5 6
- Boucaud Fabien
- Chognard Etienne
jcomedouteau's avatar
jcomedouteau committed
7 8
- Rit Gabrielle
- Vintache Jean
9 10
- Douteau Jean-Come
- Fecherolle Cecile (2014)
Jean Vintache's avatar
Jean Vintache committed
11 12

## Presentation
Etienne Chognard's avatar
Etienne Chognard committed
13
How to transform a framapad document in opale document.
Jean Vintache's avatar
Jean Vintache committed
14 15

Filepaths in this document are relative to this readme file.
Jean Vintache's avatar
Jean Vintache committed
16

jcomedouteau's avatar
jcomedouteau committed
17
## Dependence
Etienne Chognard's avatar
Etienne Chognard committed
18
- framapad2Hdoc
jcomedouteau's avatar
jcomedouteau committed
19
- Hdoc2Opale
Jean Vintache's avatar
Jean Vintache committed
20

jcomedouteau's avatar
jcomedouteau committed
21
## User Documentation
Etienne Chognard's avatar
Etienne Chognard committed
22
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).
jcomedouteau's avatar
jcomedouteau committed
23 24 25 26
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.
Etienne Chognard's avatar
Etienne Chognard committed
27
	2. Go in the sandbox.
jcomedouteau's avatar
jcomedouteau committed
28 29
	3. Import your `.scar` file in the directory.
	4. Open the file Main.xml created.
Jean Vintache's avatar
Jean Vintache committed
30 31


jcomedouteau's avatar
jcomedouteau committed
32
## Technical notes
Etienne Chognard's avatar
Etienne Chognard committed
33
### Description of framapad_to_hdoc.ant
jcomedouteau's avatar
jcomedouteau committed
34 35

#### Prelude
Jean Vintache's avatar
Jean Vintache committed
36 37
- Importation of necessary classes (antlib, htmlcleaner, jing)
- Creation of directories architecture tree
jcomedouteau's avatar
jcomedouteau committed
38 39

#### Transformations
Jean Vintache's avatar
Jean Vintache committed
40 41 42 43 44
- 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
Fabien Boucaud's avatar
Fabien Boucaud committed
45 46 47
- Apply html2hdocstruct1 to 6 : those xsl files are dedicated to building the hdoc structure based on the titles h1 to h6
- Apply html2hdocstructdivsection: this xsl completes the sections created in the previous xsl with
around the actual content of each level
Jean Vintache's avatar
Jean Vintache committed
48
- Apply xhtml2hdoc.xsl : this xsl transforms the content into hdoc structure
jcomedouteau's avatar
jcomedouteau committed
49 50

#### Post-transformations actions
Jean Vintache's avatar
Jean Vintache committed
51 52 53
- Build hdoc structure
- Jing checks if the output file is validated with the right rng schema
- Zip the directory into hdoc archive
jcomedouteau's avatar
jcomedouteau committed
54

Etienne Chognard's avatar
Etienne Chognard committed
55 56 57 58
###TO DO
Implémenter la gestion du code
Gérer parfaitement les indentations
Possibilité d'utiliser des tags pour typer les sections