Skip to content
tobibeer edited this page Mar 7, 2013 · 10 revisions

IdPlugin (min) proposes an extension to the TiddlyWiki core providing the following functions...

Tiddler.prototype.getId()

  • returns the id for a tiddler
  • example: tiddler.getId();

Tiddler.prototype.setId(length, radix)

  • sets a tiddler id if not set yet
  • length and radix are optional arguments for Math.uuid.js (see below)
  • example: tiddler.setId();

TiddlyWiki.prototype.tiddlerId(tiddlerOrTitle, length, radix)

  • persists and retrieves a unique tiddler id
  • tiddlerOrTitle: use either a tiddler object or a tiddler tile
  • length and radix are optional arguments for Math.uuid.js (see below)
  • internally, store.tiddlerId() calls tiddler.setId()
  • example: store.tiddlerId('Foo', 8, 48);

TiddlyWiki.prototype.getTiddlerById(id)

  • retrieves a tiddler by its id
  • example: store.getTiddlerById(theId);

Id Generation

Internally IdPlugin uses Math.uuid.js to generate uuids...

  • default length: 21 characters (max unlimited)
  • default radix: base 62 (this is max)