accents and subscripts within a link

72 views
Skip to first unread message

andrew levy

unread,
Feb 15, 2016, 7:14:50 AM2/15/16
to TiddlyWiki
I'm having issues with retaining text formatting when its within a link

for example

[[5-HTP,,1B,,]] or [[Leaõ]]

Also how do you format text within the tiddler title?

thanks

andrew

Eric Shulman

unread,
Feb 15, 2016, 7:29:07 AM2/15/16
to TiddlyWiki
To use wiki formatting within link display text, use the <$link> widget instead of the [[...]] shorthand, like this:

<$link to="NameOfTiddler">5-HTP,,1B,,</$link>

with regard to tiddler titles: the title of the tiddler is it's ID within the system.  Putting formatting codes into the title would be a bad thing.  Instead, use the 'caption' field of the tiddler to enter formatted text.  To have the caption field displayed as the tiddler title, modify $:/core/ui/ViewTemplate/title and change <$view field="title"/> to <$view field="caption"/>.

Note: alternatively, you can use <<toc-caption>> in the ViewTemplate.  This macro is defined by the core (see $:/core/macros/toc), and will display the caption text if present, with an automatic fallback to the title if no caption is defined.

enjoy,
-e

andrew levy

unread,
Feb 15, 2016, 8:02:25 AM2/15/16
to tiddl...@googlegroups.com
Hi Eric,


Thanks for your help. Could you walk me through the tiddler title in more detail. I'm still in the early days of TW. What is the caption field?.

Could you take me through it step by step with the 5-HTP,,1B,, example.

Much appreciated.

Andrew

--
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+...@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/ca8834e0-c49b-4a8f-bbd1-34b8741a809f%40googlegroups.com.

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

Scott Simmons (Secret-HQ)

unread,
Feb 15, 2016, 11:21:25 AM2/15/16
to tiddl...@googlegroups.com
Hi, Andrew —

You've probably noticed tiddlers can have custom fields.  You can add a field by filling in the "field name" and "field value" boxes at the bottom of a tiddler while in edit view and clicking the "add" button.

You could create a field named "caption" and give it a value of 5-HTB,,1B,,.  Now, in tables of contents and in tab titles, you'll see 5-HTB with the 1B displayed as a subscript.  If you like to the tiddler, you'll still use it's name, as typed into the name field, but most everywhere else in TiddlyWiki, you'll see it identified by the formatted name you entered in the "caption" field.

You can one step further by opening the shadow tiddler $:/core/ui/ViewTemplate/title and editing this bit:

<$view field="title"/>

... to this:

<$transclude field="caption"><$view field="title"/></$transclude>

That will make the tiddler itself (in view mode) show the "caption" value in its header, rather than it's actual (formatting-free) name.  For tiddlers with no "caption" field value, the actual title will be shown as a fallback value.  (The code above tells TW to display the tiddler title but, if a caption is present, to display the caption instead.)

You'll still see the tiddler's actual name in edit mode, and you'll need to link to it and refer to it by its actual name — but everywhere it's listed or shown, you'll see the formatted version of its name from the "caption" field.

It's a pretty handy feature!  :)
Reply all
Reply to author
Forward
0 new messages