Ideally, the way to do this would be to put the references in their own 
tiddlers. The problem is the auto-numbering ... since you can't know the 
numbering in advance. The workaround is to use a javascript macro, that can 
keep track of references internally.

This is a proof of concept. It adds a JS macro, autoref.

Parameter: tiddler

  Tiddler to be accessed. Or, can also contain number of tiddler

Parameter: action

  "link" (to link a tiddler to a number) 
  "ref"  (to access the tiddler assigned to the number,
       or number assigned to the tiddler)
  "max" (to access the current max reference number)
  Default is "max".


Be sure to backup your TW before trying (or better yet, use in an empty TW 
file).

This shows how the concept can work with numbered references. The idea is 
that the javascript tracks the auto-numbers, but everything else would be 
left up to your own, task-appropriate macros. The next stage would be to 
add code to allow multiple kinds of references (e.g. captions, figures). 
The sample macros here let you insert references that show as numbers 
(think anchors), show a tiddler description by tiddler (with number), show 
a tiddler description by number. The list routine uses the range operator 
to list all references.

Drag and drop into your TW file, and then reload (the JS does not take 
effect until you reload).

Various caveats: Please don't give your reference tiddlers names that are 
numbers! Resist the urge to give any of your tiddlers the name 
"MAS-REF-COUNTER". Note that presently the macro doesn't check if your 
referenced tiddlers actually exist. Not sure if this is a bug or feature.

Have fun,
Mark

-- 
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/0eb3ea74-9eac-42fa-b2fa-b7177de9a738%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Attachment: autoref-v01.json
Description: application/json

Reply via email to