Create MediaWiki page 'Home'

This commit is contained in:
MediaWiki default 2011-06-15 02:39:50 +00:00 committed by moparisthebest
commit b928dbe13a
3 changed files with 62 additions and 0 deletions

2
Categories.mediawiki Normal file
View File

@ -0,0 +1,2 @@
<!-- DO NOT EDIT THIS FILE, CODE AUTOMATICALLY GENERATED BY category.sh -->
The following categories contain pages or media.

8
Home.mediawiki Normal file
View File

@ -0,0 +1,8 @@
'''MediaWiki has been successfully installed.'''
Consult the [http://meta.wikimedia.org/wiki/Help:Contents User's Guide] for information on using the wiki software.
== Getting started ==
* [http://www.mediawiki.org/wiki/Manual:Configuration_settings Configuration settings list]
* [http://www.mediawiki.org/wiki/Manual:FAQ MediaWiki FAQ]
* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki release mailing list]

52
category.sh Executable file
View File

@ -0,0 +1,52 @@
#!/bin/bash
cd "$(dirname "$0")"
function prepareFile(){
path="$1"
tmp_path="$(basename "$path").tmp"
(
grep 'CODE AUTOMATICALLY GENERATED BY category.sh -->' "$path" &>/dev/null
if [ $? -eq 0 ]
then
sed -n '/CODE AUTOMATICALLY GENERATED BY category.sh -->/q;p' "$path"
else
cat "$path" && echo
fi
echo -e '<!-- DO NOT EDIT BELOW THIS LINE, OR CHANGE THIS COMMENT, CODE AUTOMATICALLY GENERATED BY category.sh -->'
) > "$tmp_path"
echo "$tmp_path"
}
function finishFile(){
path="$1"
tmp_path="$(basename "$path").tmp"
mv "$tmp_path" "$path"
}
files_lines_categories="$(grep '^\[\[Category [^]./\]*\]\]$' *)"
#echo "files_lines_categories: $files_lines_categories"
echo '<!-- DO NOT EDIT THIS FILE, CODE AUTOMATICALLY GENERATED BY category.sh -->' > Categories.mediawiki
echo 'The following categories contain pages or media.' >> Categories.mediawiki
echo "$files_lines_categories" | grep -o 'Category [^]]*' | sort | uniq | while read category
do
#echo "category: $category"
category_file="$(echo "$category" | sed 's/ /-/g').mediawiki"
echo "category_file: $category_file"
result="$(prepareFile "$category_file")"
echo "== '''Pages in category \"$(echo $category | sed 's/Category //')\"''' ==" >> "$result"
files="$(echo "$files_lines_categories" | grep ":\[\[${category}\]\]$" | sort)"
num_pages="$(echo "$files" | wc -l)"
echo -e "* [[$category]] ($num_pages members)" >> Categories.mediawiki
echo "The following $num_pages pages are in this category." >> "$result"
echo "$files" | while read file
do
echo "* [[$(echo $file | sed -e "s/\.mediawiki:\[\[${category}\]\]$//" -e 's/-/ /g')]]"
done >> "$result"
finishFile "$category_file"
done