Difference between revisions of "MediaWiki"

From YobiWiki
Jump to navigation Jump to search
Line 28: Line 28:
 
Dialogs are not yet packaged, cf bugreports 419918 and 448912, so for now:
 
Dialogs are not yet packaged, cf bugreports 419918 and 448912, so for now:
 
perl -MCPAN -e 'install HTML::WikiConverter::MediaWiki'
 
perl -MCPAN -e 'install HTML::WikiConverter::MediaWiki'
  +
  +
Here is the script I used to import my phpwiki pages:
  +
<pre>
  +
#!/bin//bash
  +
  +
  +
for i in lists/*; do
  +
mkdir -p $(basename $i)
  +
cd $(basename $i)
  +
for p in $(cat ../$i); do
  +
echo $p
  +
if [ ! -e "$p.html" ]; then
  +
wget -q -O - "http://wiki.teuwen.org/$p" > "$p.html"
  +
fi
  +
cat > "$p.txt" <<EOF
  +
''Converted with [[MediaWiki#HTML-WikiConverter|HTML::WikiConverter::MediaWiki]] from my old phpwiki site''
  +
----
  +
EOF
  +
cat "$p.html"|\
  +
awk '
  +
/class=.wikitext/ {b=1};
  +
/Begin browse-footer/ {b=0};
  +
b==1' \
  +
| sed 's/<div class="wikitext">//g' \
  +
| sed 's/<span style="white-space: nowrap">//g' \
  +
| sed 's/<span class="wikipage">//g' \
  +
| sed 's/<img src="\/phpwikidata\/themes\/[a-zA-Z0-9]\+\/images\/[a-zA-Z0-9]\+.png" alt="" class="linkicon" border="0" \/>//g' \
  +
| sed 's/\x92/\x27/g' \
  +
|html2wiki --encoding iso-8859-1 --dialect MediaWiki >> "$p.txt"
  +
# >> "$p.txt"
  +
done
  +
cd ..
  +
done
  +
  +
</pre>

Revision as of 01:37, 24 February 2008

Install

Version 1.5 was not yet on amd64 feeds but v1.4.x reclaimed php4 so I took mediawiki v1.5 from the i386 feeds as anyway mediawiki is all arch.

  • Raise the PHP memory limit: create /var/lib/mediawiki1.5/.htaccess with%%%php_value memory_limit 32M

Preventing access to pages

Better solution seems to use this patch:

Or as refered on http://meta.wikimedia.org/wiki/Hidden_pages this one:

Disable anonymous reading

Easy to get:

Customisation

Logo

  • I created a symlink from /var/lib/mediawiki1.5/local to /etc/mediawiki1.5/localdata
  • In LocalSettings.php: $wgLogo = "$wgScriptPath/local/mylogo.png";

Import/Export

HTML-WikiConverter

apt-get install libhtml-wikiconverter-perl

Dialogs are not yet packaged, cf bugreports 419918 and 448912, so for now:

perl -MCPAN -e 'install HTML::WikiConverter::MediaWiki'

Here is the script I used to import my phpwiki pages:

#!/bin//bash


for i in lists/*; do
    mkdir -p $(basename $i)
    cd $(basename $i)
    for p in $(cat ../$i); do
	echo $p
	if [ ! -e "$p.html" ]; then
	    wget -q -O - "http://wiki.teuwen.org/$p" > "$p.html"
	fi
	cat > "$p.txt" <<EOF
''Converted with [[MediaWiki#HTML-WikiConverter|HTML::WikiConverter::MediaWiki]] from my old phpwiki site''
----
EOF
	cat "$p.html"|\
	   awk '
		/class=.wikitext/ {b=1};
		/Begin browse-footer/ {b=0};
		b==1' \
	 | sed 's/<div class="wikitext">//g' \
	 | sed 's/<span style="white-space: nowrap">//g' \
	 | sed 's/<span class="wikipage">//g' \
	 | sed 's/<img src="\/phpwikidata\/themes\/[a-zA-Z0-9]\+\/images\/[a-zA-Z0-9]\+.png" alt="" class="linkicon" border="0" \/>//g' \
	 | sed 's/\x92/\x27/g' \
	 |html2wiki --encoding iso-8859-1 --dialect MediaWiki >> "$p.txt"
#	  >> "$p.txt"
    done
    cd ..
done