AutoPill (beta) - Parser to automatically turn any word into a tag pill (if it's a tag)

174 views
Skip to first unread message

David Szego

unread,
Mar 21, 2017, 10:08:57 PM3/21/17
to tiddl...@googlegroups.com
Hi all,

I needed a way to dynamically give me cross-links within my Wiki, but I couldn't MakeEverything a CamelCase link. And I didn't want to <<tag manually>> wrap everything in appropriate <<tag tags>>.

So, here's a beta of a parser that looks through all non-system tags, finds matches in the text of a Tiddler, and wraps them with a <<smalltag ... >> macro. (This is just a better-behaving Tag macro).

Updates:

Some bugs fixed:

  • Now wraps only the first occurence of a tag-word, making for much more visually clean text
  • Honours the prefix to not wrap in a pill, much like ~Don'tLinkCamelCase works.
  • Doesn't wrap the left-side of words with apostrophes, if that side is a tag
  • Editing a Tiddler no longer un-AutoPills the whole Tiddler until you save/reload
  • Regex no longer kills double-apostrophese at the end of a word, thus killing the bold parser

Some bugs remain:

  • Still constrained by tag-cache - adding a tag doesn't AutoPill until you save/reload
  • Matches every instance in a list, as each list gets iterated separately
Try it at http://david.szego.me/autopill.html

Cheers,
David.

David Szego

unread,
Mar 23, 2017, 11:07:05 AM3/23/17
to TiddlyWiki
Bump ... Much more usable version, go give it a try if you haven't already, or update the .js Tiddler if you've been playing with it.

Cheers,
David.

@TiddlyTweeter

unread,
Mar 23, 2017, 2:50:39 PM3/23/17
to TiddlyWiki
I'm not ignoring it. Its just the particular implementation is not so useful to me. BUT I am very interested in how to automate taggery. Both FROM extant TW Tags and TO freshly create new Tags.

My particular use case is being into Twitter. I often author using #hashtags in text. The little gizmo that you looked at before from tesseract was part written in reply to me about how to automate creation of TW Tags from Twitter posts written in TW with #hashtags. A few interesting cases came up like #Buddhist & #buddhist (equivalent on Twitter) end up in TW as both "buddhist" & "Buddhist" tags.

The mechanism to only deal with strings starting with a delimiter I do think has value. A possible issue with your implementation is Taggitis? :-).

NOT that this is that much to do with what you are doing, but I thought it worth mentioning.

Best wishes, and interest
Josiah

@TiddlyTweeter

unread,
Mar 29, 2017, 7:22:37 AM3/29/17
to tiddl...@googlegroups.com
Ciao David

I have been thinking about your method of Auto-Tagging & ways I might benefit from it.

I have a Use Case that may be of interest ...

- AIM: Analyse the novel Great Expectations for the occurrence of characters (like Tags: Pip, Estella, Havisham, Jaggers, Drummle ...)

- HELPFUL AID: Auto tagging ALL the occurrence of NAMES of characters in the text so a student could get a useful visual sense of the pattern of occurrence.

This leads me to some thoughts ...

1 - That the Auto-Tagging Gizmo be able to be TOGGLED on/off. Its very useful but it could also be over "noisy" as a perpetual thing in texts. Being able to toggle it on and off would, I think make it much more useful to someone like me.

2 - Taking that further ... an awkward? thought ... that the addition of in-text Auto-Pills could also just be done on strings in the text from a "Picklist", rather than from extant tags? In other words the tags are created dynamically according to what is on a "Picklist". Hope this is clear?

Just thoughts.

Best wishes
Josiah

David Szego

unread,
Mar 29, 2017, 11:20:49 AM3/29/17
to TiddlyWiki


On Wednesday, 29 March 2017 07:22:37 UTC-4, @TiddlyTweeter wrote:

I have a Use Case that may be of interest ...

- HELPFUL AID: Auto tagging ALL the occurrence of NAMES of characters in the text so a student could get a useful visual sense of the pattern of occurrence.

 Great use case... Make the names a Tag, and they get highlighted.


1 - That the Auto-Tagging Gizmo be able to be TOGGLED on/off. Its very useful but it could also be over "noisy" as a perpetual thing in texts. Being able to toggle it on and off would, I think make it much more useful to someone like me.

Now *that* I'm excited about! And as soon as I read it I realized how easy it would be, what a great suggestion! I'll work on it tonight or tomorrow when I have some time. Basically put a button beside the tags on the header of the Tiddler, which changes the <<smalltag>> macro to return a button wrapper or return just the word.

Love it, would be useful for me too!


2 - Taking that further ... an awkward? thought ... that the addition of in-text Auto-Pills could also just be done on strings in the text from a "Picklist", rather than from extant tags? In other words the tags are created dynamically according to what is on a "Picklist". Hope this is clear?

I'd make that a separate plugin, but it's an interesting idea.

Alex Hough

unread,
May 15, 2017, 5:54:09 AM5/15/17
to TiddlyWiki
Hi

I think autopill could be very useful, especially now we have drag and drop

@David - the link above is broken, is the plugin still online


Alex

--
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 tiddlywiki+unsubscribe@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
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/99db9e55-ef69-4150-b677-95de37db86e7%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages