/[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 183 - (show annotations)
Mon Jul 4 13:31:17 2011 UTC (12 years, 9 months ago) by sng
File size: 3546 byte(s)
- Fixing a misplaced cd command in usb.html
- Adding a basic tutorial (basic-vi.html)
- Updating trunk site

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 basic-vi.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