/[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 42 - (show annotations)
Tue May 18 14:22:00 2010 UTC (13 years, 10 months ago) by sng
File size: 3248 byte(s)
- Moving the scripts used to create the documentation
under their own directory (trunk/www/working/scripts)
- Deleting onepage.php (replaced by onepage.html)

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 /d/site/clonezilla-sysresccd/new-site/2doc/README.txt 2>/dev/null
27 touch /d/site/clonezilla-sysresccd/new-site/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///' |sed '1,/<div id="content">/{
50 /<[hH]3>/!d
51 s|<[hH]3>|[H3]|g
52 }'| sed '/^[ ][ ]*$/d' | sed '/<div id="footer">/,$d'| sed 's|<[aA] [hH][rR][eE][fF]="http:\([^"]*\)" [^>]*>\([^h][^t][^t][^p][^<]*\)</[aA]>|\2 {{ http:\1 }}|' | sed 's|.*<[iI][mM][gG] [sS][rR][cC]="\([^"]*\)"[^>]*>.*|[[ \1 ]]|g
53 s|images/||g' | sed 's|<!--txt-only--><!--||g'|sed 's|--><!--end-txt-only-->||g' | sed '/<!--not-on-txt-->/!b
54 :a
55 /<!--end-not-on-txt-->/!{
56 N
57 ba
58 }
59 s/<!--not-on-txt-->.*<!--end-not-on-txt-->//' | sed '/<head>/!b
60 :a
61 /<\/head>/!{
62 N
63 ba
64 }
65 s/<head>.*<\/head>//' | sed '/<[Hh]2/a\
66 ****************************************' |sed '/\[H3\]/a\
67 ==============================================================================' | sed 's|\[H3\]||g' | sed 's|^Documentation: ||' |sed '/<[Hh]3>/a\
68 ---------------------' | sed 's|<[Hh]4>|<H4>> |g' |sed 's| <span class="hideprint">.*</span>||g
69 s|<li[^>]*>|* |g
70 /<H1/{
71 s|>[ ][ ]*|>|
72 s|<br>| - |g
73 }
74 ' | sed -e :a -e 's/<[^>]*>//g;/</N;//ba' | sed 's|[ ][ ]*| |g
75 s|&nbsp;| |g
76 s| \[^\]||
77 ' | sed '/^ * *$/N;/\n$/D' | sed 's|&gt;|>|g' | sed 's|&lt;|<|g' |sed 's|&#038;|\&|'|sed 's|&&*|\&|'| sed 's|&#177;|+/-|'| sed 's|&amp;|\&|' | sed '/^-->$/d' | sed 's|-->||'| sed '/^[ ][ ]*$/d'|sed '/^$/{
78 $!N
79 /^\n$/D
80 }' |sed '/^\*\*\*\*\*\*/{
81 $!N
82 $!N
83 s/\n\n/\n/
84 }' | sed '/^---------------------/{
85 $!N
86 $!N
87 s/\n\n/\n/
88 }' | fmt -s -w78 >> /d/site/clonezilla-sysresccd/new-site/2doc/README.txt
89
90 # | fmt -s -w78
91
92 echo >> /d/site/clonezilla-sysresccd/new-site/2doc/README.txt
93 echo >> /d/site/clonezilla-sysresccd/new-site/2doc/README.txt
94 echo >> /d/site/clonezilla-sysresccd/new-site/2doc/README.txt
95
96 done
97
98 rm /d/site/clonezilla-sysresccd/2doc/README-EL.txt 2>/dev/null
99
100
101

Properties

Name Value
svn:executable *

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26