Wiki2HTML Conversion Process?

84 views
Skip to first unread message

leeand00

unread,
Jul 31, 2008, 7:49:28 AM7/31/08
to TiddlyWikiDev
So how is it that the text inside the tiddler gets converted from
Tiddlywiki markup to HTML?

(and back again?)

I'm rather certain that it has something to do with config.formatters,
and the wikifi method, but I don't really seem to be able to ascertain
how it works exactly. I've also noticed that some of the code appears
to be using a lookahead regular expression, which isn't formally
supported by JavaScript....

Could someone please give me an overview of how this works?

Thank you,
Andrew J. Leer

FND

unread,
Jul 31, 2008, 9:21:37 AM7/31/08
to Tiddly...@googlegroups.com
> So how is it that the text inside the tiddler gets converted from
> Tiddlywiki markup to HTML?

Did the links I pointed to in the original thread* help at all?

The wikifier basically does a bunch of RegEx magic to convert wiki
markup to HTML.
A detailed walkthrough would be very lengthy and take considerable
effort - so do you have any specific questions that aren't answered by
the code?

(Disclaimer: The wikifier might be considered black magic, and I don't
claim to fully understand it myself.)


-- F.


* http://groups.google.com/group/TiddlyWiki/t/2ee6c9700a61b2b4

leeand00

unread,
Jul 31, 2008, 10:10:28 AM7/31/08
to TiddlyWikiDev
Yes they did, at least now I know what code to look at,

I just wish I knew where to start. I mean all I want is a sample
function call I can try to pass a wikified string into and get back
some HTML.

wolfgang

unread,
Jul 31, 2008, 10:11:19 AM7/31/08
to TiddlyWikiDev
Hi Andrew,

You also could look up RichTextPlugin, which works with RegEx magic to
convert the edit field into html and back again:

http://tiddlywiki.ouvaton.org/Demo.html#Demo%20RichTextPlugin

Regards,

W.

Paul Downey

unread,
Jul 31, 2008, 10:16:19 AM7/31/08
to Tiddly...@googlegroups.com
>
> I just wish I knew where to start. I mean all I want is a sample
> function call I can try to pass a wikified string into and get back
> some HTML.

wikifyPlain and wikifyStatic may help:

http://svn.tiddlywiki.org/Trunk/core/js/Wikifier.js

and there are some jsspec tests for the wikifier:

http://svn.tiddlywiki.org/Trunk/core/tests/jsspec/Wikifier.jsspec.js

HTH
Paul
--
http://blog.whatfettle.com

Martin Budden

unread,
Jul 31, 2008, 11:12:49 AM7/31/08
to Tiddly...@googlegroups.com
Use wikifyStatic, so (eg)

wikifyStatic("__underline__")

will return

<u>underline</u>

Martin

2008/7/31 leeand00 <leea...@gmail.com>:

leeand00

unread,
Jul 31, 2008, 1:03:42 PM7/31/08
to TiddlyWikiDev
Thanks Martin! That's exactly what I needed to know.

On Jul 31, 11:12 am, "Martin Budden" <mjbud...@gmail.com> wrote:
> Use wikifyStatic, so (eg)
>
> wikifyStatic("__underline__")
>
> will return
>
> <u>underline</u>
>
> Martin
>
> 2008/7/31 leeand00 <leean...@gmail.com>:

leeand00

unread,
Jul 31, 2008, 1:25:10 PM7/31/08
to TiddlyWikiDev
Hmm now there's no method for doing the opposite is there?

And turning it back into wiki text?

On Jul 31, 11:12 am, "Martin Budden" <mjbud...@gmail.com> wrote:
> Use wikifyStatic, so (eg)
>
> wikifyStatic("__underline__")
>
> will return
>
> <u>underline</u>
>
> Martin
>
> 2008/7/31 leeand00 <leean...@gmail.com>:

Martin Budden

unread,
Aug 1, 2008, 6:32:22 AM8/1/08
to Tiddly...@googlegroups.com
There's no way to turn HTML to wikitext in tiddlywiki.

There is a site that does various HTML to wikitext conversions:

http://search.cpan.org/~diberri/HTML-WikiConverter/

but it does not yet do HTML to tiddlywiki. I am in the process of
writing a converter for this, but it won't be available for a while.

Martin

2008/7/31 leeand00 <leea...@gmail.com>:

Reply all
Reply to author
Forward
0 new messages