Hello all! Turns out moodle (university course-materials platform) exports json. Hooray! (Probably other courseware can do the same.) What I know about json, however, is limited to what I’ve learned through TW tinkering.
Small nuisance: the json that moodle exports needs to be massaged in 2 ways:
(1) it has no title field, so I need a find-and-replace on the json to turn “message:” into “title:”
(2) it has lots of numeric fields that lack the quote marks for text strings. And in my experience so far, the TW import process just ignores fields that fail to include quote-marks around the value. So I need to fire up some editing tool to go in there and do a regular-expression search-and-replace, or something like that, to ensure that numeric field values get quote marks around them.
It’s not a big deal in theory. But I envision a workflow where I’m grabbing these moodle-exported json files and dragging them into my tiddlywiki pretty regularly.
So, my questions are:
(a) Is there any chance the import process could recognize that an incoming JSON lacks title fields for its records, and could then offer to pull from a different specified field (like “subject” or “message” or “name”, as user specifies) to populate TW’s title field?
(b) Is there any reason tiddlywiki couldn’t be tweaked to accept unquoted numeric values as if they arrived within quote marks?
(c) If the above tweaks are unrealistic: Is there any simple tool y’all know of that can transform something like a json document, given particular find-and-replace rules, so that I don’t have to open the json and peck around each time? (I’m working on a mac desktop, and can get 80% of what I need with TCleaner Pro, but it still requires opening the file and a couple commands each time.)
[For completeness’ sake: moodle’s json output also has an extra bracket at beginning and end [[{ ... }]]
that seems to break the import process. Easy as heck to remove, but tedious when there’s many of them.]
Many thanks!
-Springer