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

Annotation of /trunk/www/working/scripts/html2txt

Parent Directory Parent Directory | Revision Log Revision Log


Revision 46 - (hide annotations)
Thu May 20 11:24:47 2010 UTC (13 years, 10 months ago) by sng
File size: 3566 byte(s)
updating scripts
1 sng 28 #!/bin/bash
2 sng 42 ##############################################################################
3 sng 46 # #
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 sng 42 ##############################################################################
22 sng 46
23 sng 42 cd ..
24 sng 43 # cd ..
25 sng 28 # set -x
26 sng 43 # cd /d/site/clonezilla-sysresccd/new-site/working
27     rm ../2doc/README.txt 2>/dev/null
28     touch ../2doc/README.txt
29 sng 28 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 sng 43 cat "$n" | tr -d '\r'|sed '/^[ ][ ]*$/s///
51     1,/<div id="content">/{
52 sng 28 /<[hH]3>/!d
53     s|<[hH]3>|[H3]|g
54 sng 43 }
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 sng 28 :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 sng 43 ****************************************
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 sng 28 s|<li[^>]*>|* |g
85     /<H1/{
86     s|>[ ][ ]*|>|
87     s|<br>| - |g
88     }
89 sng 43
90     :a
91     s/<[^>]*>//g;/</N;//ba' | sed 's|[ ][ ]*| |g
92    
93 sng 28 s|&nbsp;| |g
94     s| \[^\]||
95 sng 43 ' | 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 sng 28 $!N
108     /^\n$/D
109 sng 43 }
110     /^\*\*\*\*\*\*/{
111 sng 28 $!N
112     $!N
113     s/\n\n/\n/
114 sng 43 }
115     /^---------------------/{
116 sng 28 $!N
117     $!N
118     s/\n\n/\n/
119 sng 43 }' | fmt -s -w78 >> ../2doc/README.txt
120 sng 28
121 sng 43 echo >> ../2doc/README.txt
122     echo >> ../2doc/README.txt
123     echo >> ../2doc/README.txt
124 sng 28
125     done
126 sng 43 cp 2doc/README.txt /d/site/clonezilla-sysresccd/new-site/2doc/README.txt
127 sng 28
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