WikiMarkupConversion
Question
How to convert other wiki markups for PmWiki. This cookbook does not interpret other markups, it is a framework to translate them to PmWiki markup instantly.
Answer
- download wikimarkupconversion.phpΔ and put it into your cookbook folder
- include
include("cookbook/wikimarkupconversion.php");
in yourconfig.php
- choose your wikilanguage in
config.php
with$WikiMarkupExtensions = array("wikitype1","wikitype2",...);
. At the moment there is only one wikitype MediaWiki - Write the alien wikimarkup in an edit field and hit preview or save for immediate conversion.
Notes and Comments
- I can remember that there was a feature plan in PmWiki devel for markups from other wikis. But i can't find anything through search and because i need some functionality i wrote this little script.
- You can try this script
[[http://schlaefer.macbay.de/index.php/Main/WikiMarkupSandbox|here]](dead link) - You can easely add another conversion. There are two arrays for each wikitype
- Simple -> for easy conversion via regex
- Functions -> for complex conversions which need a subfunction
SteveAgl April 10, 2005, at 08:52 AM : I tried to write a regex for another conversion for mediawiki but without succes. Maybe you can help me. I wanna connvert the follwing example:
;Title : a long sentence
into:
'''Title'''/n->a long sentence
Any help? Thanks in advance.
I changed it to the PmWiki syntax: :'''Title''':a long sentence
.
- SteveAgl April 11, 2005, at 10:57 AM Thanks, i addedd a couple of reg to html like tags section but not sure if it's a mediawiki standard
"#<strong>(.*?)</strong>#" => "$1",
"#<code>(.*?)</code>#" => "
$1
",
Anonymous Coward, September 29, 2005, at 10:22 AM : I've got a bunch of JSPWiki pages to convert, I might give this a try. If anyone has worked in that direction I would appreciate it posted here, even if unfinished
Anonymous Coward, September 29, 2005, at 10:23 AM : A cleaner option would be import from some common denominator, like a wiki interchange format. After all, the semantics are the same for basic markup
Known limitations/bugs
- no way to outcomment other markups with
[@
or[=
current wikitypes contain
MediaWiki
- Headings ==,=== ...
- [http:... name],[http:...]
- <small>, <tt>, <br>, <pre>, <!--, <nowiki>
- __TOC__, [Bild/Image:name], <--
- simple tables
{| format | text
to PmWiki/AdvancedTables(:table:)
- definition lists
; Definition list : list of definitions