Having just mentioned AutoCorrectPlugin
<https://groups.google.com/forum/#!topic/tiddlywiki/HUwdBiCrgQQ>, here's a
stranger, wish-listier request/fantasy:
Could you write a TW5 Javascript plugin that would perform the same sort of
string transformation — but using complex regular expressions? :-O
I regularly get task lists from my co-workers that I transform into
checklists. Currently, I do this by copying the list to Notepad++, running
a saved macro, and copying the output to my TiddlyWiki. For example, I
might get a list like this:
Update Tom on Open Tickets
> Where do we stand with Friday's ads?
> Send Ed new reports.
> Proofread "Title of a Story"
... which I transform into wikitext like this:
#<div class="todo"><$checkbox field="todo_updatetomonopentickets"
> checked="done" unchecked="not done" default="not done">Update Tom on Open
> Tickets</$checkbox></div>
> #<div class="todo"><$checkbox field="todo_wheredowestandonfridaysads"
> checked="done" unchecked="not done" default="not done">Where do we stand
> with Friday's ads?</$checkbox></div>
> #<div class="todo"><$checkbox field="todo_sendednewreports"
> checked="done" unchecked="not done" default="not done">Send Ed new
> reports.</$checkbox></div>
> #<div class="todo"><$checkbox field="todo_proofreadtitleofastory"
> checked="done" unchecked="not done" default="not done">Proofread "Title
> of a Story"</$checkbox></div>
How cool would it be if I could simply paste the list into TW and have it
automagically transformed into ready-to-work-on checklist items?
What I would really want (I think) is a macro that isn't global to all
tiddlers, that I could call on in specific tiddlers — and that I could pass
my complex regular expression to as a parameter. (That would allow me to
keep regexes in their own tiddlers and transclude them as the parameter of
the macro.) This would enable me to create a new tiddler and save it with
something like this at the beginning:
{{myCrazyMacro}} <<callToMyCrazyMacro {{myWackyRegExParamInSomeTiddler}}>>
Then drop my ready-to-be-transformed text strings into it and have them
transformed into TW-friendly task lists (or whatever I might regex 'em into
in future tiddlers).
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/f276659c-4185-479c-9cfa-d07e38f75c5b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.