Translations of this page?:
Learn about DokuWiki
Advanced Use
Corporate Use
Our Community
Follow us on Facebook, Twitter and other social networks.
Learn about DokuWiki
Advanced Use
Corporate Use
Our Community
Follow us on Facebook, Twitter and other social networks.
This code only converts the following:
Usage: cat dokuwikisyntaxpage.txt | ./dokuwiki2twiki-converter.pl > twikisyntaxpage.txt
#!/usr/bin/perl # my $incode = 0; my $buffer = ''; while (<>) { s/''/\=/g; # Adding DokuWiki syntax to the headings s/======\s*(.*)\s*======/---+ $1/g; s/=====\s*(.*)\s*=====/---++ $1/g; s/====\s*(.*)\s*====/---+++ $1/g; s/===\s*(.*)\s*===/---++++ $1/g; s/==\s*(.*)\s*==/---+++++ $1/g; if (s/^\<code/<verbatim/g) { $incode = 1;} if (s/code\>/verbatim\>/g) {$incode = 0;} unless ($incode) { if ($buffer) { unless (/^ *[a-zA-Z0-9]+/) { $buffer .= "</verbatim>"; print $buffer; $buffer = ''; } else { print $buffer; if (s/^ *([a-zA-Z0-9]+)/$1/g) { $buffer = $_; next; } } } if (/^ *[a-zA-Z0-9]+/) { s/^ *([a-zA-Z0-9]+)(.*)/\<verbatim\>$1$2/g; $buffer = $_; next; } } s/^ \*/ \*/g; s/^ \-/ 1\./g; s/^ \*/ \*/g; s/^ \-/ 1\./g; s/^ \*/ \*/g; s/^ \-/ 1\./g; # print; } print "\n";