Fixing tiddler exporter to JSON and creating a rebuilded common tiddlers exporter for JSON format.

This commit is contained in:
ruidajo 2022-09-26 18:04:24 -05:00
parent 8627e2629e
commit 2262ebaec2
2 changed files with 15 additions and 2 deletions

View File

@ -167,8 +167,10 @@ Tiddler >> deleteUid [
{ #category : #accessing }
Tiddler >> exportJSONFile [
| jsonFile |
jsonFile := self wiki folder / 'tiddlers' / (self title asDashedLowercase,'.', self created asString, '.json').
| jsonFile folder |
folder := self wiki folder.
jsonFile := folder / 'tiddlers' / ((self fileName removeSuffix: '.ston'), '.json').
^ MarkupFile exportAsFileOn: jsonFile containing:self asJson
]

View File

@ -215,6 +215,16 @@ TiddlyWiki >> exportJSONFileOptimized [
runAndWaitOnExitDo: [ :process :outString | ^ self jsonFile ]
]
{ #category : #accessing }
TiddlyWiki >> exportJSONFromRebuildedCommonTiddlers [
| rebuildedTiddlersJSON dateNowString |
dateNowString := (DateAndTime now asLocalStringYMDHM copyReplaceAll: ':' with: '-') copyReplaceAll: ' ' with: '-'.
rebuildedTiddlersJSON := '[', (',' join: (self rebuildTiddlersWithoutLargeTiddlers collect: [ :each | each asJsonString ])), ']'.
^ MarkupFile exportAsFileOn: self folder / 'rebuildedCommonTiddlers', dateNowString, 'json' containing: rebuildedTiddlersJSON
]
{ #category : #accessing }
TiddlyWiki >> exportJSONSubtiddlers: subtiddlersCollection [
@ -534,6 +544,7 @@ TiddlyWiki >> rebuildTiddlersWithoutLargeTiddlers [
stonTiddlers
addAll: (contentTiddlersFiles
collect:[ :each | STONJSON fromString: each contents ]).
stonTiddlers collect: [ :tiddler | tiddler wiki: self ].
^ stonTiddlers
]