# HG changeset patch # User Christopher Rogers # Date 1298533293 0 # Node ID add86f2168cda0d3a65c6c0cdf76bb2c4cd84b0f # Parent d9f1a561b634537b037f586fc5822c136a5958cc Add tazwikiss. diff -r d9f1a561b634 -r add86f2168cd tazwikiss/rootfs/usr/share/applications/tazwikiss.desktop --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tazwikiss/rootfs/usr/share/applications/tazwikiss.desktop Thu Feb 24 07:41:33 2011 +0000 @@ -0,0 +1,8 @@ +[Desktop Entry] +Encoding=UTF-8 +Name=Wiki +Icon=html.png +Exec=browser http://localhost/wiki/index.sh +Type=Application +Categories=Office; + diff -r d9f1a561b634 -r add86f2168cd tazwikiss/rootfs/var/www/wiki/config-de.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tazwikiss/rootfs/var/www/wiki/config-de.sh Thu Feb 24 07:41:33 2011 +0000 @@ -0,0 +1,24 @@ +PASSWORD="test" +PAGES_DIR="pages/" +BACKUP_DIR="historique/" + +LANG="de" +WIKI_TITLE="WiKiss" +#START_PAGE="Startseite" +START_PAGE="Welcome" +HOME_BUTTON="Startseite" +HELP_BUTTON="Hilfe" +DEFAULT_CONTENT="Die Seite %page% ist leer." +EDIT_BUTTON="Bearbeiten" +DONE_BUTTON="Speichern" +PROTECTED_BUTTON="Gesperrt Seite" +SEARCH_BUTTON="Suche" +SEARCH_RESULTS="Suchergebnsise" +LIST="Seitenliste" +RECENT_CHANGES="Kürzliche Änderungen" +LAST_CHANGES="Letzte Änderung" +HISTORY_BUTTON="Verlauf" +NO_HISTORY="Keinen Verlauf gefunden." +RESTORE="Restore" +MDP="Passwort" +ERROR="$MDP ist nicht korrekt." diff -r d9f1a561b634 -r add86f2168cd tazwikiss/rootfs/var/www/wiki/config-fr.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tazwikiss/rootfs/var/www/wiki/config-fr.sh Thu Feb 24 07:41:33 2011 +0000 @@ -0,0 +1,23 @@ +PASSWORD="test" +PAGES_DIR="pages/" +BACKUP_DIR="historique/" + +LANG="fr" +WIKI_TITLE="WiKiss : le Wiki Kiss" +START_PAGE="Accueil" +HOME_BUTTON="Accueil" +HELP_BUTTON="Aide" +DEFAULT_CONTENT="La page %page% est vide." +EDIT_BUTTON="Éditer" +DONE_BUTTON="Enregistrer" +PROTECTED_BUTTON="Page verrouillée" +SEARCH_BUTTON="Rechercher" +SEARCH_RESULTS="Résultats de recherche pour" +LIST="Liste des pages" +RECENT_CHANGES="Changements récents" +LAST_CHANGES="Dernière modification" +HISTORY_BUTTON="Historique" +NO_HISTORY="Aucun historique existant." +RESTORE="Restaurer" +MDP="Mot de passe" +ERROR="$MDP spécifié incorrect." diff -r d9f1a561b634 -r add86f2168cd tazwikiss/rootfs/var/www/wiki/config.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tazwikiss/rootfs/var/www/wiki/config.sh Thu Feb 24 07:41:33 2011 +0000 @@ -0,0 +1,23 @@ +PASSWORD="test" +PAGES_DIR="pages/" +BACKUP_DIR="historique/" + +LANG="en" +WIKI_TITLE="WiKiss : the Kiss Wiki" +START_PAGE="Welcome" +HOME_BUTTON="Home" +HELP_BUTTON="Help" +DEFAULT_CONTENT="The page %page% is empty." +EDIT_BUTTON="Edit" +DONE_BUTTON="Save" +PROTECTED_BUTTON="Page protected" +SEARCH_BUTTON="Search" +SEARCH_RESULTS="Search results for" +LIST="Pages list" +RECENT_CHANGES="Recent changes" +LAST_CHANGES="Last changes" +HISTORY_BUTTON="History" +NO_HISTORY="No history." +RESTORE="Restore" +MDP="Password" +ERROR="Wrong password." diff -r d9f1a561b634 -r add86f2168cd tazwikiss/rootfs/var/www/wiki/index.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tazwikiss/rootfs/var/www/wiki/index.sh Thu Feb 24 07:41:33 2011 +0000 @@ -0,0 +1,492 @@ +#!/bin/sh +# +# TazWikiss - A tiny Wiki for busybox/httpd +# Licence GNU/GPLv2 - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# Copyright (C) Pascal Bellard +# Based on WiKiss - http://wikiss.tuxfamily.org/ + +. /usr/bin/httpd_helper.sh + +cd $(dirname $0) +CONFIG=config-${HTTP_ACCEPT_LANGUAGE%%,*}.sh +[ -r "$CONFIG" ] || CONFIG=config.sh +. ./$CONFIG + +WIKI_VERSION="TazWiKiss 0.3" + +# Initialisations +toc='' # Table Of Content +CONTENT='' # contenu de la page +HISTORY='' # lien vers l'historique +plugins_dir="plugins/" # repertoire ou stocker les plugins +template="template.html" # Fichier template +PAGE_TITLE_link=true # y-a-t-il un lien sur le titre de la page ? +editable=true # la page est editable +urlbase="$SCRIPT_NAME" +#urlbase="./" + +die() +{ + echo $@ + exit +} + +redirect() +{ + awk '{ printf "%s\r\n",$0 }' < page + if authentified; then + sed 's/ $PAGE_txt <> "$complete_dir_s$(curdate).bak" <|' \ + -e 's|^-\(.*\)$|\1|' \ + -e 's|^+\(.*\)$|\1|' +} + +# Actions speciales du Wiki +case "$action" in +edit) + editable=false + HISTORY="$HISTORY_BUTTON
" + CONTENT="
+ +
+

