TARGET=wiki.txt
UPLOAD=/Users/hylom/otptools/sfmag2wiki/s2wupload.pl
ATTACH=/Users/hylom/otptools/sfmag2wiki/s2wattach.pl
+CONV=/Users/hylom/otptools/sfmag2wiki/sfmag_html2wiki.py
+FETCHDIR=/Users/hylom/otptools/sfmag2wiki/fetch
+OUTDIR=/Users/hylom/otptools/sfmag2wiki/tree3
+DIRNAME:=$(shell basename $$PWD)
attachments=$(wildcard *.png *jpg *.gif)
targets=wiki.txt.cache $(patsubst %,%.cache, $(attachments))
rm -f *.cache
prep:
- for i in *;do [ -d $$i ] && ln -sf ../Makefile $$i/Makefile; done
\ No newline at end of file
+ for i in *;do [ -d $$i ] && ln -sf ../Makefile $$i/Makefile; done
+
+update:
+ @echo $(CONV) $(FETCHDIR)/$(subst -,/,$(DIRNAME)).body.html $(FETCHDIR) $(OUTDIR)
self._inner = {}
self._url_r_map = {}
self._pre_data = ""
+ self._in_column = False
def set_url_replace_list(self, fname):
f = open(fname, "r")
if ("class", "navigation") in attrs:
self._in_div = 1
self._block = True
+ elif ("class", "column") in attrs:
+ self._in_div = 1
+ self._in_column = True
+ self._put("""{{{ html
+<div class="column">
+}}}
+""")
elif self._in_div > 0:
self._in_div += 1
if self._in_div == 0:
self._block = False
+
+ if self._in_column:
+ self._in_column = False
+ self._put("""{{{ html
+</div>
+}}}
+""")
+
def _h_start_pre(self, tag, attrs):
pass
--- /dev/null
+#!/bin/sh
+CONV=./sfmag_html2wiki.py
+dir=$1
+out=$2
+list=$3
+if [ "$list" == "" ]; then
+ echo "$0 <input_directory> <output_directory> <list>"
+ exit
+fi
+
+for url in `cat $list`
+do
+ rpath=${url#http://sourceforge.jp/magazine}
+ #echo find $dir/$rpath -name "body.html" -exec $CONV {} $dir $out \;
+ find $dir/$rpath -name "body.html" -exec $CONV {} $dir $out \;
+done
+
+
+#cat $dir/navigation.txt > $dir/navi.txt
\ No newline at end of file