Greetings,

I'd like for tiddlywiki to support my favorite markup language,
txt2tags.  I've decided to do this via a tiddly plugin.  It was
suggested that I meddle with config.formatters, and I'm trying to
decide the best course of action.

I could simply create new formatters and append them to the list
already.  I think this would kick them to the "end" as far as
priority.  I think some of the tiddly syntax and some of the txt2tags
syntax are incompatible (bold is **bold** in txt2tags, while it
is ,,bold,, in tiddly, for example). This means that I would need to
modify config.formatters as it exists already.

For the sake of minimal code size in my plugin tiddler, I think
modifying the config.formatters object would be better than simply re-
creating the whole array (most of it would be almost a direct copy
from the core anyways; wasted space).  I'm not experienced with
javascript, but is it possible for me to iterate the array and replace
individual members in objects?  For instance: replace the "match:" and
"termRegExp" in the list-item formatter?  I don't know if the objects
are mutable, is what I'm saying.

I'm concerned about compatibility.  I've decided to leave most of the
formatters in place as-is unless they directly conflict with the
syntax I'm trying to use- in particular, I'm not going to step on any
of the macro,comment,url,wikiword, or table syntax.  I suspect that
modifying these formatters would result in a broken tiddlywiki.  I
believe that I can safely replace the text formatters (for bold,
horizontal-lines, headers, ordered/unordered lists).  I decided what
formatters are necessary by looking at the default shadow tiddler's
code in an empty.html tiddly- ensuring that any of the non-text
formatters will remain.  Do you think I'll be safe in this?

I also have some general concerns about code execution and complexity-
If I opt to leave some text formatters in place because it doesn't
directly conflict (i.e. add a "headers-t2t" formatter supporting our
== header2 == syntax and leaving the "headers" formatter in place
since they don't conflict) then I may end up with maybe 10 or more
extra formatters.  I worry if this will add a great deal more
execution time when rendering tiddlers.  Am I worried about nothing
for this?

Thanks for your help.

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/tiddlywikidev?hl=en.

Reply via email to