[TW5] ReadOnlyCore - real read-only mode for tiddlywiki

148 views
Skip to first unread message

Jed Carty

unread,
Mar 25, 2020, 7:15:26 PM3/25/20
to TiddlyWiki
Another of the things that I hadn't gotten around to releasing, a plugin that you add to a wiki and it lets you export a version of the wiki with the core plugin replaced with one that makes the wiki read only.
The exported wiki has all tiddler editing and importing functions removed. The navigator widget has the parts that let you edit tiddlers removed, and any buttons or interfaces for them taken out too.

There is one way that someone could find a way to exploit, which is there are places where you can edit tiddlers like the site title, where you could put in wiki text and maybe use it to edit other tiddlers.

I can remove the edit widgets but then the search and other things won't work. If it is a problem I may make a second version that has the edit widgets removed.

The plugin is available on the demo wiki here: https://ooktech-tw.gitlab.io/plugins/readonlycore/

Joshua Fontany

unread,
Mar 25, 2020, 7:43:06 PM3/25/20
to TiddlyWiki
Brilliant. :D Thanks for all the recent code!

-Joshua Fontany

TonyM

unread,
Mar 25, 2020, 7:43:33 PM3/25/20
to TiddlyWiki
Jed,

Once again that sounds fantastic. A different approach to those that went before.

Thanks
Tony

TonyM

unread,
Mar 25, 2020, 10:34:39 PM3/25/20
to TiddlyWiki
Jed,

FYI: On download I get the message "Undefined widget 'edit-text' " in the place of the search text, and in the advanced search tabs.

It looks really good and very locked down.

I have thought about how to use this. It would be a great way to publish a version at at a point in time. 

With this in mind a nice little feature would be if there were a namespace such as
$:/readonly-tiddlers

Such that it may be the prefix for tiddlers eg
$:/readonly-tiddlers/$:/SiteTitle
or
$:/readonly-tiddlers/mytiddler

Thus
  • Such that when the readonly tiddler is generated these replace their namesake $:/SiteTitle or mytiddler in the generated wikifile.
  • This would allow customisations to the readonly build without being active in the source wiki.
  • The inner wiki plugin achieves something similar with its data tiddlers, but rather than remove as your plugin does you have to add to the empty version.
  • Sending your readonly wiki into an innerwiki would allow the readonly wiki to be previewed before saving.
Nice work
Tony

On Thursday, March 26, 2020 at 10:15:26 AM UTC+11, Jed Carty wrote:

Mohammad

unread,
Mar 26, 2020, 3:52:26 AM3/26/20
to TiddlyWiki
Great job!

I downloaded a copy and I noted the search bar is not displayed instead a button a button with a message indication missing widget!

--Mohammad

TiddlyTweeter

unread,
Mar 26, 2020, 5:46:55 AM3/26/20
to TiddlyWiki
Very useful.

Much appreciated!

(Others commented on a small teething problem ...)

Tx!

HC Haase

unread,
Mar 26, 2020, 5:51:38 AM3/26/20
to TiddlyWiki
This is nice.

I was thinking, that it could be useful to also exclude normal tiddlers with a filter. this way you could have a button to only export the tiddlers you want from your wiki, to a read only version ready to publish.


I tried hacking it together. it work when I hardcode the filter, but I can't get it to work with a field reference.

$__ReadOnlyCore_readme-test.json
$__ReadOnlyCore_readme_exclude.json

PMario

unread,
Mar 26, 2020, 5:52:35 AM3/26/20
to TiddlyWiki
Hi Jed,

Interesting. Wouldn't it be easier to create a plugin, that contains a "patch set", with the changes needed and install the plugin in a "working TW".

The "Patch and Download" button could download a "read only" version. So the author can still edit the "master" but publish the "read only" version.

This should also be usable/useful with the node build environment.

-mario

Jed Carty

unread,
Mar 26, 2020, 6:25:38 AM3/26/20
to TiddlyWiki
HC Hasse,

That is already possible. The widget that does the downloading is the same as the download wiki widget used by bob. It has an attribute that lets you set an exclude filter to exclude the tiddlers you don't want, and an include filter to only include tiddlers returned by that filter. The include works before the exclude so if you include everything with the tag foo but then specifically list one of the tagged tiddlers in the exclude filter it won't be in the resulting wiki.

Adding an interface to make it easier wouldn't be hard, I will see about adding it.


Mario,

I don't know how what you are describing is different from what it is now, you put the plugin in an existing wiki and it doesn't change anything until you download the read only version. So unless I am missing something you are describing exactly what it does now and how I use it.

PMario

unread,
Mar 26, 2020, 6:44:13 AM3/26/20
to TiddlyWiki
Hi Jed,

I didn't have a look at the code ... yet.

It seems you do replace the whole core plugin, which basically is a "hard fork". ... So If I disable the plugin at: https://ooktech-tw.gitlab.io/plugins/readonlycore/ and download the wiki I do get a broken wiki.

What I was describing is

 - Use the default core
 - Have a plugin, that contains a configuration how to patch the core with a special download button.

If I delete the eg: "download-read-only" plugin, it should save a working and editable wiki, with the unmodified core.

Eg: If I use TW 5.1.22 with the readonlycore-plugin and save the wiki, I'll get a 5.1.21 wiki, right? If yes ... That's not what I wanted.

-m

Jed Carty

unread,
Mar 26, 2020, 6:53:41 AM3/26/20
to TiddlyWiki
Mario,

That is what it does. It is a normal plugin. If you put the plugin in a wiki you have a working wiki. The button is doing exactly what you describe, so if you remove the plugin the button doesn't work because you don't have the patch to apply.

It is quite literally exactly what you are describing.

Perhaps the demo is confusing, the demo is a read only wiki, if you install the plugin like the instructions say it is exactly what you describe. 
I had to pick between people not reading the instructions and asking why you could edit the demo wiki and not reading the instructions and asking why you couldn't edit the demo wiki.

I guess I will change it to the other way and see what questions I get.

Jed Carty

unread,
Mar 26, 2020, 6:59:47 AM3/26/20
to TiddlyWiki
I changed it so the demo wiki is editable and you just download the read only wiki.

HC Haase

unread,
Mar 27, 2020, 3:44:22 AM3/27/20
to TiddlyWiki


torsdag den 26. marts 2020 kl. 11.25.38 UTC+1 skrev Jed Carty:
HC Hasse,

That is already possible. The widget that does the downloading is the same as the download wiki widget used by bob. It has an attribute that lets you set an exclude filter to exclude the tiddlers you don't want, and an include filter to only include tiddlers returned by that filter. The include works before the exclude so if you include everything with the tag foo but then specifically list one of the tagged tiddlers in the exclude filter it won't be in the resulting wiki.

Adding an interface to make it easier wouldn't be hard, I will see about adding it.

very cool, tanks.

my problem was to get both the $:/core and a custom filter in a field, to be excluded. if I wrote the filter in the code, it worked, If I transcluded a field with the both my filter and thet $:/core, it worked, but if I had the $:/core in the code or other transcluded field, and a transcluded user field for a filter, i did not work.
I guess I am just not experienced enough with TW code.

HC Haase

unread,
Mar 27, 2020, 3:49:57 AM3/27/20
to TiddlyWiki
Mohammad recently published an "author tool" in his utility plugin. This hides a lot of the user interface by ticking off a list (tiddler view toolbar, sidebar tabs, site toolbar etc) and is very handy to make a quick toggle of a "read only" public wiki.

I think Mohammads plugin combined with yours will make a very powerful read only exporter.

true read only + customised UI for public
Reply all
Reply to author
Forward
0 new messages