/[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 60 - (show annotations)
Wed May 26 10:24:27 2010 UTC (13 years, 10 months ago) by sng
File size: 3528 byte(s)
adding SystemRescueCD 1.5.4 info, puting docs together

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

Properties

Name Value
svn:executable *

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26