/[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 43 - (show annotations)
Tue May 18 17:41:12 2010 UTC (13 years, 10 months ago) by sng
File size: 2908 byte(s)
Fixing html2txt and updating README.txt

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 modify
9 # it under the terms of the GNU General Public License as published by
10 # 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
19 # along with Clonezilla-SysRescCD. If not, see <http://www.gnu.org/licenses/>.
20 #
21 ##############################################################################
22 cd ..
23 # cd ..
24 # set -x
25 # cd /d/site/clonezilla-sysresccd/new-site/working
26 rm ../2doc/README.txt 2>/dev/null
27 touch ../2doc/README.txt
28 for n in usb.html \
29 boot-params.html \
30 clonezilla.html \
31 backup.html \
32 backup-smb.html \
33 restoration.html \
34 restore.html \
35 restore-burn.html \
36 reloc-img.html \
37 supergrubdisk.html \
38 oldboot.html \
39 sysresccd.html \
40 partitions.html \
41 recover.html \
42 own-scripts.html \
43 annex-a-devices.html
44
45 #for n in restoration.html
46
47 do
48
49 cat "$n" | tr -d '\r'|sed '/^[ ][ ]*$/s///
50 1,/<div id="content">/{
51 /<[hH]3>/!d
52 s|<[hH]3>|[H3]|g
53 }
54 /^[ ][ ]*$/d
55 /<div id="footer">/,$d
56 s|<[aA] [hH][rR][eE][fF]="http:\([^"]*\)" [^>]*>\([^h][^t][^t][^p][^<]*\)</[aA]>|\2 {{ http:\1 }}|
57 s|.*<[iI][mM][gG] [sS][rR][cC]="\([^"]*\)"[^>]*>.*|[[ \1 ]]|g
58 s|images/||g
59 s|<!--txt-only--><!--||g
60 s|--><!--end-txt-only-->||g
61 /<!--not-on-txt-->/!b
62 :a
63 /<!--end-not-on-txt-->/!{
64 N
65 ba
66 }
67 s/<!--not-on-txt-->.*<!--end-not-on-txt-->//' | sed '/<head>/!b
68 :a
69 /<\/head>/!{
70 N
71 ba
72 }
73 s/<head>.*<\/head>//' | sed '/<[Hh]2/a\
74 ****************************************
75 /\[H3\]/a\
76 ==============================================================================
77 s|\[H3\]||g
78 s|^Documentation: ||
79 /<[Hh]3>/a\
80 ---------------------
81 s|<[Hh]4>|<H4>> |g
82 s| <span class="hideprint">.*</span>||g
83 s|<li[^>]*>|* |g
84 /<H1/{
85 s|>[ ][ ]*|>|
86 s|<br>| - |g
87 }
88
89 :a
90 s/<[^>]*>//g;/</N;//ba' | sed 's|[ ][ ]*| |g
91
92 s|&nbsp;| |g
93 s| \[^\]||
94 ' | sed '/^ * *$/N;/\n$/D
95 s|&gt;|>|g
96 s|&lt;|<|g
97 s|&#038;|\&|
98 s|&&*|\&|
99 s|&#177;|+/-|
100 s|&amp;|\&|
101 /^-->$/d
102 s|-->||
103 ' | sed '
104 /^[ ][ ]*$/d' | sed '
105 /^$/{
106 $!N
107 /^\n$/D
108 }
109 /^\*\*\*\*\*\*/{
110 $!N
111 $!N
112 s/\n\n/\n/
113 }
114 /^---------------------/{
115 $!N
116 $!N
117 s/\n\n/\n/
118 }' | fmt -s -w78 >> ../2doc/README.txt
119
120 echo >> ../2doc/README.txt
121 echo >> ../2doc/README.txt
122 echo >> ../2doc/README.txt
123
124 done
125 cp 2doc/README.txt /d/site/clonezilla-sysresccd/new-site/2doc/README.txt
126
127 rm /d/site/clonezilla-sysresccd/2doc/README-EL.txt 2>/dev/null
128
129
130

Properties

Name Value
svn:executable *

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26