/[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 52 - (hide annotations)
Thu May 20 16:24:26 2010 UTC (11 years, 2 months ago) by sng
File size: 3525 byte(s)
renaming html2offline to html2doc, fixing minor offline things, and updating oggline docs
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 52 # Go to working/ directory
24 sng 42 cd ..
25 sng 43 rm ../2doc/README.txt 2>/dev/null
26     touch ../2doc/README.txt
27 sng 28 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 sng 43 cat "$n" | tr -d '\r'|sed '/^[ ][ ]*$/s///
49     1,/<div id="content">/{
50 sng 28 /<[hH]3>/!d
51     s|<[hH]3>|[H3]|g
52 sng 43 }
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 sng 28 :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 sng 43 ****************************************
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 sng 28 s|<li[^>]*>|* |g
83     /<H1/{
84     s|>[ ][ ]*|>|
85     s|<br>| - |g
86     }
87 sng 43
88     :a
89     s/<[^>]*>//g;/</N;//ba' | sed 's|[ ][ ]*| |g
90    
91 sng 28 s|&nbsp;| |g
92     s| \[^\]||
93 sng 43 ' | 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 sng 28 $!N
106     /^\n$/D
107 sng 43 }
108     /^\*\*\*\*\*\*/{
109 sng 28 $!N
110     $!N
111     s/\n\n/\n/
112 sng 43 }
113     /^---------------------/{
114 sng 28 $!N
115     $!N
116     s/\n\n/\n/
117 sng 43 }' | fmt -s -w78 >> ../2doc/README.txt
118 sng 28
119 sng 43 echo >> ../2doc/README.txt
120     echo >> ../2doc/README.txt
121     echo >> ../2doc/README.txt
122 sng 28
123     done
124 sng 43 cp 2doc/README.txt /d/site/clonezilla-sysresccd/new-site/2doc/README.txt
125 sng 28
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