Conversion tools between the various tiddler and JSON formats

A response to this has being started by @pmario here How do TWs JSON Formats Look Like

As discussed here Identify tiddlers installed by bookmarklet we have various forms of tiddler and tiddlers in a single tiddler formats and encoding, even within what we may call a JSON tiddler.

  • We have some templates and widgets that handle some of these formats illustrated below;

I would like to build a resource that documents these and the differences, such that we can document when and where they occur or can be used and the various appropriate widgets and formats that can manipulate them. Some formats;

  • Use encoding, for which there are existing decode operators or widgets
  • Others have particular formats, or different prefixes and suffixes than another format.
  • Some have relevant mime types

Why

  • I think this is all a bit of a mess that can be solved by pooling what we know into a document.
  • Be able to identify the different types visually and programmatically. Also understand which formats are equivalent.
  • We can identify any possible gaps in the tools and formats and the methods to generate, translating or en/decoding them from one to another.
  • With all of us and a broader audience having access to this knowledge I expect more interesting solutions and tools will be forthcoming.

The format a JSON of one or more tiddlers is saved as a file

  • Translated on Import into the format the $Import uses

The Internal storage format

  • As found in wikis and Node tiddlers

Bookmarklet of tiddlers to add

The Tiddler Generated on Import and in plugin contents

  • Which if the plugin-type field is set to plugin, becomes a plugin
  • Thus the individual tiddlers can be accessed as subtiddlers/shadow tiddlers

The JSON array format of tiddlers

  • This format which is a subset of the bookmarklet format can be used with tm-import-tiddler

JSON tiddlers created using index parameter in various widgets

  • The JSON form of a data tiddler

JSON tiddlers created updated using new operators for reading and formatting JSON data

  • The (extended?) JSON form of a data tiddler

Imported JSON tiddlers with unknown structure

  • Adhering to JSON tiddler standards.

Can you add to the above list of formats or provide some description, code or information about one of more of these formats?

  • Please contribute and I will build the resource.
2 Likes

WOW! Excellent.
I am using a solution by @jeremyruston and TW-Scripts and have all essential plugins in a bookmarklet.
So, in my new wiki or those I visit I just inject my settings/plugins in a second.

1 Like

I can tell you the storage format of a tiddler in Json is a json object of fields.

{
  title: "hello"
}
1 Like

Brilliant job! very useful.

I will start a new topic later today for the Bookmarklets tools so please look for that to comment on it going forward, but please contribute to this topic Conversion tools between the various tiddler and JSON formats if at all possible.

  • Below is not only about bookmarklets but the Original Topic OT

I am learning more about the practical use of bookmarklets and with multiple browsers and browser sessions, each with different bookmark libraries, I am discovering, although quick and easy to use, this ease of use means increased complexity and management complexities.

Currently bookmarklets are ideal for

  • Quick use and distribution via temporary bookmarklets
  • Regular use, slow changing bungles of tiddlers plugins

Unfortunately every thing in between the above could result in bookmark pollution and complexity.

As a result of this realisation I can see there would be value in generating a tiddler or bookmarklet that contains not only multiple tiddlers but multiple bookmarklet links in one tiddler, for selective application.

  • One bookmarklet installs a tiddler in Import mode for selective install/reinstall or bookmarklet links to install additional content
  • One bookmarklet tiddler containing multiple bookmarklet links not for installing in bookmarks/favourites but in Wiki.

I can turbo charge these solutions but they cost me a lot more time and effort because of the complexity in JSON tiddlers and formats, raised in the OT. Please help me in this endeavour, small or large contributions welcome.

One contribution to this OT about conversion is a useful tip using the browse widget to import JSON files as they exist on disk without triggering the Import process to “split it into seperate tiddlers”.

<$browse deserializer="text/plain"/>
  • JSON files, and other formats, imported using this button will be imported in raw format.
    • You may want to change the type to text/plain on the imported tiddler as well.
  • This allows one to document, publish and explain the content of the tiddler imported this way.