/[clonezilla-sysresccd]/trunk/www/working/scripts/html2txt
ViewVC logotype

Contents of /trunk/www/working/scripts/html2txt

Parent Directory Parent Directory | Revision Log Revision Log


Revision 46 - (show annotations)
Thu May 20 11:24:47 2010 UTC (11 years, 4 months ago) by sng
File size: 3566 byte(s)
updating scripts
1 #!/bin/bash
2 ##############################################################################
3 # #
4 # html2txt, (C) 2007-2010 S. Georgaras <sng@hellug.gr> #
5 # #
6 # This file is part of Clonezilla-SysRescCD. #
7 # #
8 # Clonezilla-SysRescCD is free software: you can redistribute it and/or #
9 # modify it under the terms of the GNU General Public License as published #
10 # by the Free Software Foundation, either version 2 of the License, or #
11 # (at your option) any later version. #
12 # #
13 # Clonezilla-SysRescCD is distributed in the hope that it will be useful, #
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16 # GNU General Public License for more details. #
17 # #
18 # You should have received a copy of the GNU General Public License along #
19 # with Clonezilla-SysRescCD. If not, see <http://www.gnu.org/licenses/>. #
20 # #
21 ##############################################################################
22
23 cd ..
24 # cd ..
25 # set -x
26 # cd /d/site/clonezilla-sysresccd/new-site/working
27 rm ../2doc/README.txt 2>/dev/null
28 touch ../2doc/README.txt
29 for n in usb.html \
30 boot-params.html \
31 clonezilla.html \
32 backup.html \
33 backup-smb.html \
34 restoration.html \
35 restore.html \
36 restore-burn.html \
37 reloc-img.html \
38 supergrubdisk.html \
39 oldboot.html \
40 sysresccd.html \
41 partitions.html \
42 recover.html \
43 own-scripts.html \
44 annex-a-devices.html
45
46 #for n in restoration.html
47
48 do
49
50 cat "$n" | tr -d '\r'|sed '/^[ ][ ]*$/s///
51 1,/<div id="content">/{
52 /<[hH]3>/!d
53 s|<[hH]3>|[H3]|g
54 }
55 /^[ ][ ]*$/d
56 /<div id="footer">/,$d
57 s|<[aA] [hH][rR][eE][fF]="http:\([^"]*\)" [^>]*>\([^h][^t][^t][^p][^<]*\)</[aA]>|\2 {{ http:\1 }}|
58 s|.*<[iI][mM][gG] [sS][rR][cC]="\([^"]*\)"[^>]*>.*|[[ \1 ]]|g
59 s|images/||g
60 s|<!--txt-only--><!--||g
61 s|--><!--end-txt-only-->||g
62 /<!--not-on-txt-->/!b
63 :a
64 /<!--end-not-on-txt-->/!{
65 N
66 ba
67 }
68 s/<!--not-on-txt-->.*<!--end-not-on-txt-->//' | sed '/<head>/!b
69 :a
70 /<\/head>/!{
71 N
72 ba
73 }
74 s/<head>.*<\/head>//' | sed '/<[Hh]2/a\
75 ****************************************
76 /\[H3\]/a\
77 ==============================================================================
78 s|\[H3\]||g
79 s|^Documentation: ||
80 /<[Hh]3>/a\
81 ---------------------
82 s|<[Hh]4>|<H4>> |g
83 s| <span class="hideprint">.*</span>||g
84 s|<li[^>]*>|* |g
85 /<H1/{
86 s|>[ ][ ]*|>|
87 s|<br>| - |g
88 }
89
90 :a
91 s/<[^>]*>//g;/</N;//ba' | sed 's|[ ][ ]*| |g
92
93 s|&nbsp;| |g
94 s| \[^\]||
95 ' | sed '/^ * *$/N;/\n$/D
96 s|&gt;|>|g
97 s|&lt;|<|g
98 s|&#038;|\&|
99 s|&&*|\&|
100 s|&#177;|+/-|
101 s|&amp;|\&|
102 /^-->$/d
103 s|-->||
104 ' | sed '
105 /^[ ][ ]*$/d' | sed '
106 /^$/{
107 $!N
108 /^\n$/D
109 }
110 /^\*\*\*\*\*\*/{
111 $!N
112 $!N
113 s/\n\n/\n/
114 }
115 /^---------------------/{
116 $!N
117 $!N
118 s/\n\n/\n/
119 }' | fmt -s -w78 >> ../2doc/README.txt
120
121 echo >> ../2doc/README.txt
122 echo >> ../2doc/README.txt
123 echo >> ../2doc/README.txt
124
125 done
126 cp 2doc/README.txt /d/site/clonezilla-sysresccd/new-site/2doc/README.txt
127
128 rm /d/site/clonezilla-sysresccd/2doc/README-EL.txt 2>/dev/null
129
130
131

Properties

Name Value
svn:executable *

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26