The macro $:/core/modules/macros/jsontiddlers.js formats tiddlers as JSON its filter parameter relates to the titles of tiddlers to export.
- csvtiddlers also does something similar.
Selective export of fieldnames
I am wondering about extending this macro jsontiddlers and that for csvtiddlers to allow selective export of fieldnames, perhaps a field filter that may include +fieldname and -fieldname so we can selectivly export fields. For example we may want to export only a list of titles and their color field.
- I will also look at a non-destructive import that would apply the color to tiddlers without a color field and optionaly create missing tiddlers. This would allow the import of selective fieldname exports.
Export to tiddler not only download file
At the same time I see value in the export of tiddlers to a file (with or without selective fields being chosen) written to a tiddler / tiddlers text field. ie JSON tiddlers saved in a tiddler called tiddlers.json because one can often bypass the download and upload step and just drag and drop such a tiddler to the target tiddler.
- permitting this would allow one to export tiddlers to a tiddler for archive or even conversion to a plugin, all in wiki and no file handling needed.
As it stands the jsontiddlers.js and csvtiddlers.js macros internaly handle the fieldnames exported (all), and will need modification if the Export to tiddler not only download file is going to do the same.
- I will handle that in a different topic along with a modified import option.
- That is look at where to make changes for export to also save to a tiddler.
Your opinion or support
Can you assist in identifying how to allow selective field exports by modifying jsontiddlers.js and csvtiddlers.js to accept a fieldname filter (a named variable) similar to exportFilter.
- Or shall I take the approach of an export template like $:/core/templates/plain-text-tiddler
I can explain the why if asked, but I suspect you may see the value.