-
Notifications
You must be signed in to change notification settings - Fork 0
/
init-html2.sh
executable file
·104 lines (88 loc) · 4.12 KB
/
init-html2.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
echo "<h3>3. Les fichiers HTML ($nbhtml)</h3><br>" >> tmp/spip/page-$1-$h.php
echo "<p><img src="../go-up.png" alt="retour sommaire" title="Retour au sommaire" />[Retour au sommaire->#sommaire]</p>" >> tmp/spip/page-$1-$h.php
if [ "$nbhtml" == "0" ];
then
echo "<font color="red">Pas de fichiers HTML dans ce plugin</font>" >> tmp/spip/page-$1-$h.php
echo "pas de fichiers html a parser"
elif [ "$nbhtml" -lt "10" ];
then
echo "moins de 10 article a parser"
echo "<?php">> tmp/spip/page-$1-$h.php
while read line
do
echo "echo '<p name="$line">[#$line<-]$line - [Retour à la liste des répertoires et fichiers->#tree] - [Retour à la liste des fonctions->#fFCT]</p>';" >> tmp/spip/page-$1-$h.php
echo "\$geshi2->set_header_content('Debut du fichier "$line"');" >> tmp/spip/page-$1-$h.php
echo "\$geshi2->set_footer_content('Fin du fichier "$line"');" >> tmp/spip/page-$1-$h.php
echo "\$geshi2->load_from_file(\"/iso/sites/codes-libres/dezip-clean/$line\", \$lookup);" >> tmp/spip/page-$1-$h.php
echo "echo \$geshi2->parse_code();" >> tmp/spip/page-$1-$h.php
done < tmp/fichiers-html-$1.txt
echo "?>" >> tmp/spip/page-$1-$h.php
j=$[ $h + 1 ]
echo $j > ./j
elif [ "$nbhtml" -gt "10" ];
then
echo "Plus de 10 fichier html a parser dans $1"
ii=1
echo "j $j"
echo "h $h"
num_article_plug=$ii
nbpagehtml0=$[($nbhtml) / 5]
nbpagehtml=$[($nbpagehtml0) + 1]
echo "nombre page html "$nbpagehtml
nbarticle=$[ $h + $nbpagehtml ]
debh=$[ $h + 1]
echo "nart_html $nart"
position=$nart
for i in `seq $debh $nbarticle`; do echo "<p>[#art$i<-][Voir les fichiers HTML, Partie $num_article_plug->art""$nart""]</p>" >> tmp/spip/page-$1-$h.php && num_article_plug=$[ $num_article_plug +1 ] && nart=$[ $nart +1 ] && echo "position dans la boucle html $nart";done
while read line
do
echo "j $j"
echo "h $h"
j=$h
j=$position
echo $j > ./j
if [ "$ii" -eq "4" ];
then
echo "egale a 4 dans html"
echo "<p name="$line">[$line->article$position#$line]</p>" >> tmp/spip/page-$1-1.php
position=$[ $position + 1]
h=$[ $h + 1 ]
ii=0
else
echo "Dans html pas egale a 4 position: "$position
echo "<p name="$line">[$line->article$position#$line]</p>" >> tmp/spip/page-$1-1.php
ii=$[ $ii + 1 ]
fi
rub=`cat ./rub`
echo "<p>[Retour au sommaire du plugin->rub$rub][#haut<-]" >> tmp/spip/page-$1-$j.php
echo "<p>[Retour haut de page->#haut]" >> tmp/spip/page-$1-$j.php
echo "<?php
//
// Include the GeSHi library//
include_once './geshi/geshi.php';
// Create a GeSHi object//
\$geshi2 = new GeSHi(\$source, \$language);
\$geshi2->set_header_type(GESHI_HEADER_PRE_VALID);
// \$geshi2->enable_classes();
\$geshi2->enable_line_numbers(GESHI_LINE_NUMBERS_NONE);
\$geshi2->set_overall_style('font: normal normal 90% monospace; color: #000066; border: 1px solid #d0d0d0; background-color: #f0f0f0;', false);
\$geshi2->set_line_style('color: #003030;', 'font-weight: bold; color: #003030;', true);
\$geshi2->set_code_style('color: #000020;', true);
\$geshi2->set_header_content_style('font-family: sans-serif; color: #808080; font-size: 70%; font-weight: bold; background-color: #f0f0ff; border-bottom: 1px solid #d0d0d0; padding: 2px;');
// You can use <TIME> and <VERSION> as placeholders
\$geshi2->set_footer_content_style('font-family: sans-serif; color: #808080; font-size: 70%; font-weight: bold; background-color: #f0f0ff; border-top: 1px solid #d0d0d0; padding: 2px;');" >> tmp/spip/page-$1-$j.php
echo "echo '<p>[#$line<-]<h3>$line</h3> - [Retour à la liste des répertoires et fichiers->article$p#tree] - [Retour à la liste des fonctions->article$p#outil_sommaire_8]</p>';" >> tmp/spip/page-$1-$j.php
echo "\$geshi2->set_header_content('Debut du fichier "$line"');" >> tmp/spip/page-$1-$j.php
echo "\$geshi2->set_footer_content('Fin du fichier "$line"');" >> tmp/spip/page-$1-$j.php
echo "\$geshi2->load_from_file(\"/iso/sites/codes-libres/dezip-clean/$line\", \$lookup);" >> tmp/spip/page-$1-$j.php
echo "echo \$geshi2->parse_code();" >> tmp/spip/page-$1-$j.php
echo "?>" >> tmp/spip/page-$1-$j.php
echo "fin_html "$nart
echo $nart > ./num
done < tmp/fichiers-html-$1.txt
j=$[ $j + 1 ]
echo "jhtml $j"
echo $j > ./j
fi
h="1"
echo "<hr/>" >> tmp/spip/page-$1-$h.php