get_wiki2html.sh from Jajuk at Krugle
Show get_wiki2html.sh syntax highlighted
#!/bin/sh
#Dependency: apt-get install wget
## Configuration ##
#direcory of the config files
CONF="/data/jajuk-manual/"
SVN_DIR="svn-2be-committed"
#directory where the SVN to Be committed is:
SVN_2BC="/data/jajuk-manual/$SVN_DIR"
SVN_TMP="/data/jajuk-manual/$SVN_DIR-tmp"
#directory of the default HTML directory
DEFAULT_HTML="$SVN_2BC/jajuk-hs/default/html/"
DEFAULT_HTML_FRENCH="$SVN_2BC/jajuk-hs/fr/html/"
#directory of the images for HTML pages
IMAGES_DIR="$SVN_2BC/images/"
#file containing the list of file to be wiki2html
FILE_LIST="$CONF/jajuk-manual-wiki-files-list.txt"
FILE_LIST_FRENCH="$CONF/jajuk-manual-wiki-files-list-french.txt"
#
#URL="http://wiki.jajuk.info/index.php/Special:Wiki2XML?doit=1&whatsthis=wikitext/articlelist&site=wiki.jajuk.info&output_format=docbook_html&text="
#document_title=
URL="http://wiki.jajuk.info/index.php/Special:Wiki2XML?doit=1&whatsthis=articlelist&site=wiki.jajuk.info/&output_format=xhtml&keep_categories=0&add_gfdl=0&keep_interlanguage=0&use_templates=none&text="
## End of Configuration ##
#Do some cleaning first?
#/bin/rm -rf $SVN_2BC
svn_co () {
echo "=> svn co: (Be patient, this can take a few seconds...)"
if [ ! -d $DEFAULT_HTML ]; then
echo " creating: $DEFAULT_HTML"
mkdir $SVN_2BC
fi
if (! svn co https://jajuk.svn.sourceforge.net/svnroot/jajuk/trunk/jajuk/src/doc/ $SVN_DIR) ; then
echo " error getting the svn, exiting."
exit 1
fi
#copy the SVN
rm -rf $SVN_TMP
cp -a $SVN_DIR $SVN_TMP
cd $SVN_2BC
if [ ! -d $DEFAULT_HTML ]; then
echo " error in SVN: no $DEFAULT_HTML ,exiting."
exit 1
fi
if [ ! -d $IMAGES_DIR ]; then
echo " error in SVN: no $IMAGES_DIR ,exiting."
exit 1
fi
#mkdir -p $IMAGES_DIR
#mkdir -p $DEFAULT_HTML
}
#read file with the list of the Jajuk manual pages
get_wiki_pages_in_html () {
cd $DEFAULT_HTML
echo "=> get_wiki_pages_in_html: "
for i in $(cat $FILE_LIST | tr A-Z a-z | sed 's/ /_/g') ; do
echo " wget -q \"$URL$i\" -O $i.html"
if (! wget -q "$URL$i" -O $i.html ) ; then
echo " wget error getting $i : $URL$i (exiting)."
exit 1
fi
done
}
format_html_source () {
echo "=> format_html_source: "
cd $DEFAULT_HTML
for i in *.* ; do
sed -i 's/>/>\n/g' $i
done
}
download_images () {
echo "=> download_images: "
cd $DEFAULT_HTML
#grep "wiki.jajuk.info/\/images/" * | cut -d\" -f 2-2 | sed 's/wiki.jajuk.info\/images/wiki.jajuk.info\/upload/g'> /tmp/images_list-stuff.txt
grep href * | grep http://wiki.jajuk.info//images/ | cut -d\" -f 2-2 | sed 's/wiki.jajuk.info\/\/images/wiki.jajuk.info\/upload/g' > /tmp/images_list-stuff.txt
if (! wget -q -i /tmp/images_list-stuff.txt --no-clobber --force-directories ) ; then
echo " wget error getting images (exiting)."
exit 1
fi
cp -va wiki.jajuk.info/upload/* $IMAGES_DIR
rm -rf wiki.jajuk.info
}
correct_image_links () {
echo "=> correct_image_links: "
cd $DEFAULT_HTML
for i in *.* ; do
sed -i 's/http:\/\/wiki.jajuk.info\/\/images\//..\/images\//g' $i
done
}
# if we add more language in the wiki, it will be easy to adapt the following for other language
get_wiki_pages_in_html_french () {
cd $DEFAULT_HTML_FRENCH
echo "=> get_wiki_pages_in_html_french: "
for i in $(cat $FILE_LIST_FRENCH | tr A-Z a-z | sed 's/ /_/g') ; do
echo " wget -q \"$URL$i\" -O $i.html"
if (! wget -q "$URL$i" -O $i.html ) ; then
echo " wget error getting $i : $URL$i (exiting)."
exit 1
fi
done
}
format_html_source_french () {
echo "=> format_html_source_french: "
cd $DEFAULT_HTML_FRENCH
for i in *.* ; do
sed -i 's/>/>\n/g' $i
done
}
correct_image_links_french () {
echo "=> correct_image_links_french: "
cd $DEFAULT_HTML_FRENCH
for i in *.* ; do
sed -i 's/http:\/\/wiki.jajuk.info\/\/images\//..\/images\//g' $i
done
}
## MAIN ##
svn_co
## default manual
get_wiki_pages_in_html
format_html_source
download_images
correct_image_links
## french manual
get_wiki_pages_in_html_french
format_html_source_french
correct_image_links_french
cd $CONF
echo " "
echo "The following must be made by hand"
echo "=> Any changes made? compage with previous SVN"
echo " diff -u -r $SVN_DIR $SVN_TMP"
echo "=> Do we have new images? if yes: "
echo " cd images ; for i in * ; do svn add \$i ; done"
echo "=> Did everything worked well? then you may want to commit:"
echo " svn commit $SVN_DIR -m \"manual update from wiki2html\" "
#bug svn propdel 'svn:eol-style' -R svn-2be-committed/jajuk-hs/default/html/
#--username --dry-run
## END ##
See more files for this project here
Jajuk is a jukebox for all platforms. The main goal of this project is to provide a fully-featured application to advanced users with large or scattered music collections.
Project homepage:
http://sourceforge.net/projects/jajuk
Programming language(s): Java,XML
License: other
icons/
16x16/
add.png
add_shuffle.png
album.png
author.png
bestof.png
bookmark_add.png
bookmark_folder2.png
clear.png
clock.png
complex_search.png
configuration_perspective.png
configure.png
connect_established.png
contents.png
continue.png
ddj.png
delete.png
dir_desynchro.png
dir_synchro.png
down.png
edit.png
edittrash.png
exec.png
exit.png
fileopen.png
filesave.png
filter.png
folder.png
gohome.png
help.png
help_perspective.png
info.png
intro.png
jajuk-logo.png
left.png
logical_perspective.png
misc.png
mount.png
mute.png
netsearch.png
new.png
newList.png
next.png
norm.png
novelties.png
ok.png
physical_perspective.png
play.png
player_fwd.png
player_pause.png
player_perspective.png
player_play.png
player_rew.png
player_stop.png
playlist.png
position.png
presence_unknown.png
previous.png
properties.png
refresh.png
remove.png
repeat.png
right.png
run.png
save.png
saveas.png
shuffle.png
shuffle_global.png
star1.png
star2.png
star3.png
star4.png
statistics_perspective.png
stop.png
style.png
synchro.png
test.png
thumbnail.png
tip.png
track.png
type_mp3.png
type_ogg.png
type_wav.png
undo.png
unmount.png
unmute.png
up.png
viewmag.png
void.png
volume.png
wizard.png
22x22/
cdaudio_mount.png
cdaudio_unmount.png
cdrom_mount.png
cdrom_unmount.png
ext_dd_mount.png
ext_dd_unmount.png
folder_mount.png
folder_unmount.png
jajuk-logo.png
ko.png
nfs_mount.png
nfs_unmount.png
ok.png
player_mount.png
player_unmount.png
remote_mount.png
remote_unmount.png
undo.png
40x40/
folder_open.png
perspective_catalog.png
perspective_configuration.png
perspective_help.png
perspective_information.png
perspective_logic.png
perspective_physic.png
perspective_player.png
perspective_stat.png
playlist_bestof.png
playlist_bookmark.png
playlist_new.png
playlist_normal.png
playlist_novelties.png
playlist_queue.png
tip.png
48x48/
perspective_catalog.png
perspective_configuration.png
perspective_help.png
perspective_information.png
perspective_logic.png
perspective_physic.png
perspective_player.png
perspective_stat.png
64x64/
cdaudio_mount.png
cdaudio_unmount.png
cdrom_mount.png
cdrom_unmount.png
ext_dd_mount.png
ext_dd_unmount.png
folder_mount.png
folder_unmount.png
jajuk-logo.png
new.png
nfs_mount.png
nfs_unmount.png
player_mount.png
player_unmount.png
remote_mount.png
remote_unmount.png
images/
0/
1/
2/
3/
4/
5/
6/
7/
8/
9/
a/
b/
c/
d/
e/
f/
cols01.jpg
cols02.jpg
command_01.jpg
dj01.jpg
pav01.jpg
pm01.jpg
pm02.jpg
pm04.jpg
pm05.jpg
pm06.jpg
tray01.jpg
jajuk-hs/
default/
fr/
LICENSE.txt
README.html
get_wiki2html.sh
procedures.txt