" + if authentified; then + CONTENT="$CONTENT

" + ;; +history) + complete_dir="$BACKUP_DIR$PAGE_TITLE/" + if [ -n "$gtime" ]; then + HISTORY="$HISTORY_BUTTON" + if [ -r "$complete_dir$gtime" ]; then + HISTORY="$HISTORY $RESTORE" + CONTENT="$(cat $complete_dir$gtime | sed -e s/$(echo -ne '\r')//g -e 's|$|
|g')" + else + HISTORY="$HISTORY -" + fi + else + HISTORY="$HISTORY_BUTTON" + CONTENT="$NO_HISTORY" + if [ -d $complete_dir ]; then + CONTENT="
\n" + for file in $(ls $complete_dir | sort -r); do + CONTENT="$CONTENT + +$file
+" + done + CONTENT="$CONTENT
" + fi + fi ;; +diff) + if [ -n "$(GET f1)" ]; then + HISTORY="$HISTORY_BUTTON" + CONTENT="$(htmldiff "$(GET f1)" "$(GET f2)" )" + else + # diff auto entre les 2 dernières versions + ls "$BACKUP_DIR$PAGE_TITLE/" | ( sort -r ; echo none ; echo ) | head -n 2 | while read f1 f2; do + redirect "$urlbase?page=$(urlencode "$PAGE_TITLE")&action=$action&f1=$f1&f2=$f2" + done + fi ;; +search) + PAGE_TITLE_link=false + editable=false + query="$(GET query)" + n=0 + for file in $(ls $PAGES_DIR/*.txt 2> /dev/null | sort) ; do + [ -e $file ] || continue + echo $file | grep -qs "$query" $file /dev/stdin || continue + file=$(basename $file ".txt") + CONTENT="$CONTENT$file
+" + n=$(($n + 1)) + done + PAGE_TITLE="$PAGE_TITLE ($n)" ;; +recent) + PAGE_TITLE_link=false + editable=false + n=0 + for file in $(ls -l $PAGES_DIR/*.txt 2> /dev/null | awk '{ print $9 }' | tail -n 10) ; do + filename=$(basename $file ".txt") + timestamp=$(filedate $file) + CONTENT="$CONTENT$filename ($timestamp - diff)
+" + done ;; +'') ;; +*) + plugin_call_method "action" $action || action="" ;; +esac +if [ -z "$action" ]; then + if echo "$CONTENT" | grep -q '%html%\s'; then + CONTENT="$(sed 's/%html%\s//' <{{CODE%s}}",substr(s,1,RSTART-1),n + s=substr(s,RSTART+RLENGTH) + state=1 + } + else { + print s + break + } + } + if (state == 1) { + if (match(s,/\}\}/)) { + printf "%s",substr(s,1,RSTART-1) >> tmpdir "/CODE" n + s=substr(s,RSTART+RLENGTH) + n++ + state=0 + } + else { + print s >> tmpdir "/CODE" n + break + } + } +} +}' +$CONTENT +EOT +)" + plugin_call_method formatBegin + CONTENT="$(sed -e 's/<-->/\↔/g' -e 's/<==>/\⇔/g'\ + -e 's/-->/\→/g' -e 's/<--/\←/g' \ + -e 's/==>/\⇒/g' -e 's/<==/\⇐/g' \ + -e 's/([eE])/\€/g' -e 's/([pP])/\£/g' \ + -e 's/([yY])/\¥/g' -e 's/([tT][mM])/\™/g' \ + -e 's/([cC])/\©/g' -e 's/([rR])/\®/g' \ + -e 's/(<=)/\≤/g' -e 's/(>=)/\≥/g' \ + -e 's/(!=)/\≠/g' -e 's/(+-)/\±/g' <#g" \ + -e "s#\[\($rg_img_local\)|*\([a-z]*\)*\]#\"\1\"#g" \ + -e "s#\[\($rg_img_http\)|\($rg_link_http\)|*\([a-z]*\)*\]#\"\1\"#g" \ + -e "s#\[\($rg_img_http\)|\($rg_link_local\)|*\([a-z]*\)*\]#\"\1\"#g" \ + -e "s#\[\($rg_img_local\)|\($rg_link_http\)|*\([a-z]*\)*\]#\"\1\"#g" \ + -e "s#\[\($rg_img_local\)|\($rg_link_local\)|*\([a-z]*\)*\]#\"\1\"#g" \ + -e "s#\[\([^]]*\)|\($rg_link_http\)\]#\1#g" \ + -e "s#\[\([^]]*\)|\($rg_link_local\)\]#\1#g" \ + -e "s#\[\($rg_link_http\)\]#\1#g" \ + -e "s#\([^>\"]\)\($rg_link_http\)#\1\2#g" \ + -e "s#\[?\([^]]*\)\]#\1#g" \ + -e "s#\[\([^]]*\)\]#\1#g" \ + -e 's#\([0-9a-zA-Z\./~\-\_][0-9a-zA-Z\./~\-\_]*@[0-9a-zA-Z\./~\-\_][0-9a-zA-Z\./~\-\_]*\)#\1#g' \ + -e 's#^\*\*\*\(.*\)#
      • \1
#g' \ + -e 's#^\*\*\(.*\)#
    • \1
#g' \ + -e 's#^\*\(.*\)#
  • \1
#g' \ + -e 's,^\#\#\#\(.*\),
      1. \1
,g' \ + -e 's,^\#\#\(.*\),
    1. \1
,g' \ + -e 's,^\#\(.*\),
  1. \1
,g' \ + -e "s/$(printf '\r')//" <$/{N;s/\n//;$P;$D;bx;}' | sed \ + -e ':x;/<\/ul>$/{N;s/\n//;$P;$D;bx;}' | sed \ + -e ':x;s/<\/ul>
    //g;tx' -e ':x;s/<\/ol>
      //g;tx' \ + -e 's|----*$|
      |' -e 's|$|
      |' \ + -e 's##&\n#g' -e 's#\(\)
      #\1#g' \ + -e "s#'--\([^']*\)--'#\1#g" \ + -e "s#'__\([^']*\)__'#\1#g" \ + -e "s#'''''\([^']*\)'''''#\1#g" \ + -e "s#'''\([^']*\)'''#\1#g" \ + -e "s#''\([^']*\)''#\1#g" +$CONTENT +EOT +)" + while read link; do + [ -s $PAGES_DIR$link.txt ] && continue + CONTENT="$(sed "s/\\?page=$link\"/& class=\"pending\"/" <$line +EOT +)" + CONTENT="$(sed "s#^!!* *$line\$#$line#" <$RECENT_CHANGES" +[ "$action" == "recent" ] && RECENT=$RECENT_CHANGES +HOME="$HOME_BUTTON" +[ "$PAGE_TITLE" == "$START_PAGE" -a "$action" != "search" ] && HOME=$HOME_BUTTON +HELP="\1$HELP_BUTTON\2" +[ "$action" != "edit" ] && HELP="" + +[ -r "$template" ] || die "'$template' is missing!" +html="$(sed -e "s#{\([^}]*\)RECENT_CHANGES\([^}]*\)}#\1$RECENT\2#" \ + -e "s#{\([^}]*\)HOME\([^}]*\)}#\1$HOME\2#" \ + -e "s#{\([^}]*\)HELP\([^}]*\)}#$HELP#" \ + -e "s#{SEARCH}#
      #" \ + < $template )" +[ "$action" != "" -a "$action" != "edit" -o ! -e "$PAGE_txt" ] && TIME="-" +plugin_call_method template +[ -n "$(GET error)" ] || ERROR="" +[ -n "$HISTORY" ] && HISTORY="\1$HISTORY\2" +PAGE_TITLE_str="$(htmlentities "$PAGE_TITLE")" +$PAGE_TITLE_link && +PAGE_TITLE_str="$PAGE_TITLE_str" +EDIT="$EDIT_BUTTON" +if $editable ; then + EDIT="$PROTECTED_BUTTON" + [ -w "$PAGE_txt" -o ! -e "$PAGE_txt" ] && + EDIT="$EDIT_BUTTON" +fi +[ -n "$toc" ] && toc="\1$toc\2" +AUTH_GET="" +AUTH_POST="" +if authentified; then + AUTH_GET="auth=$AUTH\&" + AUTH_POST="\n" +fi + +header "Content-type: text/html" +sed -e "s#{ERROR}#$ERROR#" -e "s#{WIKI_TITLE}#$WIKI_TITLE#" \ + -e "s#{\([^}]*\)HISTORY\([^}]*\)}#$HISTORY#" \ + -e "s#{PAGE_TITLE}#$PAGE_TITLE_str#" \ + -e "s#{\([^}]*\)EDIT\([^}]*\)}#\1$EDIT\2#" \ + -e "s|{\([^}]*\)TOC\([^}]*\)}|$(awk '{ printf "%s\\n" $0 }' <#&$AUTH_POST#g" \ + -e "s#{WIKI_VERSION}#$WIKI_VERSION#" \ + -e "s#{TIME}#$TIME#" -e "s#{DATE}#$datew#" \ + -e "s#{IP}#$REMOTE_ADDR#" -e "s#{COOKIE}##" < '''Gras''' +^''italique^'' --> ''italique'' +^''^''^'Gras et italique^''^''^' --> '''''Gras et italique''''' +---- +La rayure de mot utilise l'apostrophe avec deux tirets +^'--Rayé--' --> '--Rayé--' +de même pour souligner, l'apostrophe suivit de deux blancs soulignés (underscore) +^'__Souligné__' --> '__Souligné__' +---- +Les listes ordonnées utilisent le dièse '''#''' +# Premier +# Deuxième +# Troisième +---- +Les listes non ordonnées utilisent l'étoile '''*''' +* Pomme +* Poire +* Pêche +---- +Le code, et tous les textes où le formatage est important, utilisent deux accolades +^{{import sys +if len(sys.argv) == 2: + print "Hello",sys.argv^[1]}} +donne : +{{import sys +if len(sys.argv) == 2: + print "Hello",sys.argv[1]}} +---- +Certains caractères spéciaux sont reconnus : +* Flèches : <^-- : <--, ^--> : -->, <^--> : <--> +* Copyrights : ^(c) ou ^(C) : (c), ^(r) ou ^(R) : (r) +---- +Les liens externes et les adresses eMail sont reconnus automagiquement ... +^http://wikiss.tuxfamily.org/ --> http://wikiss.tuxfamily.org/ +wikiss^@example.org --> wikiss@example.org + +ou au travers d'un texte entre crochets : +'''^['''Visitez le site de WiKiss'''|'''^http://wikiss.tuxfamily.org/''']''' --> [Visitez le site de WiKiss|http://wikiss.tuxfamily.org/] + +avec un ? on fait un lien vers Wikipedia dans la langue courante : +'''^[?'''Wiki''']''' --> [?Wiki] +---- +Les images sont incluses automagiquement en insérant l'URL de l'image que vous voulez voir entre crochets +'''^['''^http://wikiss.tuxfamily.org/img/logo_100.png''']''' --> +[http://wikiss.tuxfamily.org/img/logo_100.png] + +Vous pouvez aussi utiliser une image comme un lien : '''^['''^http://wikiss.tuxfamily.org/img/logo_100.png'''|'''^http://wikiss.tuxfamily.org/''']''' --> +[http://wikiss.tuxfamily.org/img/logo_100.png|http://wikiss.tuxfamily.org/] + +Mais aussi positionner l'image de manière flottante à gauche ou à droite : +[http://wikiss.tuxfamily.org/img/logo_100.png|left] [http://wikiss.tuxfamily.org/img/logo_100.png|http://wikiss.tuxfamily.org|right] +<-- '''^['''^http://wikiss.tuxfamily.org/img/logo_100.png'''|left]''' +'''^['''^http://wikiss.tuxfamily.org/img/logo_100.png'''|'''^http://wikiss.tuxfamily.org'''|right]''' --> + +---- +Les liens vers les wiki-pages utilisent les crochets : +'''^['''Acceuil''']''' --> [Accueil] + +Si une page n'existe pas, elle sera créée au premier clic sur son lien. +Cliquez sur "BacASable" ci-dessous et vous pourrez tout simplement écrire cette nouvelle page ... +[BacASable] +---- +... et pour insérer des lignes, utilisez quatre tirets : '''---- ''' +---- +Enfin, pour neutraliser la syntaxe de WiKiss, utilisez l'accent circonflexe ^^ +Ainsi, saisir '''^^^['''WiKiss''']''' permet d'afficher ^[WiKiss] plutôt que [WiKiss] +---- +Essayez ! Vous verrez, c'est très simple (^_^) \ No newline at end of file diff -r d9f1a561b634 -r add86f2168cd tazwikiss/rootfs/var/www/wiki/pages/AideTables.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tazwikiss/rootfs/var/www/wiki/pages/AideTables.txt Thu Feb 24 07:41:33 2011 +0000 @@ -0,0 +1,63 @@ +! Aide à la syntaxe des tables + +!! Création de table +Les tables sont définies à l'aide du caractère | +basiquement, il suffit de dessiner le tableau : +{{|case 1|case 2| +|case 3|case 4| +}} +donnera : +|case 1|case 2| +|case 3|case 4| + +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 : +* des lettres suivies d'un espace pour définir l'alignement : +** h : la cellule fait partie d'un titre +** t : alignement vertical en haut +** b : alignement vertical en bas +** l : alignement horizontal à gauche +** r : alignement horizontal à droite +* deux chiffres peuvent être ajoutés pour connecter les cellules : +** le premier indique combien de colonnes doivent être connectées +** le second placé après une virgule connecte les lignes + +{{ +|hl Titre gauche|hr Titre droite| +|r droite |l gauche | +|2 Deux colonnes | +|t ,2 Deux lignes| A | + | B | +|,2 Deux lignes | C | + | D |}} + +|hl Titre gauche|hr Titre droite| +|r droite |l gauche | +|2 Deux colonnes | +|t ,2 Deux lignes| A | + | B | +|,2 Deux lignes | C | + | D | + +!! Inclusion dans une table +|h 3 Syntaxe supportée| +|ht ,7 Mise en forme | ^''italique^'' | ''italique'' | + | '^''gras'^'' | '''gras''' | + |'^'^'^''gras italique'^'^'^''|'''''gras italique'''''| + |^'--rayé--'|'--rayé--'| + |^'__souligné__'|'__souligné__'| + | Caractères spéciaux | (c) (r) --> <-- | + |^{{code}}|{{code}}| +|ht ,3 Liens |^[Liens] | [Liens] | + |^[Liens 2^|?page=Liens]| [Liens 2|?page=Liens] | + |^[?Wikipedia]| [?Wikipedia] | +|ht ,4 Images |^[^http://wikiss.tuxfamily.org/img/logo_100.png]|[http://wikiss.tuxfamily.org/img/logo_100.png]| + |^[/logo_100.png^|^http://wikiss.tuxfamily.org/]|[http://wikiss.tuxfamily.org/img/logo_100.png|http://wikiss.tuxfamily.org/]| + |^[^http://wikiss.tuxfamily.org/img/logo_100.png^|right] | [http://wikiss.tuxfamily.org/img/logo_100.png|right]| + |^[/logo_100.png^|^http://wikiss.tuxfamily.org/^|left] | [http://wikiss.tuxfamily.org/img/logo_100.png|http://wikiss.tuxfamily.org/|left]| + + +|h 2 Syntaxe non supportée| +|Titres | !! Titre| +|,2 Listes | * non ordonnée | + | # ordonnée | +|Lignes |----| \ No newline at end of file diff -r d9f1a561b634 -r add86f2168cd tazwikiss/rootfs/var/www/wiki/pages/Help.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tazwikiss/rootfs/var/www/wiki/pages/Help.txt Thu Feb 24 07:41:33 2011 +0000 @@ -0,0 +1,127 @@ +TOC +!Help + +Here is a summary of all the formatting rules in ''WiKiss''. +Click "Edit" on top or bottom of this page to see how it works. +(if you see "Page Locked", do a chmod 775 on this file via a ftp client) + +See also [AideTables] to create tables. + +---- + +Tiles use the exclamation mark '''!'''%% +^! Big%% +^!! Less big%% +^!!! Smaller%% +gives you : +! Big +!! Less big +!!! Smaller + +To automatically add a table of contents in a page, add the '''TOC''' mark in it : +* at the last line to be clearer, there is no influence on position ; +* at the first line if you need to write TOC in your page. Only the first occurrence will be replaced. + +---- + +Styles use the single quote ' +* ^''^'Bold^''^' --> '''Bold''' +* ^''italic^'' --> ''italic'' +* ^''^''^'Bold and italic^''^''^' --> '''''Bold and italic''''' + +---- + +Stroke of a work use quote and two dashes%% +^'--Stroked--' --> '--Stroked--' + +the same applies for underline, quote followed by by two underscore%% +^'__Underlined__' --> '__Underlined__' + +---- + +The ordered lists use sharp '''#''' +# First +# Second +# Third + +---- + +Non ordered lists use the star '''*''' +* Apple +* Pear +* Peach + +---- + +The code, and all of those things where formatting is important, use the braces %% +^{{import sys%% +if len(sys.argv) == 2:%% + print "Hello",sys.argv^[1]}}%% +give : +{{import sys +if len(sys.argv) == 2: + print "Hello",sys.argv[1]}} + +---- + +The separation between paragraphs of text is done through an empty line. +To force a line break in the middle of a paragraph, use: ^%% + +---- + +Some special characters are recognized: +* Arrows : <^-- : <--, ^--> : -->, <^--> : <--> +* Copyrights : ^(c) or ^(C) : (c), ^(r) or ^(R) : (r) + +---- + +Links to wiki-pages use square brackets : +'''^['''Accueil''']''' --> [Accueil] + +If a page does not exists, it will be created on first click. +Click on "SandBox" below and you will be able to create it ...%% +[SandBox] + +To link a wiki-page with a different text use : +'''^['''Beginning'''|?page='''Accueil''']''' --> [Beginning|?page=Accueil] + +The external links and addresses eMail are automagically recognized ... +* ^http://wikiss.tuxfamily.org/ --> http://wikiss.tuxfamily.org/ +* wikiss^@example.org --> wikiss@example.org + +or through a text between square brackets : +* '''^['''Visit WiKiss web site'''|'''^http://wikiss.tuxfamily.org/''']''' --> [Visit WiKiss web site|http://wikiss.tuxfamily.org/] + +with a ? you get a Wikipedia link in the current language : +* '''^[?'''Wiki''']''' --> [?Wiki] + +---- + +Images are automagically inserted with the picture URL between square brackets%% +'''^['''^http://wikiss.tuxfamily.org/img/logo_100.png''']''' --> +[http://wikiss.tuxfamily.org/img/logo_100.png] + +You can also use an image as a link : %% +'''^['''^http://wikiss.tuxfamily.org/img/logo_100.png'''|'''^http://wikiss.tuxfamily.org/''']''' --> +[http://wikiss.tuxfamily.org/img/logo_100.png|http://wikiss.tuxfamily.org/] + +But also position the image on a floating left or right: +[http://wikiss.tuxfamily.org/img/logo_100.png|left] [http://wikiss.tuxfamily.org/img/logo_100.png|http://wikiss.tuxfamily.org|right] +%% + +<-- '''^['''^http://wikiss.tuxfamily.org/img/logo_100.png'''|left]'''%% +'''^['''^http://wikiss.tuxfamily.org/img/logo_100.png'''|'''^http://wikiss.tuxfamily.org'''|right]''' --> +%% + +---- + +... to insert lines, simply use four dashes : '''---- ''' + +---- + +Finally, in order to neutralize the syntax WiKiss, use the caret ^ %% +Thus, enter '''^^^['''WiKiss''']''' can display ^[WiKiss] rather than [WiKiss] + +---- + +Try it, you'll see, it's very simple. diff -r d9f1a561b634 -r add86f2168cd tazwikiss/rootfs/var/www/wiki/pages/HelpTables.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tazwikiss/rootfs/var/www/wiki/pages/HelpTables.txt Thu Feb 24 07:41:33 2011 +0000 @@ -0,0 +1,70 @@ +! Help on the table syntax + +!! Table creation +Tables are defined with the pipe character | + +Basically you just need to draw the table : + +{{|cell 1|cell 2| +|cell 3|cell 4| +}} + +will be displayed as : +|cell 1|cell 2| +|cell 3|cell 4| + +You can also format your cell. For that, add some characters at the beginning : + +* a '''h''' if the cell is a header +* more letters followed by a space to defined alignment : +** t : vertically aligned on top +** b : vertically aligned on bottom +** l : horizontally aligned on left +** r : horizontally aligned on right +* two numbers can be added to connect cells +** first one to give how many columns has to be connected +** second one, after a comma connects lines + +{{ +|hl Title on left|hr Title on right| +|r right |l left | +|2 Two columns | +|t ,2 Two lines | A | + | B | +|,2 two lines | C | + | D |}} + +|hl Title on left|hr title on right| +|r right |l left | +|2 Two columns | +|t ,2 Two lines | A | + | B | +|,2 two lines | C | + | D | + +!! Other syntax included in a table + +|h 3 Supported wiki syntax | +|ht ,7 Formatting | ^''italic^'' | ''italic'' | + | '^''bold'^'' | '''bold''' | + |'^'^'^''bold italic'^'^'^''|'''''bold italic'''''| + |^'--stroked--'|'--stroked--'| + |^'__underlined__'|'__underlined__'| + | Special chars | (c) (r) --> <-- | + |^{{code}}|{{code}}| +|ht ,3 Links |^[WikiLink] | [WikiLink] | + |^[Link 2^|?page=Link]| [Link 2|?page=Link] | + |^[?Wikipedia]| [?Wikipedia] | +|ht ,4 Images |^[^http://wikiss.tuxfamily.org/img/logo_100.png]|[http://wikiss.tuxfamily.org/img/logo_100.png]| + |^[/logo_100.png^|^http://wikiss.tuxfamily.org/]|[http://wikiss.tuxfamily.org/img/logo_100.png|http://wikiss.tuxfamily.org/]| + |^[^http://wikiss.tuxfamily.org/img/logo_100.png^|right] | [http://wikiss.tuxfamily.org/img/logo_100.png|right]| + |^[/logo_100.png^|^http://wikiss.tuxfamily.org/^|left] | [http://wikiss.tuxfamily.org/img/logo_100.png|http://wikiss.tuxfamily.org/|left]| + +and + +|h 2 Not supported syntax| +|Titles | !! Titles| +|,2 Lists | * non ordered | + | # ordered | +|Lines |----| + diff -r d9f1a561b634 -r add86f2168cd tazwikiss/rootfs/var/www/wiki/pages/Welcome.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tazwikiss/rootfs/var/www/wiki/pages/Welcome.txt Thu Feb 24 07:41:33 2011 +0000 @@ -0,0 +1,14 @@ +TOC +!Welcome ... +!!... to your wiki + +Thanks for choosing TazWiKiss, the SliTaz port of [WiKiss|http://wikiss.tuxfamily.org/] and its [plugins|?action=list]. +Feel free to browse the default installation, until you feel comfortable. + +!!Help + +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. + +Go see the [Help] and [HelpTables] for an overview of all the possibilities. You can always return to this page by clicking on "'''Home'''" + +'''Have fun !''' diff -r d9f1a561b634 -r add86f2168cd tazwikiss/rootfs/var/www/wiki/plugins/wkp_ListPlugins.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tazwikiss/rootfs/var/www/wiki/plugins/wkp_ListPlugins.sh Thu Feb 24 07:41:33 2011 +0000 @@ -0,0 +1,51 @@ +plugin="ListPlugins" +description_fr="Affiche la liste des plugins chargés" +description="List plugins" + +action() +{ + [ "$1" == "list" -o "$1" == "config" ] || return 1 + CONTENT=' + + +' + PAGE_TITLE_link=false + editable=false + lang="${HTTP_ACCEPT_LANGUAGE%%,*}" + PAGE_TITLE="Configuration" + for i in $plugins_dir/*.sh ; do + plugin= + eval $(grep ^plugin= $i) + [ -n "$plugin" ] || continue + eval $(grep ^description= $i) + alt="$(grep ^description_$lang= $i)" + [ -n "$alt" ] && eval $(echo "$alt" | sed 's/_..=/=/') + CONTENT="$CONTENT +" + done + CONTENT="$CONTENT + +" + for i in config-*.sh ; do + i=${i#config-} + i=${i%.sh} + [ -n "$i" ] || continue + CONTENT="$CONTENT + +" + done + CONTENT="$CONTENT + + +$(du -hs */ | awk '{ printf "\n",$1,$2 }') +

      Plugins

      + +$plugin$description

      Locales

      + +$i

      Data

      + + + +
      %s%s
      +" +} diff -r d9f1a561b634 -r add86f2168cd tazwikiss/rootfs/var/www/wiki/plugins/wkp_Rss.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tazwikiss/rootfs/var/www/wiki/plugins/wkp_Rss.sh Thu Feb 24 07:41:33 2011 +0000 @@ -0,0 +1,45 @@ +plugin="Rss" +description_fr="Génération d'un flux Rss des derniers changements" +description="Generate a Rss streams with last changes" + +writedPage() +{ + # Attention, bug si https ou port différent de 80 ? + ADR_ACCUEIL="http://$SERVER_NAME$SCRIPT_NAME" + CONTENT_RSS="" + for file in $(ls -l $PWD/$PAGES_DIR/*.txt 2> /dev/null | awk '{ print $9 }' | tail -n 10) ; do + filename=$(basename $file ".txt") + timestamp=$(filedate $file) + CONTENT="$CONTENT$filename ($timestamp - diff)
      " +CONTENT_RSS="$CONTENT_RSS +$filename +$timestamp +$ADR_ACCUEIL?page=$(urlencode '$filename') +$filename $timestamp +" + done + sed -e "s#{WIKI_TITLE}#$WIKI_TITLE#" \ + -e "s#{ADR_ACCUEIL}#$ADR_ACCUEIL#" \ + -e "s#{LANG}#$LANG#" \ + -e "s#{WIKI_DESCRIPTION}#Flux RSS de $WIKI_TITLE#" \ + -e "s#{CONTENT_RSS}#$CONTENT_RSS#" > rss.xml < + +{WIKI_TITLE} +{ADR_ACCUEIL} +{WIKI_DESCRIPTION} +{LANG} +{CONTENT_RSS} + + +EOT +} + +template() +{ + html="$(sed 's#{RSS}##' <" + in_array = 1 + s = $0 + printf "" + while (match(s,/\|[^\|]*\|/)) { + q = substr(s,RSTART+1,RLENGTH-2) + s = substr(s,RSTART+RLENGTH) + c=""; lr=""; tb="" + if (match(q,/^[hlrtb]+ /)) { + for (i = 0; i < RLENGTH; i++) { + if (q ~ /^h/) c=" class=\"em\"" + if (q ~ /^l/) lr="text-align: left; " + if (q ~ /^r/) lr="text-align: right; " + if (q ~ /^t/) tb="vertical-align: top; " + if (q ~ /^b/) tb="vertical-align: bottom; " + q = substr(q,2) + } + } + if (lr != "" || tb != "") c = c " style=\"" lr tb "\"" + if (match(q,/^[0-9]+ */)) { + n = RLENGTH + match(q,/^[0-9]+/) + c = c " colspan=\"" substr(q,1,RLENGTH) "\"" + q = substr(q,n+1) + } + if (match(q,/^,[0-9]+ */)) { + n = RLENGTH + match(q,/^,[0-9]+/) + c = c " rowspan=\"" substr(q,2,RLENGTH-1) "\"" + q = substr(q,n+1) + } + printf " " q "" + } + printf "" + } + else { + if (in_array != 0) print "" + in_array = 0 + print + } +} END { if (in_array != 0) print "" }' | \ +sed -e 's/{WKP_TBL_BAR}/|/g' -e 's,||,|,g' +$CONTENT +EOT +) +} diff -r d9f1a561b634 -r add86f2168cd tazwikiss/rootfs/var/www/wiki/style.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tazwikiss/rootfs/var/www/wiki/style.css Thu Feb 24 07:41:33 2011 +0000 @@ -0,0 +1,172 @@ +/* Plugin wkp_Tables */ +table.wikitable { + border-collapse: collapse; + border: 1px solid #ccc; +} + +table.wikitable td { + border: 1px solid #ccc; + text-align: center; + vertical-align: middle; + padding: 2px; +} + +table.wikitable td.em { + background: #ccc; + font-weight: bold; +} + +/* Table Of Content */ +#toc { + border: 1px dashed #11141A; + float:right; + padding-right: 2em; +} +#toc h1 { + font-size: 10px; + padding-left: .5em; +} +#toc h2 { + font-size: 9px; + padding-left: 1.5em; +} +#toc h3 { + font-size: 8px; + padding-left: 2em; +} +#toc h4 { + font-size: 7px; + padding-left: 2.5em; +} +#toc h5 { + font-size: 6px; + padding-left: 3em; +} + +img { +border: 0px +} + +body { +background-color: #828A99; +font-family: Trebuchet, "Trebuchet MS", sans-serif; +font-size: 14px; +line-height: 16px; +} + +pre +{ +border: 1px dotted #ccc; +padding: 4px; +width: 640px; +overflow: auto; +} + +code +{ +font-family: "Courier New", monospace; +font-size: 12px; +} + +a { +color: #333C4D; +} + +a.pending { +color: #7F4736; +} + +a.url { +color: #808080; +} + +a:hover { +color: #57A2D4; +background: inherit; +} + +.category { + color: #999; + background: inherit; +} + +th +{ +padding-left: 1em; +background: #333C4D; +color: white; +text-align: left; +border-bottom: 1px dashed #11141A; +} + +th h1 { +font-family: "Futura Condensed", Futura, sans-serif !important; +font-weight: bolder; +padding-top: 10px; +padding-bottom: 4px; +margin-top: 0; +margin-bottom: 0; +} + +h1, h2, h3, h4, h5, h6 { +font-family: "Futura Condensed", Futura, sans-serif !important; +} + +th a { +text-decoration: none; +color: white !important; +} + +th p { +font-size: 80%; +margin-top: 0; +margin-bottom: 0; +padding-left: 2em; +} + +#mainTable { +border: 1px solid #11141A; +} + +.pageLinks { +padding-left: 1em; +padding-right: 1em; +font-size: 80%; +margin-top: 0; +margin-bottom: 0; +background-color: #eee; +color: #666; +} +.pageLinks a { +font-weight: bold; +text-decoration: none; +} + +#headerLinks td { +border-bottom: 1px dashed #ccc !important; +} + +#footerLinks td { +border-top: 1px dashed #ccc !important; +} + +#mainContent { +font-size: 90%; +padding: 1em; +background-color: white; +} + +#mainContent h2:first-child { +margin-top: 0px; +} + + +.error { +color: #F25A5A; +font-size: 80%; +font-weight: bold; +} + +form { +display: inline +} diff -r d9f1a561b634 -r add86f2168cd tazwikiss/rootfs/var/www/wiki/template.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tazwikiss/rootfs/var/www/wiki/template.html Thu Feb 24 07:41:33 2011 +0000 @@ -0,0 +1,49 @@ + + + + + {WIKI_TITLE} - {PAGE_TITLE_BRUT} + + {RSS} + + + + + + + + + + + + + + + + + + + +
      +

      {PAGE_TITLE}

      +

      {LAST_CHANGE} {TIME}

      +
      + {TOC} +
      {ERROR}
      + {CONTENT} +
      + + \ No newline at end of file