slitaz-dev-tools rev 15 1.0
Add tazwikiss.
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/tazwikiss/rootfs/usr/share/applications/tazwikiss.desktop Thu Feb 24 07:41:33 2011 +0000 1.3 @@ -0,0 +1,8 @@ 1.4 +[Desktop Entry] 1.5 +Encoding=UTF-8 1.6 +Name=Wiki 1.7 +Icon=html.png 1.8 +Exec=browser http://localhost/wiki/index.sh 1.9 +Type=Application 1.10 +Categories=Office; 1.11 +
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/tazwikiss/rootfs/var/www/wiki/config-de.sh Thu Feb 24 07:41:33 2011 +0000 2.3 @@ -0,0 +1,24 @@ 2.4 +PASSWORD="test" 2.5 +PAGES_DIR="pages/" 2.6 +BACKUP_DIR="historique/" 2.7 + 2.8 +LANG="de" 2.9 +WIKI_TITLE="WiKiss" 2.10 +#START_PAGE="Startseite" 2.11 +START_PAGE="Welcome" 2.12 +HOME_BUTTON="Startseite" 2.13 +HELP_BUTTON="Hilfe" 2.14 +DEFAULT_CONTENT="Die Seite %page% ist leer." 2.15 +EDIT_BUTTON="Bearbeiten" 2.16 +DONE_BUTTON="Speichern" 2.17 +PROTECTED_BUTTON="Gesperrt Seite" 2.18 +SEARCH_BUTTON="Suche" 2.19 +SEARCH_RESULTS="Suchergebnsise" 2.20 +LIST="Seitenliste" 2.21 +RECENT_CHANGES="Kürzliche Änderungen" 2.22 +LAST_CHANGES="Letzte Änderung" 2.23 +HISTORY_BUTTON="Verlauf" 2.24 +NO_HISTORY="Keinen Verlauf gefunden." 2.25 +RESTORE="Restore" 2.26 +MDP="Passwort" 2.27 +ERROR="$MDP ist nicht korrekt."
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 3.2 +++ b/tazwikiss/rootfs/var/www/wiki/config-fr.sh Thu Feb 24 07:41:33 2011 +0000 3.3 @@ -0,0 +1,23 @@ 3.4 +PASSWORD="test" 3.5 +PAGES_DIR="pages/" 3.6 +BACKUP_DIR="historique/" 3.7 + 3.8 +LANG="fr" 3.9 +WIKI_TITLE="WiKiss : le Wiki Kiss" 3.10 +START_PAGE="Accueil" 3.11 +HOME_BUTTON="Accueil" 3.12 +HELP_BUTTON="Aide" 3.13 +DEFAULT_CONTENT="La page %page% est vide." 3.14 +EDIT_BUTTON="Éditer" 3.15 +DONE_BUTTON="Enregistrer" 3.16 +PROTECTED_BUTTON="Page verrouillée" 3.17 +SEARCH_BUTTON="Rechercher" 3.18 +SEARCH_RESULTS="Résultats de recherche pour" 3.19 +LIST="Liste des pages" 3.20 +RECENT_CHANGES="Changements récents" 3.21 +LAST_CHANGES="Dernière modification" 3.22 +HISTORY_BUTTON="Historique" 3.23 +NO_HISTORY="Aucun historique existant." 3.24 +RESTORE="Restaurer" 3.25 +MDP="Mot de passe" 3.26 +ERROR="$MDP spécifié incorrect."
4.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 4.2 +++ b/tazwikiss/rootfs/var/www/wiki/config.sh Thu Feb 24 07:41:33 2011 +0000 4.3 @@ -0,0 +1,23 @@ 4.4 +PASSWORD="test" 4.5 +PAGES_DIR="pages/" 4.6 +BACKUP_DIR="historique/" 4.7 + 4.8 +LANG="en" 4.9 +WIKI_TITLE="WiKiss : the Kiss Wiki" 4.10 +START_PAGE="Welcome" 4.11 +HOME_BUTTON="Home" 4.12 +HELP_BUTTON="Help" 4.13 +DEFAULT_CONTENT="The page %page% is empty." 4.14 +EDIT_BUTTON="Edit" 4.15 +DONE_BUTTON="Save" 4.16 +PROTECTED_BUTTON="Page protected" 4.17 +SEARCH_BUTTON="Search" 4.18 +SEARCH_RESULTS="Search results for" 4.19 +LIST="Pages list" 4.20 +RECENT_CHANGES="Recent changes" 4.21 +LAST_CHANGES="Last changes" 4.22 +HISTORY_BUTTON="History" 4.23 +NO_HISTORY="No history." 4.24 +RESTORE="Restore" 4.25 +MDP="Password" 4.26 +ERROR="Wrong password."
5.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 5.2 +++ b/tazwikiss/rootfs/var/www/wiki/index.sh Thu Feb 24 07:41:33 2011 +0000 5.3 @@ -0,0 +1,492 @@ 5.4 +#!/bin/sh 5.5 +# 5.6 +# TazWikiss - A tiny Wiki for busybox/httpd 5.7 +# Licence GNU/GPLv2 - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 5.8 +# Copyright (C) Pascal Bellard 5.9 +# Based on WiKiss - http://wikiss.tuxfamily.org/ 5.10 + 5.11 +. /usr/bin/httpd_helper.sh 5.12 + 5.13 +cd $(dirname $0) 5.14 +CONFIG=config-${HTTP_ACCEPT_LANGUAGE%%,*}.sh 5.15 +[ -r "$CONFIG" ] || CONFIG=config.sh 5.16 +. ./$CONFIG 5.17 + 5.18 +WIKI_VERSION="TazWiKiss 0.3" 5.19 + 5.20 +# Initialisations 5.21 +toc='' # Table Of Content 5.22 +CONTENT='' # contenu de la page 5.23 +HISTORY='' # lien vers l'historique 5.24 +plugins_dir="plugins/" # repertoire ou stocker les plugins 5.25 +template="template.html" # Fichier template 5.26 +PAGE_TITLE_link=true # y-a-t-il un lien sur le titre de la page ? 5.27 +editable=true # la page est editable 5.28 +urlbase="$SCRIPT_NAME" 5.29 +#urlbase="./" 5.30 + 5.31 +die() 5.32 +{ 5.33 + echo $@ 5.34 + exit 5.35 +} 5.36 + 5.37 +redirect() 5.38 +{ 5.39 + awk '{ printf "%s\r\n",$0 }' <<EOT 5.40 +HTTP/1.0 302 Found 5.41 +location: $1 5.42 + 5.43 +EOT 5.44 + exit 5.45 +} 5.46 + 5.47 +cache_auth() 5.48 +{ 5.49 + local tmp 5.50 + tmp="$(echo $1$(date +%d) | md5sum | cut -c1-8)" 5.51 + [ "$(POST sc)" == "$1" ] && AUTH=$tmp || [ "$AUTH" == "$tmp" ] 5.52 +} 5.53 + 5.54 +authentified() 5.55 +{ 5.56 + [ -n "$PASSWORDS" ] && for i in $PASSWORDS ; do 5.57 + cache_auth "$i" && return 5.58 + done 5.59 + cache_auth "$PASSWORD" 5.60 +} 5.61 + 5.62 +plugin_call_method() 5.63 +{ 5.64 + local status 5.65 + local name 5.66 + name=$1 5.67 + shift 5.68 + [ -d "$plugins_dir" ] || return 5.69 + status=false 5.70 + for i in $plugins_dir/*.sh ; do 5.71 + [ -x $i ] || continue 5.72 + grep -q "^$name()" $i || continue 5.73 + . $i 5.74 + eval $name "$@" 5.75 + [ $? == 0 ] && status=true 5.76 + done 5.77 + $status 5.78 +} 5.79 + 5.80 +curdate() 5.81 +{ 5.82 + date '+%Y-%m-%d %H:%M' 5.83 +} 5.84 + 5.85 +filedate() 5.86 +{ 5.87 + stat -c %y $1 | sed -e 's|-|/|g' -e 's/\(:..\):.*/\1/' 5.88 +} 5.89 + 5.90 +AUTH=$(GET auth) 5.91 +[ -n "$AUTH" ] || AUTH=$(POST auth) 5.92 +PAGE_TITLE="$(GET page)" 5.93 +[ -n "$PAGE_TITLE" ] || PAGE_TITLE="$(POST page)" 5.94 +if [ -z "$PAGE_TITLE" ]; then 5.95 + PAGE_TITLE="$START_PAGE" 5.96 + case "$(GET action)" in 5.97 + recent) PAGE_TITLE="$RECENT_CHANGES" ;; 5.98 + search) PAGE_TITLE="$LIST" 5.99 + [ -n "$(GET query)" ] && PAGE_TITLE="$SEARCH_RESULTS $(GET query)" 5.100 + esac 5.101 +fi 5.102 +case "$PAGE_TITLE" in 5.103 +*/*|*\&*) PAGE_TITLE="$START_PAGE" ;; 5.104 +esac 5.105 +gtime=$(GET time) 5.106 +case "$gtime" in 5.107 +*/*|*\&*) gtime="" ;; 5.108 +esac 5.109 +action=$(GET action) 5.110 +datew="$(curdate)" 5.111 +content="$(POST content)" 5.112 + 5.113 +# Ecrire les modifications, s'il y a lieu 5.114 +PAGE_txt="$PAGES_DIR$PAGE_TITLE.txt" 5.115 +if [ -n "$content" ]; then # content => page 5.116 + if authentified; then 5.117 + sed 's/</\</g' > $PAGE_txt <<EOT 5.118 +$POST_content 5.119 +EOT 5.120 + if [ -n "$BACKUP_DIR" ]; then 5.121 + complete_dir_s="$BACKUP_DIR$PAGE_TITLE/" 5.122 + if [ ! -d "$complete_dir_s" ]; then 5.123 + mkdir -p $complete_dir_s 5.124 + chmod 777 $complete_dir_s 5.125 + fi 5.126 + cat >> "$complete_dir_s$(curdate).bak" <<EOT 5.127 + 5.128 +// $datew / $REMOTE_ADDR 5.129 +$(cat $PAGE_txt) 5.130 +EOT 5.131 + fi 5.132 + plugin_call_method "writedPage" $PAGE_txt 5.133 + PAGE_TITLE="$PAGE_TITLE&auth=$AUTH" 5.134 + else 5.135 + PAGE_TITLE="$PAGE_TITLE&action=edit&error=1" 5.136 + fi 5.137 + redirect "$urlbase?page=$PAGE_TITLE" 5.138 +fi 5.139 + 5.140 +if [ -r "$PAGE_txt" -o -n "$action" ]; then 5.141 + CONTENT="" 5.142 + if [ -e "$PAGE_txt" ]; then 5.143 + TIME=$(filedate $PAGE_txt) 5.144 + CONTENT="$(cat $PAGE_txt)" 5.145 + fi 5.146 + # Restaurer une page 5.147 + [ -n "$(GET page)" -a -n "$gtime" -a "$(GET restore)" == 1 ] && 5.148 + [ -r "$BACKUP_DIR$PAGE_TITLE/$gtime" ] && 5.149 + CONTENT="$(cat $BACKUP_DIR$PAGE_TITLE/$gtime)" 5.150 + CONTENT="$(sed -e 's/\$/\$/g' -e 's/\\/\\/g' <<EOT 5.151 +$CONTENT 5.152 +EOT 5.153 +)" 5.154 +else 5.155 + CONTENT="$(sed -e "s#%page%#$PAGE_TITLE#" <<EOT 5.156 +$DEFAULT_CONTENT 5.157 +EOT 5.158 +)" 5.159 +fi 5.160 + 5.161 +htmldiff() 5.162 +{ 5.163 + local files 5.164 + local old 5.165 + local new 5.166 + old="$BACKUP_DIR$(GET page)/$1" 5.167 + new="$BACKUP_DIR$(GET page)/$2" 5.168 + [ -s "$old" ] || old=/dev/null 5.169 + [ -n "$2" -a "$2" != "none" ] || new=$PAGES_DIR$(GET page).txt 5.170 + files="$old $new" 5.171 + [ "$old" -nt "$new" -a "$old" != "/dev/null" ] && files="$new $old" 5.172 + diff -aU 99999 $files | sed -e '1,3d' -e '/^\\/d' -e 's|$|<br/>|' \ 5.173 + -e 's|^-\(.*\)$|<font color=red>\1</font>|' \ 5.174 + -e 's|^+\(.*\)$|<font color=green>\1</font>|' 5.175 +} 5.176 + 5.177 +# Actions speciales du Wiki 5.178 +case "$action" in 5.179 +edit) 5.180 + editable=false 5.181 + HISTORY="<a href=\"$urlbase?page=$(urlencode $PAGE_TITLE)\&action=history\" accesskey=\"6\" rel=\"nofollow\">$HISTORY_BUTTON</a><br />" 5.182 + CONTENT="<form method=\"post\" action=\"$urlbase\"> 5.183 +<textarea name=\"content\" cols=\"83\" rows=\"30\" style=\"width: 100%;\"> 5.184 +$CONTENT 5.185 +</textarea> 5.186 +<input type=\"hidden\" name=\"page\" value=\"$PAGE_TITLE\" /><br /> 5.187 +<p align=\"right\">" 5.188 + if authentified; then 5.189 + CONTENT="$CONTENT<input type=\"hidden\" value=\"$(POST password)\"" 5.190 + else 5.191 + CONTENT="$CONTENT$MDP : <input type=\"password\"" 5.192 + fi 5.193 + CONTENT="$CONTENT name=\"sc\" /> <input type=\"submit\" value=\"$DONE_BUTTON\" accesskey=\"s\" /></p></form>" 5.194 + ;; 5.195 +history) 5.196 + complete_dir="$BACKUP_DIR$PAGE_TITLE/" 5.197 + if [ -n "$gtime" ]; then 5.198 + HISTORY="<a href=\"$urlbase?page=$PAGE_TITLE\&action=history\" rel=\"nofollow\">$HISTORY_BUTTON</a>" 5.199 + if [ -r "$complete_dir$gtime" ]; then 5.200 + HISTORY="$HISTORY <a href=\"$urlbase?page=$PAGE_TITLE\&action=edit\&time=$gtime&restore=1\" rel=\"nofollow\">$RESTORE</a>" 5.201 + CONTENT="$(cat $complete_dir$gtime | sed -e s/$(echo -ne '\r')//g -e 's|$|<br/>|g')" 5.202 + else 5.203 + HISTORY="$HISTORY -" 5.204 + fi 5.205 + else 5.206 + HISTORY="$HISTORY_BUTTON" 5.207 + CONTENT="$NO_HISTORY" 5.208 + if [ -d $complete_dir ]; then 5.209 + CONTENT="<form method=\"GET\" action=\"$urlbase\">\n<input type=hidden name=action value=diff><input type=hidden name=page value=\"$PAGE_TITLE\">" 5.210 + for file in $(ls $complete_dir | sort -r); do 5.211 + CONTENT="$CONTENT 5.212 +<input type=radio name=f1 value=$file><input type=radio name=f2 value=$file /> 5.213 +<a href=\"$urlbase?page=$PAGE_TITLE&action=history&time=$file\">$file</a><br /> 5.214 +" 5.215 + done 5.216 + CONTENT="$CONTENT<input type=submit value=diff></form>" 5.217 + fi 5.218 + fi ;; 5.219 +diff) 5.220 + if [ -n "$(GET f1)" ]; then 5.221 + HISTORY="<a href=\"$urlbase?page=$(urlencode "$PAGE_TITLE")\&action=history\">$HISTORY_BUTTON</a>" 5.222 + CONTENT="$(htmldiff "$(GET f1)" "$(GET f2)" )" 5.223 + else 5.224 + # diff auto entre les 2 dernières versions 5.225 + ls "$BACKUP_DIR$PAGE_TITLE/" | ( sort -r ; echo none ; echo ) | head -n 2 | while read f1 f2; do 5.226 + redirect "$urlbase?page=$(urlencode "$PAGE_TITLE")&action=$action&f1=$f1&f2=$f2" 5.227 + done 5.228 + fi ;; 5.229 +search) 5.230 + PAGE_TITLE_link=false 5.231 + editable=false 5.232 + query="$(GET query)" 5.233 + n=0 5.234 + for file in $(ls $PAGES_DIR/*.txt 2> /dev/null | sort) ; do 5.235 + [ -e $file ] || continue 5.236 + echo $file | grep -qs "$query" $file /dev/stdin || continue 5.237 + file=$(basename $file ".txt") 5.238 + CONTENT="$CONTENT<a href=\"$urlbase?page=$file\">$file</a><br /> 5.239 +" 5.240 + n=$(($n + 1)) 5.241 + done 5.242 + PAGE_TITLE="$PAGE_TITLE ($n)" ;; 5.243 +recent) 5.244 + PAGE_TITLE_link=false 5.245 + editable=false 5.246 + n=0 5.247 + for file in $(ls -l $PAGES_DIR/*.txt 2> /dev/null | awk '{ print $9 }' | tail -n 10) ; do 5.248 + filename=$(basename $file ".txt") 5.249 + timestamp=$(filedate $file) 5.250 + CONTENT="$CONTENT<a href=\"$urlbase?page=$filename\">$filename</a> ($timestamp - <a href=\"$urlbase?page=$filename&action=diff\">diff</a>)<br /> 5.251 +" 5.252 + done ;; 5.253 +'') ;; 5.254 +*) 5.255 + plugin_call_method "action" $action || action="" ;; 5.256 +esac 5.257 +if [ -z "$action" ]; then 5.258 + if echo "$CONTENT" | grep -q '%html%\s'; then 5.259 + CONTENT="$(sed 's/%html%\s//' <<EOT 5.260 +$CONTENT 5.261 +EOT 5.262 +)" 5.263 + else 5.264 + tmpdir=/tmp/tazwiki$$ 5.265 + mkdir $tmpdir 5.266 + unesc="$(echo "$CONTENT" | sed 's/\^\(.\)/\n^\1\n/g' | grep '\^' |\ 5.267 + sort | uniq | grep -v "['[!]" | hexdump -e '"" 3/1 "%d " "\n"' |\ 5.268 + awk '{ printf "-e '\''s/\\^%c/\\&#%d;/g'\'' ",$2,$2}') \ 5.269 + -e 's/\\^'\\''/\\'/g' -e 's/\^\!/\!/g' \ 5.270 + -e 's/\^\[/\[/g'" 5.271 + CONTENT="$(eval sed $unesc <<EOT | \ 5.272 + sed -e 's/&/\&/g' -e s/$(echo -ne '\r')//g \ 5.273 + -e 's/&lt;/\</g' -e 's/&#\([0-9]\)/\&#\1/g' | \ 5.274 + awk -v tmpdir=$tmpdir 'BEGIN { n=1; state=0 } { 5.275 +s=$0 5.276 +while (1) { 5.277 + if (state == 0) { 5.278 + if (match(s,/\{\{/)) { 5.279 + printf "%s<pre><code>{{CODE%s}}</code></pre>",substr(s,1,RSTART-1),n 5.280 + s=substr(s,RSTART+RLENGTH) 5.281 + state=1 5.282 + } 5.283 + else { 5.284 + print s 5.285 + break 5.286 + } 5.287 + } 5.288 + if (state == 1) { 5.289 + if (match(s,/\}\}/)) { 5.290 + printf "%s",substr(s,1,RSTART-1) >> tmpdir "/CODE" n 5.291 + s=substr(s,RSTART+RLENGTH) 5.292 + n++ 5.293 + state=0 5.294 + } 5.295 + else { 5.296 + print s >> tmpdir "/CODE" n 5.297 + break 5.298 + } 5.299 + } 5.300 +} 5.301 +}' 5.302 +$CONTENT 5.303 +EOT 5.304 +)" 5.305 + plugin_call_method formatBegin 5.306 + CONTENT="$(sed -e 's/<-->/\↔/g' -e 's/<==>/\⇔/g'\ 5.307 + -e 's/-->/\→/g' -e 's/<--/\←/g' \ 5.308 + -e 's/==>/\⇒/g' -e 's/<==/\⇐/g' \ 5.309 + -e 's/([eE])/\€/g' -e 's/([pP])/\£/g' \ 5.310 + -e 's/([yY])/\¥/g' -e 's/([tT][mM])/\™/g' \ 5.311 + -e 's/([cC])/\©/g' -e 's/([rR])/\®/g' \ 5.312 + -e 's/(<=)/\≤/g' -e 's/(>=)/\≥/g' \ 5.313 + -e 's/(!=)/\≠/g' -e 's/(+-)/\±/g' <<EOT 5.314 +$CONTENT 5.315 +EOT 5.316 +)" 5.317 + rg_url="[0-9a-zA-Z\.\#/~\-\_%=\?\&,\+\:@;!\(\)\*\$']*" # TODO: verif & / & 5.318 + rg_link_local="$rg_url" 5.319 + rg_link_http="https\?://$rg_url" 5.320 + rg_img_local="$rg_url\.jpe\?g\|$rg_url\.gif\|$rg_url\.png" 5.321 + rg_img_http="$rg_link_http\.jpe\?g\|$rg_link_http\.gif\|$rg_link_http\.png" 5.322 + 5.323 + # image, image link, link, wikipedia, email ... 5.324 + CONTENT="$(sed \ 5.325 + -e "s#\[\($rg_img_http\)|*\([a-z]*\)*\]#<img src=\"\1\" alt=\"\1\" style=\"float:\2;\"/>#g" \ 5.326 + -e "s#\[\($rg_img_local\)|*\([a-z]*\)*\]#<img src=\"\1\" alt=\"\1\" style=\"float:\2;\"/>#g" \ 5.327 + -e "s#\[\($rg_img_http\)|\($rg_link_http\)|*\([a-z]*\)*\]#<a href=\"\2\" class=\"url\"><img src=\"\1\" alt=\"\1\" title=\"\1\"style=\"float:\3;\"/></a>#g" \ 5.328 + -e "s#\[\($rg_img_http\)|\($rg_link_local\)|*\([a-z]*\)*\]#<a href=\"\2\" class=\"url\"><img src=\"\1\" alt=\"\1\" title=\"\1\"style=\"float:\3;\"/></a>#g" \ 5.329 + -e "s#\[\($rg_img_local\)|\($rg_link_http\)|*\([a-z]*\)*\]#<a href=\"\2\" class=\"url\"><img src=\"\1\" alt=\"\1\" title=\"\1\"style=\"float:\3;\"/></a>#g" \ 5.330 + -e "s#\[\($rg_img_local\)|\($rg_link_local\)|*\([a-z]*\)*\]#<a href=\"\2\" class=\"url\"><img src=\"\1\" alt=\"\1\" title=\"\1\"style=\"float:\3;\"/></a>#g" \ 5.331 + -e "s#\[\([^]]*\)|\($rg_link_http\)\]#<a href=\"\2\" class=\"url\">\1</a>#g" \ 5.332 + -e "s#\[\([^]]*\)|\($rg_link_local\)\]#<a href=\"\2\" class=\"url\">\1</a>#g" \ 5.333 + -e "s#\[\($rg_link_http\)\]#<a href=\"\1\" class=\"url\">\1</a>#g" \ 5.334 + -e "s#\([^>\"]\)\($rg_link_http\)#\1<a href=\"\2\" class=\"url\">\2</a>#g" \ 5.335 + -e "s#\[?\([^]]*\)\]#<a href=\"http://$LANG.wikipedia.org/wiki/\1\" class=\"url\" title=\"Wikipedia\">\1</a>#g" \ 5.336 + -e "s#\[\([^]]*\)\]#<a href=\"$urlbase?page=\1\">\1</a>#g" \ 5.337 + -e 's#\([0-9a-zA-Z\./~\-\_][0-9a-zA-Z\./~\-\_]*@[0-9a-zA-Z\./~\-\_][0-9a-zA-Z\./~\-\_]*\)#<a href=\"mailto:\1\">\1</a>#g' \ 5.338 + -e 's#^\*\*\*\(.*\)#<ul><ul><ul><li>\1</li></ul></ul></ul>#g' \ 5.339 + -e 's#^\*\*\(.*\)#<ul><ul><li>\1</li></ul></ul>#g' \ 5.340 + -e 's#^\*\(.*\)#<ul><li>\1</li></ul>#g' \ 5.341 + -e 's,^\#\#\#\(.*\),<ol><ol><ol><li>\1</li></ol></ol></ol>,g' \ 5.342 + -e 's,^\#\#\(.*\),<ol><ol><li>\1</li></ol></ol>,g' \ 5.343 + -e 's,^\#\(.*\),<ol><li>\1</li></ol>,g' \ 5.344 + -e "s/$(printf '\r')//" <<EOT | sed \ 5.345 + -e ':x;/<\/ol>$/{N;s/\n//;$P;$D;bx;}' | sed \ 5.346 + -e ':x;/<\/ul>$/{N;s/\n//;$P;$D;bx;}' | sed \ 5.347 + -e ':x;s/<\/ul><ul>//g;tx' -e ':x;s/<\/ol><ol>//g;tx' \ 5.348 + -e 's|----*$|<hr />|' -e 's|$|<br />|' \ 5.349 + -e 's#</li>#&\n#g' -e 's#\(</h[123456]>\)<br />#\1#g' \ 5.350 + -e "s#'--\([^']*\)--'#<del>\1</del>#g" \ 5.351 + -e "s#'__\([^']*\)__'#<u>\1</u>#g" \ 5.352 + -e "s#'''''\([^']*\)'''''#<strong><em>\1</em></strong>#g" \ 5.353 + -e "s#'''\([^']*\)'''#<strong>\1</strong>#g" \ 5.354 + -e "s#''\([^']*\)''#<em>\1</em>#g" 5.355 +$CONTENT 5.356 +EOT 5.357 +)" 5.358 + while read link; do 5.359 + [ -s $PAGES_DIR$link.txt ] && continue 5.360 + CONTENT="$(sed "s/\\?page=$link\"/& class=\"pending\"/" <<EOT 5.361 +$CONTENT 5.362 +EOT 5.363 +)" 5.364 + done <<EOT 5.365 +$(grep "$urlbase?page=" <<EOM | sed -e 's/^.*\?page=\([^"]*\).*$/\1/' -e 's/&.*//' 5.366 +$CONTENT 5.367 +EOM 5.368 +) 5.369 +EOT 5.370 + while echo "$CONTENT" | grep -q '^ ' ; do 5.371 + CONTENT="$(sed 's/^\( *\) \([^ ]\)/\1\ \ \ \ \2/' <<EOT 5.372 +$CONTENT 5.373 +EOT 5.374 +)" 5.375 + done 5.376 + read hastoc <<EOT 5.377 +$CONTENT 5.378 +EOT 5.379 + CONTENT="$(sed -e 's/^ /\ \ \ \ /' -e '1s/^TOC//' <<EOT 5.380 +$CONTENT 5.381 +EOT 5.382 +)" 5.383 + toc='<div id="toc">' 5.384 + i=1 5.385 + for pat in '^![^!]' '^!![^!]' '^!!![^!]' '^!!!![^!]' '^!!!!!' ; do 5.386 + while read line; do 5.387 + [ -n "$line" ] || continue 5.388 + label="$(echo $line | sed 's/[^\dA-Za-z]/_/g')" 5.389 + toc="$(cat <<EOT 5.390 +$toc 5.391 + <h$i><a href="#$label">$line</a></h$i> 5.392 +EOT 5.393 +)" 5.394 + CONTENT="$(sed "s#^!!* *$line\$#<h$i><a name=\"$label\">$line</a></h$i>#" <<EOT 5.395 +$CONTENT 5.396 +EOT 5.397 +)" 5.398 + done <<EOT 5.399 +$(grep "$pat" <<EOM | sed -e 's/^!!*//' -e 's/#/\#/g' -e 's/&/\\\&/g' 5.400 +$CONTENT 5.401 +EOM 5.402 +) 5.403 +EOT 5.404 + i=$(( $i + 1 )) 5.405 + done 5.406 + toc="$(cat <<EOT 5.407 +$toc 5.408 +</div> 5.409 +EOT 5.410 +)" 5.411 + case "$hastoc" in 5.412 + TOC*) ;; 5.413 + *) toc='';; 5.414 + esac 5.415 + CONTENT="$(awk -v tmpdir=$tmpdir '{ 5.416 +s=$0 5.417 +while (1) { 5.418 + if (match(s,/\{\{CODE[0-9]+\}\}/)) { 5.419 + printf "%s" substr(s,1,RSTART-1) 5.420 + system("cat " tmpdir "/" substr(s,RSTART+2,RLENGTH-4)) 5.421 + s=substr(s,RSTART+RLENGTH) 5.422 + } 5.423 + else { 5.424 + print s 5.425 + break 5.426 + } 5.427 +} 5.428 +}' <<EOT 5.429 +$CONTENT 5.430 +EOT 5.431 +)" 5.432 + rm -rf $tmpdir 5.433 + plugin_call_method formatEnd 5.434 + fi 5.435 +fi 5.436 + 5.437 +# Remplacement dans le template 5.438 +RECENT="<a href=\"$urlbase?action=recent\" accesskey=\"3\">$RECENT_CHANGES</a>" 5.439 +[ "$action" == "recent" ] && RECENT=$RECENT_CHANGES 5.440 +HOME="<a href=\"$urlbase?page=$START_PAGE\" accesskey=\"1\">$HOME_BUTTON</a>" 5.441 +[ "$PAGE_TITLE" == "$START_PAGE" -a "$action" != "search" ] && HOME=$HOME_BUTTON 5.442 +HELP="\1<a href=\"$urlbase?page=$HELP_BUTTON\" accesskey=\"2\" rel=\"nofollow\">$HELP_BUTTON</a>\2" 5.443 +[ "$action" != "edit" ] && HELP="" 5.444 + 5.445 +[ -r "$template" ] || die "'$template' is missing!" 5.446 +html="$(sed -e "s#{\([^}]*\)RECENT_CHANGES\([^}]*\)}#\1$RECENT\2#" \ 5.447 + -e "s#{\([^}]*\)HOME\([^}]*\)}#\1$HOME\2#" \ 5.448 + -e "s#{\([^}]*\)HELP\([^}]*\)}#$HELP#" \ 5.449 + -e "s#{SEARCH}#<form method=\"get\" action=\"$urlbase?page=$(urlencode "$PAGE_TITLE" | sed 's/#/\\#/g')\"><div><input type=\"hidden\" name=\"action\" value=\"search\" /><input type=\"text\" name=\"query\" value=\"$(htmlentities $(GET query) )\" tabindex=\"1\" /> <input type=\"submit\" value=\"$SEARCH_BUTTON\" accesskey=\"q\" /></div></form>#" \ 5.450 + < $template )" 5.451 +[ "$action" != "" -a "$action" != "edit" -o ! -e "$PAGE_txt" ] && TIME="-" 5.452 +plugin_call_method template 5.453 +[ -n "$(GET error)" ] || ERROR="" 5.454 +[ -n "$HISTORY" ] && HISTORY="\1$HISTORY\2" 5.455 +PAGE_TITLE_str="$(htmlentities "$PAGE_TITLE")" 5.456 +$PAGE_TITLE_link && 5.457 +PAGE_TITLE_str="<a href=\"$urlbase?page=$(urlencode "$PAGE_TITLE")\">$PAGE_TITLE_str</a>" 5.458 +EDIT="$EDIT_BUTTON" 5.459 +if $editable ; then 5.460 + EDIT="$PROTECTED_BUTTON" 5.461 + [ -w "$PAGE_txt" -o ! -e "$PAGE_txt" ] && 5.462 + EDIT="<a href=\"$urlbase?page=$(urlencode "$PAGE_TITLE")\&action=edit\" accesskey=\"5\" rel=\"nofollow\">$EDIT_BUTTON</a>" 5.463 +fi 5.464 +[ -n "$toc" ] && toc="\1$toc\2" 5.465 +AUTH_GET="" 5.466 +AUTH_POST="" 5.467 +if authentified; then 5.468 + AUTH_GET="auth=$AUTH\&" 5.469 + AUTH_POST="\n<input type=\"hidden\" name=\"auth\" value=\"$AUTH\" />" 5.470 +fi 5.471 + 5.472 +header "Content-type: text/html" 5.473 +sed -e "s#{ERROR}#$ERROR#" -e "s#{WIKI_TITLE}#$WIKI_TITLE#" \ 5.474 + -e "s#{\([^}]*\)HISTORY\([^}]*\)}#$HISTORY#" \ 5.475 + -e "s#{PAGE_TITLE}#$PAGE_TITLE_str#" \ 5.476 + -e "s#{\([^}]*\)EDIT\([^}]*\)}#\1$EDIT\2#" \ 5.477 + -e "s|{\([^}]*\)TOC\([^}]*\)}|$(awk '{ printf "%s\\n" $0 }' <<EOT | \ 5.478 + sed -e 's/&/\\\&/g' -e 's/|/\\|/g' 5.479 +$toc 5.480 +EOT 5.481 +)|" \ 5.482 + -e "s#{PAGE_TITLE_BRUT}#$(htmlentities "$PAGE_TITLE")#" \ 5.483 + -e "s#{LAST_CHANGE}#$LAST_CHANGES :#" \ 5.484 + -e "s#{CONTENT}#$(awk '{ printf "%s\\n" $0 }' <<EOT | \ 5.485 + sed -e 's/&/\\\&/g' -e 's/#/\\#/g' 5.486 +$CONTENT 5.487 +EOT 5.488 +)#" \ 5.489 + -e "s#{LANG}#$LANG#" -e "s#href=\"?#href=\"$urlbase?#g" \ 5.490 + -e "s#$urlbase?#&$AUTH_GET#g" -e "s#action=\"$urlbase\">#&$AUTH_POST#g" \ 5.491 + -e "s#{WIKI_VERSION}#$WIKI_VERSION#" \ 5.492 + -e "s#{TIME}#$TIME#" -e "s#{DATE}#$datew#" \ 5.493 + -e "s#{IP}#$REMOTE_ADDR#" -e "s#{COOKIE}##" <<EOT 5.494 +$html 5.495 +EOT
6.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 6.2 +++ b/tazwikiss/rootfs/var/www/wiki/pages/Accueil.txt Thu Feb 24 07:41:33 2011 +0000 6.3 @@ -0,0 +1,12 @@ 6.4 +TOC 6.5 +!Bienvenue... 6.6 +!!...sur votre wiki 6.7 +Merci d'avoir choisi TazWiKiss l'adaptation de [WiKiss|http://wikiss.tuxfamily.org/] et de ses [greffons|?action=list] pour SliTaz. 6.8 +N'hésitez pas à parcourir cette installation par défaut, jusqu'à ce que vous vous sentiez à l'aise. 6.9 + 6.10 +!!Aide 6.11 +Pour tester l'édition et la mise en forme dans ''TazWiKiss'', cliquez simplement sur « '''Éditer''' » en haut de cet écran pour accéder à cette page (et la modifier). Vous pouvez aussi créer et tester via la page [BacASable]. 6.12 + 6.13 +Allez voir l'[Aide] et [AideTables] pour un aperçu de toutes les possibilités. Vous pouvez toujours revenir sur cette page en cliquant sur « '''Accueil''' ». 6.14 + 6.15 +'''Amusez vous !'''
7.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 7.2 +++ b/tazwikiss/rootfs/var/www/wiki/pages/Aide.txt Thu Feb 24 07:41:33 2011 +0000 7.3 @@ -0,0 +1,88 @@ 7.4 +TOC 7.5 +!Aide 7.6 +Voici un aperçu de toutes les règles de mise en forme dans ''WiKiss''. 7.7 +Cliquez sur "Éditer" en haut ou en bas de cette page pour voir comment ça se passe. 7.8 +(Si vous ne voyez que "Page verrouillée", effectuez un CHMOD 775 sur ce fichier via un logiciel FTP) 7.9 +---- 7.10 +Les titres utilisent le point d'exclamation '''!''' 7.11 +^! Gros 7.12 +^!! Moins gros 7.13 +^!!! Encore moins gros 7.14 +produit : 7.15 +! Gros 7.16 +!! Moins gros 7.17 +!!! Encore moins gros 7.18 + 7.19 +Pour générer automatiquement une table des matières dans une page, ajoutez le terme TOC dans celle-ci : 7.20 +* en dernière ligne pour plus de clarté, cela n'influe pas sur son positionnement ; 7.21 +* en 1ère ligne si vous voulez écrire TOC dans la page. Seule la 1ère occurrence sera remplacée par la table des matières. 7.22 +---- 7.23 +Les styles utilisent la simple apostrophe ' 7.24 +^''^'Gras^''^' --> '''Gras''' 7.25 +^''italique^'' --> ''italique'' 7.26 +^''^''^'Gras et italique^''^''^' --> '''''Gras et italique''''' 7.27 +---- 7.28 +La rayure de mot utilise l'apostrophe avec deux tirets 7.29 +^'--Rayé--' --> '--Rayé--' 7.30 +de même pour souligner, l'apostrophe suivit de deux blancs soulignés (underscore) 7.31 +^'__Souligné__' --> '__Souligné__' 7.32 +---- 7.33 +Les listes ordonnées utilisent le dièse '''#''' 7.34 +# Premier 7.35 +# Deuxième 7.36 +# Troisième 7.37 +---- 7.38 +Les listes non ordonnées utilisent l'étoile '''*''' 7.39 +* Pomme 7.40 +* Poire 7.41 +* Pêche 7.42 +---- 7.43 +Le code, et tous les textes où le formatage est important, utilisent deux accolades 7.44 +^{{import sys 7.45 +if len(sys.argv) == 2: 7.46 + print "Hello",sys.argv^[1]}} 7.47 +donne : 7.48 +{{import sys 7.49 +if len(sys.argv) == 2: 7.50 + print "Hello",sys.argv[1]}} 7.51 +---- 7.52 +Certains caractères spéciaux sont reconnus : 7.53 +* Flèches : <^-- : <--, ^--> : -->, <^--> : <--> 7.54 +* Copyrights : ^(c) ou ^(C) : (c), ^(r) ou ^(R) : (r) 7.55 +---- 7.56 +Les liens externes et les adresses eMail sont reconnus automagiquement ... 7.57 +^http://wikiss.tuxfamily.org/ --> http://wikiss.tuxfamily.org/ 7.58 +wikiss^@example.org --> wikiss@example.org 7.59 + 7.60 +ou au travers d'un texte entre crochets : 7.61 +'''^['''Visitez le site de WiKiss'''|'''^http://wikiss.tuxfamily.org/''']''' --> [Visitez le site de WiKiss|http://wikiss.tuxfamily.org/] 7.62 + 7.63 +avec un ? on fait un lien vers Wikipedia dans la langue courante : 7.64 +'''^[?'''Wiki''']''' --> [?Wiki] 7.65 +---- 7.66 +Les images sont incluses automagiquement en insérant l'URL de l'image que vous voulez voir entre crochets 7.67 +'''^['''^http://wikiss.tuxfamily.org/img/logo_100.png''']''' --> 7.68 +[http://wikiss.tuxfamily.org/img/logo_100.png] 7.69 + 7.70 +Vous pouvez aussi utiliser une image comme un lien : '''^['''^http://wikiss.tuxfamily.org/img/logo_100.png'''|'''^http://wikiss.tuxfamily.org/''']''' --> 7.71 +[http://wikiss.tuxfamily.org/img/logo_100.png|http://wikiss.tuxfamily.org/] 7.72 + 7.73 +Mais aussi positionner l'image de manière flottante à gauche ou à droite : 7.74 +[http://wikiss.tuxfamily.org/img/logo_100.png|left] [http://wikiss.tuxfamily.org/img/logo_100.png|http://wikiss.tuxfamily.org|right] 7.75 +<-- '''^['''^http://wikiss.tuxfamily.org/img/logo_100.png'''|left]''' 7.76 +'''^['''^http://wikiss.tuxfamily.org/img/logo_100.png'''|'''^http://wikiss.tuxfamily.org'''|right]''' --> 7.77 + 7.78 +---- 7.79 +Les liens vers les wiki-pages utilisent les crochets : 7.80 +'''^['''Acceuil''']''' --> [Accueil] 7.81 + 7.82 +Si une page n'existe pas, elle sera créée au premier clic sur son lien. 7.83 +Cliquez sur "BacASable" ci-dessous et vous pourrez tout simplement écrire cette nouvelle page ... 7.84 +[BacASable] 7.85 +---- 7.86 +... et pour insérer des lignes, utilisez quatre tirets : '''---- ''' 7.87 +---- 7.88 +Enfin, pour neutraliser la syntaxe de WiKiss, utilisez l'accent circonflexe ^^ 7.89 +Ainsi, saisir '''^^^['''WiKiss''']''' permet d'afficher ^[WiKiss] plutôt que [WiKiss] 7.90 +---- 7.91 +Essayez ! Vous verrez, c'est très simple (^_^) 7.92 \ No newline at end of file
8.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 8.2 +++ b/tazwikiss/rootfs/var/www/wiki/pages/AideTables.txt Thu Feb 24 07:41:33 2011 +0000 8.3 @@ -0,0 +1,63 @@ 8.4 +! Aide à la syntaxe des tables 8.5 + 8.6 +!! Création de table 8.7 +Les tables sont définies à l'aide du caractère | 8.8 +basiquement, il suffit de dessiner le tableau : 8.9 +{{|case 1|case 2| 8.10 +|case 3|case 4| 8.11 +}} 8.12 +donnera : 8.13 +|case 1|case 2| 8.14 +|case 3|case 4| 8.15 + 8.16 +On peut aussi faire de la mise-en-forme de cellule. Il faut pour cela indiquer quelques caractères au début de celle-ci : 8.17 +* des lettres suivies d'un espace pour définir l'alignement : 8.18 +** h : la cellule fait partie d'un titre 8.19 +** t : alignement vertical en haut 8.20 +** b : alignement vertical en bas 8.21 +** l : alignement horizontal à gauche 8.22 +** r : alignement horizontal à droite 8.23 +* deux chiffres peuvent être ajoutés pour connecter les cellules : 8.24 +** le premier indique combien de colonnes doivent être connectées 8.25 +** le second placé après une virgule connecte les lignes 8.26 + 8.27 +{{ 8.28 +|hl Titre gauche|hr Titre droite| 8.29 +|r droite |l gauche | 8.30 +|2 Deux colonnes | 8.31 +|t ,2 Deux lignes| A | 8.32 + | B | 8.33 +|,2 Deux lignes | C | 8.34 + | D |}} 8.35 + 8.36 +|hl Titre gauche|hr Titre droite| 8.37 +|r droite |l gauche | 8.38 +|2 Deux colonnes | 8.39 +|t ,2 Deux lignes| A | 8.40 + | B | 8.41 +|,2 Deux lignes | C | 8.42 + | D | 8.43 + 8.44 +!! Inclusion dans une table 8.45 +|h 3 Syntaxe supportée| 8.46 +|ht ,7 Mise en forme | ^''italique^'' | ''italique'' | 8.47 + | '^''gras'^'' | '''gras''' | 8.48 + |'^'^'^''gras italique'^'^'^''|'''''gras italique'''''| 8.49 + |^'--rayé--'|'--rayé--'| 8.50 + |^'__souligné__'|'__souligné__'| 8.51 + | Caractères spéciaux | (c) (r) --> <-- | 8.52 + |^{{code}}|{{code}}| 8.53 +|ht ,3 Liens |^[Liens] | [Liens] | 8.54 + |^[Liens 2^|?page=Liens]| [Liens 2|?page=Liens] | 8.55 + |^[?Wikipedia]| [?Wikipedia] | 8.56 +|ht ,4 Images |^[^http://wikiss.tuxfamily.org/img/logo_100.png]|[http://wikiss.tuxfamily.org/img/logo_100.png]| 8.57 + |^[/logo_100.png^|^http://wikiss.tuxfamily.org/]|[http://wikiss.tuxfamily.org/img/logo_100.png|http://wikiss.tuxfamily.org/]| 8.58 + |^[^http://wikiss.tuxfamily.org/img/logo_100.png^|right] | [http://wikiss.tuxfamily.org/img/logo_100.png|right]| 8.59 + |^[/logo_100.png^|^http://wikiss.tuxfamily.org/^|left] | [http://wikiss.tuxfamily.org/img/logo_100.png|http://wikiss.tuxfamily.org/|left]| 8.60 + 8.61 + 8.62 +|h 2 Syntaxe non supportée| 8.63 +|Titres | !! Titre| 8.64 +|,2 Listes | * non ordonnée | 8.65 + | # ordonnée | 8.66 +|Lignes |----| 8.67 \ No newline at end of file
9.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 9.2 +++ b/tazwikiss/rootfs/var/www/wiki/pages/Help.txt Thu Feb 24 07:41:33 2011 +0000 9.3 @@ -0,0 +1,127 @@ 9.4 +TOC 9.5 +!Help 9.6 + 9.7 +Here is a summary of all the formatting rules in ''WiKiss''. 9.8 +Click "Edit" on top or bottom of this page to see how it works. 9.9 +(if you see "Page Locked", do a chmod 775 on this file via a ftp client) 9.10 + 9.11 +See also [AideTables] to create tables. 9.12 + 9.13 +---- 9.14 + 9.15 +Tiles use the exclamation mark '''!'''%% 9.16 +^! Big%% 9.17 +^!! Less big%% 9.18 +^!!! Smaller%% 9.19 +gives you : 9.20 +! Big 9.21 +!! Less big 9.22 +!!! Smaller 9.23 + 9.24 +To automatically add a table of contents in a page, add the '''TOC''' mark in it : 9.25 +* at the last line to be clearer, there is no influence on position ; 9.26 +* at the first line if you need to write TOC in your page. Only the first occurrence will be replaced. 9.27 + 9.28 +---- 9.29 + 9.30 +Styles use the single quote ' 9.31 +* ^''^'Bold^''^' --> '''Bold''' 9.32 +* ^''italic^'' --> ''italic'' 9.33 +* ^''^''^'Bold and italic^''^''^' --> '''''Bold and italic''''' 9.34 + 9.35 +---- 9.36 + 9.37 +Stroke of a work use quote and two dashes%% 9.38 +^'--Stroked--' --> '--Stroked--' 9.39 + 9.40 +the same applies for underline, quote followed by by two underscore%% 9.41 +^'__Underlined__' --> '__Underlined__' 9.42 + 9.43 +---- 9.44 + 9.45 +The ordered lists use sharp '''#''' 9.46 +# First 9.47 +# Second 9.48 +# Third 9.49 + 9.50 +---- 9.51 + 9.52 +Non ordered lists use the star '''*''' 9.53 +* Apple 9.54 +* Pear 9.55 +* Peach 9.56 + 9.57 +---- 9.58 + 9.59 +The code, and all of those things where formatting is important, use the braces %% 9.60 +^{{import sys%% 9.61 +if len(sys.argv) == 2:%% 9.62 + print "Hello",sys.argv^[1]}}%% 9.63 +give : 9.64 +{{import sys 9.65 +if len(sys.argv) == 2: 9.66 + print "Hello",sys.argv[1]}} 9.67 + 9.68 +---- 9.69 + 9.70 +The separation between paragraphs of text is done through an empty line. 9.71 +To force a line break in the middle of a paragraph, use: ^%% 9.72 + 9.73 +---- 9.74 + 9.75 +Some special characters are recognized: 9.76 +* Arrows : <^-- : <--, ^--> : -->, <^--> : <--> 9.77 +* Copyrights : ^(c) or ^(C) : (c), ^(r) or ^(R) : (r) 9.78 + 9.79 +---- 9.80 + 9.81 +Links to wiki-pages use square brackets : 9.82 +'''^['''Accueil''']''' --> [Accueil] 9.83 + 9.84 +If a page does not exists, it will be created on first click. 9.85 +Click on "SandBox" below and you will be able to create it ...%% 9.86 +[SandBox] 9.87 + 9.88 +To link a wiki-page with a different text use : 9.89 +'''^['''Beginning'''|?page='''Accueil''']''' --> [Beginning|?page=Accueil] 9.90 + 9.91 +The external links and addresses eMail are automagically recognized ... 9.92 +* ^http://wikiss.tuxfamily.org/ --> http://wikiss.tuxfamily.org/ 9.93 +* wikiss^@example.org --> wikiss@example.org 9.94 + 9.95 +or through a text between square brackets : 9.96 +* '''^['''Visit WiKiss web site'''|'''^http://wikiss.tuxfamily.org/''']''' --> [Visit WiKiss web site|http://wikiss.tuxfamily.org/] 9.97 + 9.98 +with a ? you get a Wikipedia link in the current language : 9.99 +* '''^[?'''Wiki''']''' --> [?Wiki] 9.100 + 9.101 +---- 9.102 + 9.103 +Images are automagically inserted with the picture URL between square brackets%% 9.104 +'''^['''^http://wikiss.tuxfamily.org/img/logo_100.png''']''' --> 9.105 +[http://wikiss.tuxfamily.org/img/logo_100.png] 9.106 + 9.107 +You can also use an image as a link : %% 9.108 +'''^['''^http://wikiss.tuxfamily.org/img/logo_100.png'''|'''^http://wikiss.tuxfamily.org/''']''' --> 9.109 +[http://wikiss.tuxfamily.org/img/logo_100.png|http://wikiss.tuxfamily.org/] 9.110 + 9.111 +But also position the image on a floating left or right: 9.112 +[http://wikiss.tuxfamily.org/img/logo_100.png|left] [http://wikiss.tuxfamily.org/img/logo_100.png|http://wikiss.tuxfamily.org|right] 9.113 +%% 9.114 + 9.115 +<-- '''^['''^http://wikiss.tuxfamily.org/img/logo_100.png'''|left]'''%% 9.116 +'''^['''^http://wikiss.tuxfamily.org/img/logo_100.png'''|'''^http://wikiss.tuxfamily.org'''|right]''' --> 9.117 +%% 9.118 + 9.119 +---- 9.120 + 9.121 +... to insert lines, simply use four dashes : '''---- ''' 9.122 + 9.123 +---- 9.124 + 9.125 +Finally, in order to neutralize the syntax WiKiss, use the caret ^ %% 9.126 +Thus, enter '''^^^['''WiKiss''']''' can display ^[WiKiss] rather than [WiKiss] 9.127 + 9.128 +---- 9.129 + 9.130 +Try it, you'll see, it's very simple.
10.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 10.2 +++ b/tazwikiss/rootfs/var/www/wiki/pages/HelpTables.txt Thu Feb 24 07:41:33 2011 +0000 10.3 @@ -0,0 +1,70 @@ 10.4 +! Help on the table syntax 10.5 + 10.6 +!! Table creation 10.7 +Tables are defined with the pipe character | 10.8 + 10.9 +Basically you just need to draw the table : 10.10 + 10.11 +{{|cell 1|cell 2| 10.12 +|cell 3|cell 4| 10.13 +}} 10.14 + 10.15 +will be displayed as : 10.16 +|cell 1|cell 2| 10.17 +|cell 3|cell 4| 10.18 + 10.19 +You can also format your cell. For that, add some characters at the beginning : 10.20 + 10.21 +* a '''h''' if the cell is a header 10.22 +* more letters followed by a space to defined alignment : 10.23 +** t : vertically aligned on top 10.24 +** b : vertically aligned on bottom 10.25 +** l : horizontally aligned on left 10.26 +** r : horizontally aligned on right 10.27 +* two numbers can be added to connect cells 10.28 +** first one to give how many columns has to be connected 10.29 +** second one, after a comma connects lines 10.30 + 10.31 +{{ 10.32 +|hl Title on left|hr Title on right| 10.33 +|r right |l left | 10.34 +|2 Two columns | 10.35 +|t ,2 Two lines | A | 10.36 + | B | 10.37 +|,2 two lines | C | 10.38 + | D |}} 10.39 + 10.40 +|hl Title on left|hr title on right| 10.41 +|r right |l left | 10.42 +|2 Two columns | 10.43 +|t ,2 Two lines | A | 10.44 + | B | 10.45 +|,2 two lines | C | 10.46 + | D | 10.47 + 10.48 +!! Other syntax included in a table 10.49 + 10.50 +|h 3 Supported wiki syntax | 10.51 +|ht ,7 Formatting | ^''italic^'' | ''italic'' | 10.52 + | '^''bold'^'' | '''bold''' | 10.53 + |'^'^'^''bold italic'^'^'^''|'''''bold italic'''''| 10.54 + |^'--stroked--'|'--stroked--'| 10.55 + |^'__underlined__'|'__underlined__'| 10.56 + | Special chars | (c) (r) --> <-- | 10.57 + |^{{code}}|{{code}}| 10.58 +|ht ,3 Links |^[WikiLink] | [WikiLink] | 10.59 + |^[Link 2^|?page=Link]| [Link 2|?page=Link] | 10.60 + |^[?Wikipedia]| [?Wikipedia] | 10.61 +|ht ,4 Images |^[^http://wikiss.tuxfamily.org/img/logo_100.png]|[http://wikiss.tuxfamily.org/img/logo_100.png]| 10.62 + |^[/logo_100.png^|^http://wikiss.tuxfamily.org/]|[http://wikiss.tuxfamily.org/img/logo_100.png|http://wikiss.tuxfamily.org/]| 10.63 + |^[^http://wikiss.tuxfamily.org/img/logo_100.png^|right] | [http://wikiss.tuxfamily.org/img/logo_100.png|right]| 10.64 + |^[/logo_100.png^|^http://wikiss.tuxfamily.org/^|left] | [http://wikiss.tuxfamily.org/img/logo_100.png|http://wikiss.tuxfamily.org/|left]| 10.65 + 10.66 +and 10.67 + 10.68 +|h 2 Not supported syntax| 10.69 +|Titles | !! Titles| 10.70 +|,2 Lists | * non ordered | 10.71 + | # ordered | 10.72 +|Lines |----| 10.73 +
11.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 11.2 +++ b/tazwikiss/rootfs/var/www/wiki/pages/Welcome.txt Thu Feb 24 07:41:33 2011 +0000 11.3 @@ -0,0 +1,14 @@ 11.4 +TOC 11.5 +!Welcome ... 11.6 +!!... to your wiki 11.7 + 11.8 +Thanks for choosing TazWiKiss, the SliTaz port of [WiKiss|http://wikiss.tuxfamily.org/] and its [plugins|?action=list]. 11.9 +Feel free to browse the default installation, until you feel comfortable. 11.10 + 11.11 +!!Help 11.12 + 11.13 +To test edition and formatting of ''WiKiss'', just click on "'''Edit'''" on top of this screen to access (and modify) this page. You can also create and test via the [SandBox] page. 11.14 + 11.15 +Go see the [Help] and [HelpTables] for an overview of all the possibilities. You can always return to this page by clicking on "'''Home'''" 11.16 + 11.17 +'''Have fun !'''
12.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 12.2 +++ b/tazwikiss/rootfs/var/www/wiki/plugins/wkp_ListPlugins.sh Thu Feb 24 07:41:33 2011 +0000 12.3 @@ -0,0 +1,51 @@ 12.4 +plugin="<a href=\"?action=list\">ListPlugins</a>" 12.5 +description_fr="Affiche la liste des plugins chargés" 12.6 +description="List plugins" 12.7 + 12.8 +action() 12.9 +{ 12.10 + [ "$1" == "list" -o "$1" == "config" ] || return 1 12.11 + CONTENT=' 12.12 +<table width="100%"> 12.13 +<tr><td span=2><h2>Plugins</h2></td></tr> 12.14 +' 12.15 + PAGE_TITLE_link=false 12.16 + editable=false 12.17 + lang="${HTTP_ACCEPT_LANGUAGE%%,*}" 12.18 + PAGE_TITLE="Configuration" 12.19 + for i in $plugins_dir/*.sh ; do 12.20 + plugin= 12.21 + eval $(grep ^plugin= $i) 12.22 + [ -n "$plugin" ] || continue 12.23 + eval $(grep ^description= $i) 12.24 + alt="$(grep ^description_$lang= $i)" 12.25 + [ -n "$alt" ] && eval $(echo "$alt" | sed 's/_..=/=/') 12.26 + CONTENT="$CONTENT 12.27 +<tr><td><b> 12.28 +<input type=checkbox disabled=disabled $([ -x $i ] && echo 'checked=checked ')/> 12.29 +$plugin</b></td><td><i>$description</i></td></tr>" 12.30 + done 12.31 + CONTENT="$CONTENT 12.32 +<tr><td span=2><br /><h2>Locales</h2></td></tr> 12.33 +" 12.34 + for i in config-*.sh ; do 12.35 + i=${i#config-} 12.36 + i=${i%.sh} 12.37 + [ -n "$i" ] || continue 12.38 + CONTENT="$CONTENT 12.39 +<tr><td><b> 12.40 +<input type=checkbox disabled=disabled $([ "$i" == "$lang" ] && echo 'checked=checked ')/> 12.41 +$i</b></td></tr> 12.42 +" 12.43 + done 12.44 + CONTENT="$CONTENT 12.45 +<tr><td><br /><h2>Data</h2></td> 12.46 +<td><form method=\"get\" action=\"?action=saveconf\"> 12.47 +<input disabled type=\"submit\" name=\"save\" value=\"save\" /> 12.48 +<input disabled type=\"file\" name=\"file\" value=\"file\" /> 12.49 +<input disabled type=\"submit\" name=\"restore\" value=\"restore\" /> 12.50 +</form></td></tr> 12.51 +$(du -hs */ | awk '{ printf "<tr><td><b>%s</b></td><td><i>%s</i></td></tr>\n",$1,$2 }') 12.52 +</table> 12.53 +" 12.54 +}
13.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 13.2 +++ b/tazwikiss/rootfs/var/www/wiki/plugins/wkp_Rss.sh Thu Feb 24 07:41:33 2011 +0000 13.3 @@ -0,0 +1,45 @@ 13.4 +plugin="Rss" 13.5 +description_fr="Génération d'un flux Rss des derniers changements" 13.6 +description="Generate a Rss streams with last changes" 13.7 + 13.8 +writedPage() 13.9 +{ 13.10 + # Attention, bug si https ou port différent de 80 ? 13.11 + ADR_ACCUEIL="http://$SERVER_NAME$SCRIPT_NAME" 13.12 + CONTENT_RSS="" 13.13 + for file in $(ls -l $PWD/$PAGES_DIR/*.txt 2> /dev/null | awk '{ print $9 }' | tail -n 10) ; do 13.14 + filename=$(basename $file ".txt") 13.15 + timestamp=$(filedate $file) 13.16 + CONTENT="$CONTENT<a href=\"?page=$filename\">$filename</a> ($timestamp - <a href=\"./?page=$filename&action=diff\">diff</a>)<br />" 13.17 +CONTENT_RSS="$CONTENT_RSS<item> 13.18 +<title>$filename</title> 13.19 +<pubDate>$timestamp</pubDate> 13.20 +<link>$ADR_ACCUEIL?page=$(urlencode '$filename')</link> 13.21 +<description>$filename $timestamp</description> 13.22 +</item>" 13.23 + done 13.24 + sed -e "s#{WIKI_TITLE}#$WIKI_TITLE#" \ 13.25 + -e "s#{ADR_ACCUEIL}#$ADR_ACCUEIL#" \ 13.26 + -e "s#{LANG}#$LANG#" \ 13.27 + -e "s#{WIKI_DESCRIPTION}#Flux RSS de $WIKI_TITLE#" \ 13.28 + -e "s#{CONTENT_RSS}#$CONTENT_RSS#" > rss.xml <<EOT 13.29 +<rss version="0.91"> 13.30 +<channel> 13.31 +<title>{WIKI_TITLE}</title> 13.32 +<link>{ADR_ACCUEIL}</link> 13.33 +<description>{WIKI_DESCRIPTION}</description> 13.34 +<language>{LANG}</language> 13.35 +{CONTENT_RSS} 13.36 +</channel> 13.37 +</rss> 13.38 +EOT 13.39 +} 13.40 + 13.41 +template() 13.42 +{ 13.43 + html="$(sed 's#{RSS}#<link rel="alternate" type="application/rss+xml" title="RSS" href="rss.xml" />#' <<EOT 13.44 +$html 13.45 +EOT 13.46 +)" 13.47 + return 0 13.48 +}
14.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 14.2 +++ b/tazwikiss/rootfs/var/www/wiki/plugins/wkp_Tables.sh Thu Feb 24 07:41:33 2011 +0000 14.3 @@ -0,0 +1,57 @@ 14.4 +plugin="Tables" 14.5 +description_fr="Syntaxe de tables" 14.6 +description="Table syntax" 14.7 + 14.8 +formatBegin() 14.9 +{ 14.10 +CONTENT=$(sed -e 's/\[\([^]]*\)|\([^]]*\)|\([^]]*\)\]/[\1{WKP_TBL_BAR}\2{WKP_TBL_BAR}\3]/g' \ 14.11 + -e 's/\[\([^]]*\)|\([^]]*\)\]/[\1{WKP_TBL_BAR}\2]/g' -e 's,|,||,g' \ 14.12 + -e 's,^\( *|\)|,\1,' -e 's/|\( *\)$/\1/' <<EOT | awk ' 14.13 +{ 14.14 + if (/^ *\|.*\|$/) { 14.15 + if (in_array == 0) printf "<table class=\"wikitable\">" 14.16 + in_array = 1 14.17 + s = $0 14.18 + printf "<tr>" 14.19 + while (match(s,/\|[^\|]*\|/)) { 14.20 + q = substr(s,RSTART+1,RLENGTH-2) 14.21 + s = substr(s,RSTART+RLENGTH) 14.22 + c=""; lr=""; tb="" 14.23 + if (match(q,/^[hlrtb]+ /)) { 14.24 + for (i = 0; i < RLENGTH; i++) { 14.25 + if (q ~ /^h/) c=" class=\"em\"" 14.26 + if (q ~ /^l/) lr="text-align: left; " 14.27 + if (q ~ /^r/) lr="text-align: right; " 14.28 + if (q ~ /^t/) tb="vertical-align: top; " 14.29 + if (q ~ /^b/) tb="vertical-align: bottom; " 14.30 + q = substr(q,2) 14.31 + } 14.32 + } 14.33 + if (lr != "" || tb != "") c = c " style=\"" lr tb "\"" 14.34 + if (match(q,/^[0-9]+ */)) { 14.35 + n = RLENGTH 14.36 + match(q,/^[0-9]+/) 14.37 + c = c " colspan=\"" substr(q,1,RLENGTH) "\"" 14.38 + q = substr(q,n+1) 14.39 + } 14.40 + if (match(q,/^,[0-9]+ */)) { 14.41 + n = RLENGTH 14.42 + match(q,/^,[0-9]+/) 14.43 + c = c " rowspan=\"" substr(q,2,RLENGTH-1) "\"" 14.44 + q = substr(q,n+1) 14.45 + } 14.46 + printf " <td" c ">" q "</td>" 14.47 + } 14.48 + printf "</tr>" 14.49 + } 14.50 + else { 14.51 + if (in_array != 0) print "</table>" 14.52 + in_array = 0 14.53 + print 14.54 + } 14.55 +} END { if (in_array != 0) print "</table>" }' | \ 14.56 +sed -e 's/{WKP_TBL_BAR}/|/g' -e 's,||,|,g' 14.57 +$CONTENT 14.58 +EOT 14.59 +) 14.60 +}
15.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 15.2 +++ b/tazwikiss/rootfs/var/www/wiki/style.css Thu Feb 24 07:41:33 2011 +0000 15.3 @@ -0,0 +1,172 @@ 15.4 +/* Plugin wkp_Tables */ 15.5 +table.wikitable { 15.6 + border-collapse: collapse; 15.7 + border: 1px solid #ccc; 15.8 +} 15.9 + 15.10 +table.wikitable td { 15.11 + border: 1px solid #ccc; 15.12 + text-align: center; 15.13 + vertical-align: middle; 15.14 + padding: 2px; 15.15 +} 15.16 + 15.17 +table.wikitable td.em { 15.18 + background: #ccc; 15.19 + font-weight: bold; 15.20 +} 15.21 + 15.22 +/* Table Of Content */ 15.23 +#toc { 15.24 + border: 1px dashed #11141A; 15.25 + float:right; 15.26 + padding-right: 2em; 15.27 +} 15.28 +#toc h1 { 15.29 + font-size: 10px; 15.30 + padding-left: .5em; 15.31 +} 15.32 +#toc h2 { 15.33 + font-size: 9px; 15.34 + padding-left: 1.5em; 15.35 +} 15.36 +#toc h3 { 15.37 + font-size: 8px; 15.38 + padding-left: 2em; 15.39 +} 15.40 +#toc h4 { 15.41 + font-size: 7px; 15.42 + padding-left: 2.5em; 15.43 +} 15.44 +#toc h5 { 15.45 + font-size: 6px; 15.46 + padding-left: 3em; 15.47 +} 15.48 + 15.49 +img { 15.50 +border: 0px 15.51 +} 15.52 + 15.53 +body { 15.54 +background-color: #828A99; 15.55 +font-family: Trebuchet, "Trebuchet MS", sans-serif; 15.56 +font-size: 14px; 15.57 +line-height: 16px; 15.58 +} 15.59 + 15.60 +pre 15.61 +{ 15.62 +border: 1px dotted #ccc; 15.63 +padding: 4px; 15.64 +width: 640px; 15.65 +overflow: auto; 15.66 +} 15.67 + 15.68 +code 15.69 +{ 15.70 +font-family: "Courier New", monospace; 15.71 +font-size: 12px; 15.72 +} 15.73 + 15.74 +a { 15.75 +color: #333C4D; 15.76 +} 15.77 + 15.78 +a.pending { 15.79 +color: #7F4736; 15.80 +} 15.81 + 15.82 +a.url { 15.83 +color: #808080; 15.84 +} 15.85 + 15.86 +a:hover { 15.87 +color: #57A2D4; 15.88 +background: inherit; 15.89 +} 15.90 + 15.91 +.category { 15.92 + color: #999; 15.93 + background: inherit; 15.94 +} 15.95 + 15.96 +th 15.97 +{ 15.98 +padding-left: 1em; 15.99 +background: #333C4D; 15.100 +color: white; 15.101 +text-align: left; 15.102 +border-bottom: 1px dashed #11141A; 15.103 +} 15.104 + 15.105 +th h1 { 15.106 +font-family: "Futura Condensed", Futura, sans-serif !important; 15.107 +font-weight: bolder; 15.108 +padding-top: 10px; 15.109 +padding-bottom: 4px; 15.110 +margin-top: 0; 15.111 +margin-bottom: 0; 15.112 +} 15.113 + 15.114 +h1, h2, h3, h4, h5, h6 { 15.115 +font-family: "Futura Condensed", Futura, sans-serif !important; 15.116 +} 15.117 + 15.118 +th a { 15.119 +text-decoration: none; 15.120 +color: white !important; 15.121 +} 15.122 + 15.123 +th p { 15.124 +font-size: 80%; 15.125 +margin-top: 0; 15.126 +margin-bottom: 0; 15.127 +padding-left: 2em; 15.128 +} 15.129 + 15.130 +#mainTable { 15.131 +border: 1px solid #11141A; 15.132 +} 15.133 + 15.134 +.pageLinks { 15.135 +padding-left: 1em; 15.136 +padding-right: 1em; 15.137 +font-size: 80%; 15.138 +margin-top: 0; 15.139 +margin-bottom: 0; 15.140 +background-color: #eee; 15.141 +color: #666; 15.142 +} 15.143 +.pageLinks a { 15.144 +font-weight: bold; 15.145 +text-decoration: none; 15.146 +} 15.147 + 15.148 +#headerLinks td { 15.149 +border-bottom: 1px dashed #ccc !important; 15.150 +} 15.151 + 15.152 +#footerLinks td { 15.153 +border-top: 1px dashed #ccc !important; 15.154 +} 15.155 + 15.156 +#mainContent { 15.157 +font-size: 90%; 15.158 +padding: 1em; 15.159 +background-color: white; 15.160 +} 15.161 + 15.162 +#mainContent h2:first-child { 15.163 +margin-top: 0px; 15.164 +} 15.165 + 15.166 + 15.167 +.error { 15.168 +color: #F25A5A; 15.169 +font-size: 80%; 15.170 +font-weight: bold; 15.171 +} 15.172 + 15.173 +form { 15.174 +display: inline 15.175 +}
16.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 16.2 +++ b/tazwikiss/rootfs/var/www/wiki/template.html Thu Feb 24 07:41:33 2011 +0000 16.3 @@ -0,0 +1,49 @@ 16.4 +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 16.5 + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 16.6 +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{LANG}" lang="{LANG}"> 16.7 +<head> 16.8 + <meta http-equiv="content-type" content="text/html; charset=utf-8" /> 16.9 + <title>{WIKI_TITLE} - {PAGE_TITLE_BRUT}</title> 16.10 + <style type="text/css"> @import "style.css"; </style> 16.11 + {RSS} 16.12 +</head> 16.13 + 16.14 +<body> 16.15 +<table border="0" width="100%" cellpadding="4" id="mainTable" cellspacing="0" summary="{PAGE_TITLE_BRUT}"> 16.16 + <tr> 16.17 + <th colspan="3"> 16.18 + <h1>{PAGE_TITLE}</h1> 16.19 + <p>{LAST_CHANGE} {TIME}</p> 16.20 + </th> 16.21 + </tr> 16.22 + <tr id="headerLinks"> 16.23 + <td class="pageLinks" colspan="2"> 16.24 + {HOME} {/ RECENT_CHANGES} 16.25 + </td> 16.26 + <td class="pageLinks" align="right"> 16.27 + {EDIT} {(HELP)} {/ HISTORY} 16.28 + </td> 16.29 + </tr> 16.30 + <tr> 16.31 + <td id="mainContent" colspan="3"> 16.32 + {TOC} 16.33 + <div class="error">{ERROR}</div> 16.34 + {CONTENT} 16.35 + </td> 16.36 + </tr> 16.37 + <tr id="footerLinks"> 16.38 + <td class="pageLinks"> 16.39 + <div>{SEARCH}</div> 16.40 + </td> 16.41 + <td class="pageLinks"> 16.42 + <a href="http://wikiss.tuxfamily.org/">{WIKI_VERSION}</a> 16.43 + <br /> 16.44 + {DATE} -- {IP} {COOKIE} 16.45 + </td> 16.46 + <td class="pageLinks" align="right"> 16.47 + {EDIT} {(HELP)} {/ HISTORY} 16.48 + </td> 16.49 + </tr> 16.50 +</table> 16.51 +</body> 16.52 +</html> 16.53 \ No newline at end of file