Posting to a Discourse forum using TiddlyWIki

A solution was proposed by @Sii @BurningTreeC to post directly from inside Tiddlywiki to https://talk.tiddlywiki.org/ (Discourse).

These are the steps

  1. Create a tiddler tagged $:/tags/ViewTemplate and place this code inside
<$list filter="[all[current]tag[$:/tags/Discourse]]">
<$wikify name=url text="""http://talk.tiddlywiki.org/new-topic?title={{{ [{!!title}encodeuricomponent[]] }}}&body={{{ [{!!text}encodeuricomponent[]] }}}{{{ [all[current]get[category]has[subcategory]encodeuricomponent[]] :reduce[<..currentTiddler>get[subcategory]encodeuricomponent[]addprefix[/]addprefix<currentTiddler>addprefix[&category=]] :else[all[current]get[category]encodeuricomponent[]addprefix[&category=]] }}}{{{ [all[current]tags[]] -[[$:/tags/Discourse]] +[encodeuricomponent[]] +[split[ ]join[,]] +[addprefix[&tags=]] }}}""">
<a href=<<url>> target="_blank" class="tc-tiddlylink">{{$:/language/PostToDiscourse/Hint}}</a>
</$wikify>
</$list>
  1. Create the tiddler $:/language/PostToDiscourse/Hint and write something like “Post to Discourse” in its text field
  • Then all tiddlers tagged $:/tags/Discourse will have a “Post to Discourse” link at the bottom
  • All additional tags to the tag $:/tags/Discourse will show up as tags in the Discourse dialogue
  • The field “category” of the tiddler is used to set the category, the field “subcategory” is used to set the subcategory

More information:

1 Like

Ciao Mohammad

Please note that in the macro I had to change …

-[[$:/tags/Discourse]]

to

[[$:/tags/Discourse]]

Otherwise “Post to Discourse” doesn’t appear. Problem is that the tag then gets posted to Discourse!

How would I change the macro so that the tiddlers tagged “$:/tags/Discourse” get the “Post to Discourse” footer but the tag “$:/tags/Discourse” doesn’t get posted??

Thanks for bringing this together in a useful tutorial!

UPDATE: I should have said I tested on TW 5.2.1 in Firefox on Windows 10.

Best wishes
TT

Hi TT
Does it work for you now?

p.s: you can also edit the main post! It is a wiki post!

Ciao @Mohammad

Thanks! It is working better!

FYI, I’m gonna do a few tests to try work out how to post to Discourse with rich formatting.

I do think the ability to post directly from TW opens a lot of possibilities.

Best wishes
TT

1 Like

Please share, I’d like to hear about them. I must be missing something. Frankly, all I see is more clutter in my wiki(s). :confused:

1 Like

Ciao @CodaCoder. Work-in-progress. But I think the ability to AUTHOR posts directly from a TW with (hopefully) NEAT layout, though necessarily a minor sport, could be rather good. It needs more thought. Just having a way to post (we now have thanks to @Mohammad, @Sii and @BurningTreeC) is the basic gateway. To go further needs a few sins, maybe …

Sorry, I was less than clear.

I understand the tech mashup. I don’t get the “need”, I don’t “see” how it improves anything.

For it to be useful, it needs to be easier than using Discourse directly.

For it to be easier, it needs to be ready to go, in my wiki’s UI, all the time. (Clutter)

That’s a showstopper for me – Discourse-direct is better (again, unless I’m missing something).

Overnight Thinking Hat on for tomorrow…

Notte caro
TT

Right.

There are a bunch of things in my mind about this that are likely not so “Discourse direct”.

Before I explain more I need hasten to add that for the normal day-to-day “Discourse direct” is good.

The limited cases I’m thinking of are somewhat inspired by some of @Mohammad’s wikis where he takes great care to “join-the-dots”–meaning to connect TW Tiddlers to sources they are derived from.

The point? I like the idea of authoring major posts (once in a blue moon for me) in a TW, posting to Discourse, mutually co-linking. The issue with discussion groups of all types is divorce from what they are talking about. I think it healthy to have in TW instances of as many methods as possible to bridge that gap.

Another point (in process of testing) is I like writing neatly in well formatted layouts (first post only). TBH I’d like to do that writing in an environment I know quite well. So, this point is about using TW’s power to leverage nice layout without having to learn the esoterics of another layout system.

There is more. But I think those points are enough for a start? Anyway the pudding will be in the eating (later)! :smiley:

Best wishes
TT

Two very good points. Consider me 50% convinced.

:nerd_face:

1 Like

Some related ideas,

  • I recall at some point pasting html into Discourse and having it render nicely, since tiddlywiki can generate html this may be an avenue.
  • I paste GG or Discourse links into my own tiddlers in a field called discussion and have a view template that shows a link to “discussion” if one exists.

Right! At this moment I am testing TW WikiText, Markdown & HTML for direct posting. So far HTML looks the most reliable. What I’m thinking is to write in our normal WikiText but have a post button that auto-converts to HTML on post to Discourse.

Thoughts
TT

2 Likes