Disabling links globally?

Hello all,
I am working on a Read Only mode that can be enabled from a tiddler, hiding all controls and the sidebar. I know others have made similar solutions, including StefCT’s ToggleAdmin, but I am looking to add an additional feature:

I want to disable all links between tiddlers, so users can’t change the story at all. Ideally the links will just look like normal text in this mode. External <a> etc links are fine to keep as they will not disrupt the story. The idea is to lock down the story so I can export it as a file that can be opened to view a set page with no interaction besides scrolling.

Any leads or advice on how I can get this behavior with a stylesheet or similar?
Thanks!
Scribs

So you want something more than just a static page, then? Because static generation generates individual pages for each public tiddler; in there the links will still take you to new pages, but will not update your current document.

1 Like

Correct, I am trying to make something that is as minimally interactive as possible, so a set story can be exported / permalinked. Viewers would not be able to navigate or open/close tiddlers, just scroll and view the pre-set story. It would be useful for collecting a story of tiddlers as e.g a report sent to others, with just the tiddler(s) containing relevant data showing and without any distracting “editable interlinked wiki” elements.

To stop links in tiddlers Control Panel > Info > Advanced > Parsing and uncheck wikilink.

To stop links operating in the side bar you may need to use event or message catcher, to capture navigate events and don’t honor them, perhaps its better to just hide the sidebar if its going to be useless anyway.

1 Like

I went to do that and found it was already unchecked, I think that only disables CamelCase links and not hard [[links]]. As I do not really use the CamelCase links, that unfortunately isn’t the solution I need. And sidebar links are fine, I am hiding the sidebar and the “show sidebar” controls.

are named “pretty links” … The name of the parser is: “prettylink” … but it creates something like this. → I needs a save and reload to be active.

That’s not what you want. …

BACKUP – FIRST – BACKUP – FIRST – BACKUP – FIRST – BACKUP – FIRST

You can basically brick your wiki if you use the tag $:/tags/Macro … which can be intended, but you really need to know what you do here. Your links will be gone … ALL of them!!

There are 3 different tags, that will enable “global” macros.

  • $:/tags/Marco ← if this is used all links are gone … All of them
  • $:/tags/Macro/View ← start with this one. Sidebar and search still work
  • $:/tags/Macro/View/Body

You can create a new tiddler eg: disable-wikilinks and tag it $:/tags/Macro/View with the content.

You can use the macro on a per tiddler basis

\define tv-wikilinks() no

This has side effects. Eg: you cannot use image-links anymare as shown in the HelloThere tiddler if the following file is imported and tested at tiddlywiki.com

disable-wikilinks.json (174 Bytes)

Tiddler links are entirely disabled wherever the variable “tv-wikilinks” has the value no. Therefore you can just put define tv-wikilinks() no at the top of your template to disable tiddler links within it. External links will still operate as usual.

Thank you both! @pmario I appreciate the extra detail (didn’t know about the other /tags/macro tags, that will be very useful), and the call for caution - my wiki is well backed-up and I am going to be saving it as a different file anytime I want to do this, so don’t worry :slight_smile: