Tags Issues When Text Editing a TW file

Does a TW html page store a list of all defined tags or does it only store tags alongside tiddlers that define those tags? I know the Control Panel can produce a list of all defined tags but is this list generated on demand or read from a data structure somewhere inside the TW page?

If I edit a tiddler by text-editing the TW html page and add one or more tags to the tiddler structure, are the newly added tags also added to the ‘tag store’ (assuming, as asked above, there is such a central store of defined tags)?

The reason I am thinking about this is that I could automatically create the tags, in the required format, for a document processed through my proper noun app. By required format I mean a tag for the phrase ‘Bob Jansen’ needs to be converted to ‘Jansen, Bob’ and I can automatically get this from the tagdictionary for known name strings.

bobj

As I understand it all thats need to make something a tag is its existence in a tag field on any tiddler.

  • When the wiki loads these are collected and maintained in memory at a minimum to maintain a cache so the answer is I believe “on demand”.
  • This seems to be happening at load time in $:/core/modules/wiki.js
  • As soon as you remove the last tag, the title is no longer a tag including on system tags.

But if course it is only meaningfully a tag once it is applied to tiddlers for meaningful reasons. However in this case it is the word or word combination you have identified externally, you want to make available within tiddlywiki when it loads.

  • If you modify the html file there are a number of ways you can “insert them” editing tags fields on tiddlers, or add to one specific tiddler with all the tags,
    • or even create a tiddler containing a list.
    • Then in the wiki provide access to these new “tag names”.
  • If using node there are other ways as well.
  • With the newish messages tm-http-* messages you may be able to pull your content in from a file.
  • Tiddlers are now stored as JSON, maybe just add a json record.

However I believe there are many ways for you to achieve this, perhaps others who have done this will share.

Tag lists are created dynamically “on demand”. Changing the HTML file to add tags is possible – but – you will need a browser reload, that the changes can be seen by the wiki.

At startup all tiddlers stored in the HTML file are loaded into memory. The wiki-store can not monitor external file-changes.

Tags can be real tiddlers too. Eg. If you drag&drop sort tiddler lists, a physical tag-tiddler will be created, which uses the list-field to manage the order of the taged tiddlers.

Thank you TW_Tones and pmario, that makes things clear.

If I do text edit the TW file then I would not have it open in a browser and would load it after finishing the text edit(s).

TW_Tones, I like your idea of a ‘tag’ tiddler and play around with this.

This proper noun stuff is raising some really interesting issues - thanks to all who respond.

bobj

bobj