Is there a way in TW to format internal links themselves, for example:
[[//Internal link//|example in italics]]
I believe I can change CSS precedences with !important but this failed in my experiments and I am not confident with the language. I am also concerned about possible side effects.
I have been copying over some old but important documents into TW. One large set of documents/notes relies a lot on formatting and is also replete with links, and relies on them to a large extent. I would otherwise have to rethink all the information presented there, which I am trying to avoid.
Maybe you can do what you want using the <$link> widget instead of the WikiText syntax?
Have a look at the official documentation for the link widget here.
Yan, You are adding italics not emphasis, which happens to also be set by default to italics.
Remember by default links to missing tiddlers are italic, so if you make all links italic, you loose access to this information. That is fine if you don’t mind. But you may confuse other tiddlywiki users.
Yan, you may be interested in the many variations on the idea of using something other than tiddler titles for links. Tiddler titles should not contain style markup, and aren’t designed to be wikified — but other fields can include such markup, and are designed to be wikified.
For example, all of my TiddlyWiki projects that include bibliographic resources harness the caption field for links, because the caption field can include italics and other special characters, as needed to make a proper reference to a book title within a string that also includes non-italic elements. Here’s an example:
Thank you all for your suggestions. So far I may have to go with @tw-FRed’s solution but @Springer’s is also promising.
Two points to address first:
Thanks, I am aware of that per the subject of the topic. I have long changed this setting so they are red links, MediaWiki style.
I will say that TW WikiText is unusual in terms of lightweight markup languages, as the enclosing item normally sets formatting in all cases.
I was thoughless in mentioning external links, where this always works (confirmed just now). I’ve edited it out of the top post to avoid confusion.
Unfortunately, this does not work with internal links. I tried this in an empty TiddlyWiki as well.
I like this concept. I can transclude the caption and this might be the way I go about it, probably through a macro.
I am concerned that macros are marked as “superseded” officially so they may suddenly stop working in a future version, but it’ll do for now.
Edit 2: I also did a PR and Jeremy found out that the code above creates “false positives” – So it actually needs a bit more support from the core parsers. There is a PR at GH
Actually this just means there are new recommended ways. Even when “deprecated” you can rely on backwards compatibility at least until a major version upgrade, if not further.
Macros can usually be replaced with procedures easily, if you are concerned.
I’d like to try this solution but not sure how to make it work with the given example. Do I need to add the first two lines in my custom stylesheet? OR are you saying it will never work for internal-links?
I’ve tried a couple of different approaches.
What I want is for selected internal-links made bold for emphasis, eg.
…check new content since last backup
and I’ve tried something like this…
...check <span class="boldTitle">[[new content|tiddlerTitle]]</span> since last backup
It may seem decorative in that demo page. But look at what it does for bibliographic links with mix of italics and plain text (and anything else you like). Screenshot below — each bulleted list item is one link, using the caption field to store a compact (markup) version of AuthorLast, Short Title (year)