Aggiunte in treno
[gapil.git] / htmlize.sh
1 #!/bin/sh
2 ## htmlize.sh
3 ##
4 ## Copyright (C) 2003 Mirko Maischberger.  
5 #*   This program is free software; you can redistribute it and/or modify
6 #*   it under the terms of the GNU General Public License as published by
7 #*   the Free Software Foundation; either version 2 of the License, or
8 #*   (at your option) any later version.
9 #*
10 #*   This program is distributed in the hope that it will be useful,
11 #*   but WITHOUT ANY WARRANTY; without even the implied warranty of
12 #*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 #*   GNU General Public License for more details.
14 #*
15 #*   You should have received a copy of the GNU General Public License
16 #*   along with this program; if not, write to the Free Software
17 #*   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  
18 #*   02111-1307  USA
19 ##
20 ## Script per la compilazione del GaPiL con htlatex
21 ## ./htmlize.sh   
22 ##    genera i file HTML ed estrae le immagini
23 ##
24 ## ./htmlize.sh  -p
25 ##    genera i file HTML ma non estrae le immagini
26 ##
27 ## $Id: htmlize.sh,v 1.2 2003/04/23 22:09:52 piccardi Exp $
28 ## 
29
30 # compila usando il file di configurazione htgapil.cfg
31 htlatex gapil htgapil " " "$1"
32
33 # rimuove gli width e height dalle immagini, l'impostazione
34 # di default di htlatex (che non so cambiare) è di usare la
35 # dimesione dell'immagine in punti pica.
36 perl -i.orig -pe 's/width=\".*\"//i' *.html
37 perl -i.orig -pe 's/height=\".*\"//i' *.html
38 perl -i.orig -pe 's/width=\".*\"//i' *.html
39 perl -i.orig -pe 's/height=\".*\"//i' *.html
40
41 # ripristina il backslash negli esempi di codice HTML
42 perl -i.orig -pe 's/INSERT_BACKSLASH_MAGIC8745/\\/g' *.html
43
44 # sostitiusci il colore delle note (mouseover)
45 perl -i.orig -pe 's/:aqua/:#fcc/g' *.css
46
47 # sposta e pulisci
48 mv *.html htgapil
49 mv *.png htgapil
50 mv *.js htgapil
51 mv *.css htgapil
52 # - rm *.html~
53 # - rm *.html.orig
54
55 # piccola gabola per immagini mal convertite da htlatex
56 convert -density 110x110 -geometry 70% img/tcpip_overview.ps htgapil/gapil117x.png
57 convert -density 110x110 -geometry 50% img/iso_tcp_comp.ps htgapil/gapil114x.png
58 convert -density 110x110 -geometry 50% img/tcp_data_flux.ps htgapil/gapil116x.png
59
60 cd htgapil
61 # wwis è uno script che riscrive width e height 
62 # corretti nelle immagini
63 wwwis *.html
64 # pulizia
65 # - rm *~
66 cd ..