On Thursday, May 14, 2015 at 8:24:28 PM UTC+2, Kakyo wrote:
>
> Thanks Mario! Worked like a charm!
>

Good :)
 

> I'm not a web developer. Does this mean that there is a set of exposed 
> object API one can call to manipulate the entire wiki in the developer 
> console?
>

Yes. We are in browser Javascript-land where the environment is sandboxed, 
but everything is public ;) 
Basically the whole TW functionality is covered in $tw. The $tw.wiki.xxx 
functions manipulate the TW internal data store. 

If so, where is the API doc?
>

:) In normal cases I's say read the tests [1], but I have to say: Read the 
source. Especially: boot.js[2] and wiki.js [3]. may be tiddler.js
Test coverage is at minimum. IMO contribution would be very welcome :)

IMPORTANT: Backup, backup, backup. if you play with your data!

WARNING: If you use those functions in the console, you have the 
possibility to mess things up, in a way, that may not be obvious and may 
cause problems in the future. eg: field names with possible but illegal 
characters like spaces   

Using "read" functions like $tw.wiki.getTiddler(), .filterTiddlers() ... 
are not problematic, since they don't modify the store. 

On the other hand: .addTiddler(), .deleteTiddler(), ... may give you 
unexpected results. Eg. .addTiddler() needs the right tiddler fields, so 
tiddlers show up in the right sidebar ... 

So you are welcome to play with it. .. But use a TestTW instead of your 
production data :)

have fun!
mario

[1] 
https://github.com/Jermolene/TiddlyWiki5/tree/master/editions/test/tiddlers/tests
[2] https://github.com/Jermolene/TiddlyWiki5/blob/master/boot/boot.js
[3] 
https://github.com/Jermolene/TiddlyWiki5/blob/master/core/modules/wiki.js
 

-- 
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 http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/33583101-d72a-49eb-960d-9faec928fa11%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to