====== Scripts, tips, tools about Dokuwiki ======
===== Clean-up History =====
Script to clean up all revision history
DOKUWIKI_DATADIR=/path/to/docuwiki/data
#
find $DOKUWIKI_DATADIR/meta/ -type f -name "*.changes" -delete
find $DOKUWIKI_DATADIR/attic/ -type f -name "*.txt.gz" -delete
find $DOKUWIKI_DATADIR/media_attic/ -type f -name "*.*" -delete
===== Clean-up all =====
Clean up all including cache
DOKUWIKI_DATADIR=/path/to/docuwiki/data
#
find $DOKUWIKI_DATADIR/attic/ -type f -delete
find $DOKUWIKI_DATADIR/cache/?/ -type f -delete
find $DOKUWIKI_DATADIR/index/ -type f -name "*.idx" -delete
find $DOKUWIKI_DATADIR/locks/ -type f -name "*.lock" -delete
find $DOKUWIKI_DATADIR/media_attic/ -type f -name "*.*" -delete
find $DOKUWIKI_DATADIR/media_meta/ -type f -name "*.*" -delete
find $DOKUWIKI_DATADIR/meta/ -type f -name "*.*" -delete
find $DOKUWIKI_DATADIR/tmp/ -type f -name "*.*" -delete
# Delete empty directories
find "${DOKUWIKI_DATADIR}"/{attic,cache,index,locks,media,media_attic,media_meta,meta,pages,tmp}/ -mindepth 1 -type d -empty -delete
Remember to reindex pages
===== Discussion Plugin for Dokuwiki =====
Follow this link:
http://www.dokuwiki.org/plugin:discussion
===== Integrating Docuwiki with other websites =====
This is an article on integrating docuwiki rendering
http://maestric.com/doc/php/integrate-dokuwiki-to-your-website
===== sed script to convert aptitude package list output to dokuwiki format =====
aptitude search '~i' > somefile.txt
cat somefile.txt|sed 's/^i/|i/' | sed 's/^|i A /|i|A|/' | sed 's/^|i /|i| |/' | sed 's/ - / |/' | sed 's/$/|/' > dokuformat.txt
===== sed command to convert HTML table to dokuwiki syntax =====
cat table.html | sed 's/class="[a-z,A-Z,0-9]*"//g' | sed 's/<[a-z,A-Z,/]*[ ]*>/|/g' | sed 's/||/|/g'
===== Replace Heading 5 with Bold =====
DOKUTXTFILE=virtualbox_vnetwork.txt
cp $DOKUTXTFILE /tmp
sed -i 's/^== - /\n**/' $DOKUTXTFILE
sed -i 's/ ==$/**\n/' $DOKUTXTFILE
diff $DOKUTXTFILE /tmp
===== Move one heading level down =====
Assumes the lowest level is currently at H4. After the change the lowest will be H5 and the highest will be H2.
DOKUTXTFILE=virtualbox_virt_intro.txt
cp $DOKUTXTFILE /tmp
sed -i 's/^===/==/' $DOKUTXTFILE
sed -i 's/===$/==/' $DOKUTXTFILE
diff $DOKUTXTFILE /tmp