Tiddler Discourse Plugin

This is an extension of a discussion from a while back. "Discussion examples" converted into tiddlers?

In there they talked about converting “Discussion example” tiddlers commonly used in discussions here to real tiddlers. In that thread, they come to the conclusion that it would be best to have TiddlyWiki parse imports in that format to real tiddlers.

I want to purpose a different solution, that I would be interested in making if it has enough support. I think it would be interesting to create a Discourse Plugin that created a new markdown block similar to the code block. In it, you can fill out a tiddler, with text, title, and fields. Like the code block, it would also have a copy button in the corner, that allows you both to drag it or Copy and Paste it into a TiddlyWiki.

I want to talk about the merits of the idea, see how much support it has (even if I made it, but people didn’t care, it would never actually get added) and also talk about what the syntax would be.

2 Likes

You mean that the tiddler code would be rendered in an interactive tiddlywiki embed ? Or that it would show up as a codeblock but with additional data (fields) ? Either way, I think it would be great for efficient sharing

It would show up like a code block, probably not unlike the way they discussed in that thread.

title: Foo
tags: $:/mytag

howdy dowdy

An interactive embed would be cool, but I’m not sure how practical that would be to implment. Might be a topic for some discussion on how that would work. Lacking an actual wiki, filters couldn’t work, and theming couldn’t happen, but maybe converting some basic stuff into static HTML would be cool.

Oooh ingenious! If it is as simple to use as the code block markdown, then I’m convinced people would use it. Consider that both those who post code to ask for help and those responding already have the incentive to make that code useful… so, yeah, I’m sure it’d be used if it is as simple as markdown.

Would the following syntax be possible (this is an image by the way):

image

i.e what “triggers it” is the inclusion of title: as the first thing after the initial triple backticks. (A title is the minimum data needed to create a tiddler.)

It would need to be different than the ```, as that is already being used. Maybe ~tw or something else could be used instead. Any consistent syntax should be possible, it just needs to be implemented that way.

Is it not possible to overwrite it or do you not consider it appropriate? My reasoning was that code blocks in this forum, of course, mostly contain “tiddler content” and the additional requirement to type title: makes it distinguishable from code that should not be converted into a tiddler.

I’m not 100% sure if I can overwrite it. It might be worth considering if I can, but I can’t promise it will work. It also might work, but the bulk of code behind it might break as well. (It can do a lot more than you normally see it do.)

Thanks. If it works then nobody would really have to learn anything new.

By the way… if it is something other than triple backticks, then it probably makes sense to explicitly show this in the resulting code block, so to “teach” how it is made. (Of course the markdown shouldn’t follow along in the actual tiddler).

I support the idea @GameDungeon but suggest we make sure we deal withy both to and from Tiddlywiki < > Discourse. The natural format is the .tid format which we can already export to file.

  • Although for discourse we may want to exclude some fields such as created/modified dates

I also started developing a custom preview so with in tiddlywiki you can see the current tiddler as a “tid” view. The full solution will also allow one to copy this “tid view to the clipboard” then paste into discourse. tiddler-preview_display-tiddler.json (611 Bytes)

Whilst I am in favour of your proposal I see no harm in including one of more tiddlers in a JSON for discourse, as I have above. It is easy top download to a scratch location, then drag the filename from the bottom of chrome, or in the firefox downloads, into the wiki you want it.

I agree we should think about both ways.

It might also be good to support both .tid and JSON as formats you can write tiddlers in.

The advantage of this over the JSON link you have there is you can click on a copy button and then simply paste it in, with no downloading or dragging involved. Also, it displays the info in the tiddler. WIth that JSON file I have no clue what I’m getting until I open it up.

1 Like

But what happens once pasted, how dose it become a working tiddler(s)?

With the download to scratch, drag and drop/import it becomes a working tiddler!

I won’t go into in now but I have a great set of workflows for handling wikis and json packages on top of windows. Addressing this community sharing aspect will “top it off”.

It uses the normal import system. It’s the same thing that would happen if you drag and dropped it in.

With some javascript, you can put a URI into the clipboard that TW will recognize.

There is currently an open PR that allows this to work properly as it is a bit broken currently. That does mean we will have to wait for the next update before the copy-paste can work.

2 Likes