Hidden links for reusable content

Folks,

I am starting to write a book that may or not be published, as an exercise in using tiddlywiki for authorship. I will look back at existing efforts and solutions in time, but I am starting from an empty TiddlyWiki to find out what is important to me in the writing process.

I have just found one; “Hidden links for reusable content”. Thus I ask if anyone has solved this yet.

Whilst typing prose you may come across a term or phrase you are going to use regularly. A sensible approach is to wrap it in square brackets eg;
[[Key phrase in a chapter or book]] and create a tiddler. Now every time you want to use the phrase you can search for the tiddler and insert it. With the relink plugin you can change it and it will be reflected everywhere. Later it could be used for links to mentions in an index or the tiddler may contain additional information such a link in an interactive book .

Sometimes however the having the reusable content is all you want.

Question;

  • Can anyone see an elegant way to optionally disable the “specific tiddler link” in the prose, whilst retaining the references, relink-ability and readability of that “tiddler title”?
  • Can anyone suggest how to do this with a simple annotation? so as to minimise the impact on the writing process and when rereading it in edit mode.

Will you use real links in your book, aside from these reusable phrases? If not, you could disable the links while you’re drafting and make them look like normal text with CSS.

.tc-tiddler-body a {
  pointer-events: none;
  cursor: default;
  font-weight: normal;
  color: #333333;
}

then maybe use data-tags to limit it only to tiddlers with your prose (not your writing notes).

credits to stackoverflow. Have a great day!

Thanks for the suggestion I will keep it handy, however in this case my document may also contain standard or external links and phrases, and I want them to sty live.

I am currently thinking about

  • simply turning the phrase into a transclusion. {{this is my phrase}}
  • But on creating the new tiddler placing {{||phrase}} in the text
  • Then the tiddler phrase will determine if it is a link, text or something else from a global setting.
  • If however the actual phrase tiddler [[this is my phrase]] has a display-field use that instead.
  • It can also make use of a style or tooltip set on the phrase tiddler

So the markup will simply be a transclusion {{This is my phrase}}

  • I just have to provide the support for creating and configuring the phrase tiddler.
  • I may also clone and change the “link” Editor ToolBar button to insert transclusions instead of a link.

But I am still open to suggestions.

I initially thought you wanted to use links for the links[] and backlinks[] operator. Since you’ll be using transclusions, you’ll have to use search[] operators to get all tiddlers with that phrase. Why not use a macro with square brackets? <<phrase [[All paths lead to Rome]]>> for example. If relink catches those, you could easily change them by making the tiddler first, editing the name, pressing relink all, then deleting it again.

Edit: you still do need to add a macro to the relink config so that it’ll pick up custom macros. The square brackets make no difference. Whoops.

1 Like

Conditional styling for links depending on whether or not they contain a particular character or series of characters?

[[Key phrase in a chapter or bookⓅ]]

Ciao @TW_Tones some long time ago on the GG @Mark_S and @BurningTreeC, in response to a question by me, provided some good basic code to be able to in writing create “latent transclusions”. Basically the idea was that you write and need links to items that later you’d transclude but which you have not written yet. The idea was to have a live toggle so that you can dynamically create tiddlers (link) AND opt to transclude them.

This is not a great description but hopefully you get the general idea? I did not have competence or time to take it further. But, if it sounds relevant to the OP, let me know and I’ll see if I can find their posts on the GG.

Best wishes
TT

1 Like

I’m not 100% sure, what you want to achieve, but I think my unilink-plugin may be helpful. Since aliases are basically calls to the aka macro they are fully style-able. There is an uni-alias class that can be styled.

You can also create aliases like: 1 2 3 4 if you want, so you can make your links look like footnotes, ^^superscript^^ or ,,subscript,, links.

Since aliases can have several aliases you can use them with any “alias name” you want later on. So they are “just” reusable content links.

There is no need to care about renaming them, you can add a new alias and you are done.

Back referencing is built into the plugin, so you have the same convenience as with links and backlinks. …

Just some thoughts.

1 Like

Done. I’ll post attachments over in GG in a few hours.

Spaghetti night with my kiddo, so I’ve got to get cooking.

1 Like

Thanks Mario and All,

I have a bad habit of trying to make things for myself, sure I learn and come up with new ideas but it does take time. Mario’s uni-link plugin is more than what I needed.

I did make two mods (Mario you may want to add?)

  • Some info in the drop down
  • and a new icon to help identify

wikilab-uni-link-alias-mods.json (2.5 KB)

Although I do not know how to Display the info button to the right of the heading and get the format right.

Snag_15705e95

With a simple;
info-button.json (366 Bytes)

All I need now is to find away to stop “alias phrases” looking like a link (even although it is). I want to not be obvious its a link of any kind, perhaps unless you mouse over.

@Charlie_Veniot * look forward to seeing this, especially if I can add more and customise.*

As I wrote. The links have an uni-alias class, that you can modify

1 Like

Thanks. I’ll have a closer look.

To make the changes obviouse
Snag_159d5c48

Migraine headache finally eased-up a couple of hours ago, and it dawned on me:

.tc-tiddlylink[href^="#%E2%93%85"] { color:inherit;}; in a stylesheet works A-1 (I decided to move that “Ⓟ” character to the front with an intent of doing CSS “first-letter” thing to hide that first character.)

I also had CSS in there to disable the link, with a plan to have a check box to enable/disable all of that styling.

Then I discovered that CSS “first-letter” works not with anchors. So my idea is up the creek.

Its always worth following a hunch even if sometimes they are dead ends

1 Like