It is common for people to export tiddlers in json format and attach them to their forum posts here on TW Talk. This makes it easy for others to try. Just these steps are required:
- Download the json
- Vist tiddlywiki.com
- Drag the downloaded json onto tiddlywiki.com
I have some bookmarklet code which makes the process (arguably) simpler. If you have the bookmarklet installed in your bookmarks bar, then the steps become:
- Click the bookmarklet. A link titled “open in share” site will appear next to every download attachment link on the page.
- Click the “open in share site” and the tiddlers will be opened at https://tiddlywiki.com/prerelease/share
Here’s what a download link might look like before clicking the bookmarklet:
Here’s what it looks like after clicking the bookmarklet:
I tried sharing the bookmarklet link directly here, but discourse was not rendering it correctly (either some mistake my part or maybe for security discourse doesn’t allow javascript links). Instead, you can get the bookmarklet from this share site link
See his thread for more info on the share plugin: Revived share plugin
Here are some sample threads which contain tiddler json downloads where you can test the bookmarklet:
- Is there any way to read the titles from `$:/HistoryList` without resorting to arcane regexp in a filter? - #15 by Yaisog
- Help please explaining/using the message catcher Widget - #4 by TW_Tones
- Accordion macro: showcase, discussion, and questions
- Displaying the caption instead of title in TW 5.2.1 using the new cascade filters
Here is the javascript contained in the bookmarklet:
// Find all links with class 'attachment'
const links = document.querySelectorAll('a.attachment');
// Loop through each link
links.forEach(link => {
// Check if the href ends in .json
if (link.getAttribute('href').endsWith('.json')) {
// Use fetch to get the JSON data
fetch(link.getAttribute('href'))
.then(response => response.json())
.then(jsonData => {
// Create the new link
const newLink = document.createElement('a');
newLink.href = `https://tiddlywiki.com/prerelease/share##${encodeURIComponent(JSON.stringify(jsonData))}`;
newLink.textContent = 'open in tw share site';
// Create the separator
const separator = document.createTextNode(' | ');
// Add the new link and separator as siblings of the original link
link.parentNode.insertBefore(newLink, link.nextSibling);
link.parentNode.insertBefore(separator, newLink);
})
.catch(error => {
// Create an error message
const errorMessage = document.createElement('span');
errorMessage.style.color = 'red';
errorMessage.textContent = `Error fetching ${link.getAttribute('href')}: ${error}`;
// Add the error message as a sibling of the original link
link.parentNode.insertBefore(errorMessage, link.nextSibling);
});
}
});
Off-topic for here, but I didn’t write or modify a single line of that code. ChatGPT generated it all based on instructions from me. I’m very impressed.