Merge branch 'detach-recovery', integrating tiddler exporter changes.
This commit is contained in:
commit
7ba4c88e20
@ -247,6 +247,16 @@ TiddlyWiki >> exportJSONFromRebuildedCommonTiddlers [
|
|||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
{ #category : #accessing }
|
||||||
|
TiddlyWiki >> exportJSONFromTiddlersInSubfolder: subfolder [
|
||||||
|
|
||||||
|
| rebuildedTiddlersJSON dateNowString |
|
||||||
|
dateNowString := (DateAndTime now asLocalStringYMDHM copyReplaceAll: ':' with: '-') copyReplaceAll: ' ' with: '-'.
|
||||||
|
rebuildedTiddlersJSON := '[', (',' join: ((self rebuildTiddlersFromSubfolder: subfolder) collect: [ :each | each asJsonString ])), ']'.
|
||||||
|
^ MarkupFile exportAsFileOn: subfolder / 'rebuildedTiddlers', dateNowString, 'json' containing: rebuildedTiddlersJSON
|
||||||
|
|
||||||
|
]
|
||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
TiddlyWiki >> exportJSONSubtiddlers: subtiddlersCollection [
|
TiddlyWiki >> exportJSONSubtiddlers: subtiddlersCollection [
|
||||||
|
|
||||||
@ -259,6 +269,23 @@ TiddlyWiki >> exportJSONSubtiddlers: subtiddlersCollection as: aName [
|
|||||||
^ MarkupFile exportAsFileOn: self file parent / aName, 'json' containing: (self jsonSubtiddlers: subtiddlersCollection)
|
^ MarkupFile exportAsFileOn: self file parent / aName, 'json' containing: (self jsonSubtiddlers: subtiddlersCollection)
|
||||||
]
|
]
|
||||||
|
|
||||||
|
{ #category : #accessing }
|
||||||
|
TiddlyWiki >> exportJSONTiddlersTagged: aTag in: aFolder [
|
||||||
|
|
||||||
|
| dateNowString |
|
||||||
|
dateNowString := (DateAndTime now asLocalStringYMDHM copyReplaceAll: ':' with: '-') copyReplaceAll: ' ' with: '-'.
|
||||||
|
self exportJSONTiddlersTagged: aTag in: aFolder named: (self name, '-', aTag, '-', dateNowString)
|
||||||
|
]
|
||||||
|
|
||||||
|
{ #category : #accessing }
|
||||||
|
TiddlyWiki >> exportJSONTiddlersTagged: aTag in: aFolder named: aFileName [
|
||||||
|
|
||||||
|
| taggedTiddlers jsonString |
|
||||||
|
taggedTiddlers := self taggedWith: aTag.
|
||||||
|
jsonString := '[', (',' join: (taggedTiddlers collect: [ :each | each asJsonString ])), ']'.
|
||||||
|
^ MarkupFile exportAsFileOn: aFolder / (aFileName, '.json') containing: jsonString
|
||||||
|
]
|
||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
TiddlyWiki >> exportJSTiddlers [
|
TiddlyWiki >> exportJSTiddlers [
|
||||||
|
|
||||||
@ -403,6 +430,7 @@ TiddlyWiki >> importJSONLink [
|
|||||||
| tiddlersJson |
|
| tiddlersJson |
|
||||||
tiddlersJson := (self remote asString, '/tiddlers.json') asUrl retrieveContents.
|
tiddlersJson := (self remote asString, '/tiddlers.json') asUrl retrieveContents.
|
||||||
jsonFile := self folder / 'tiddlers.json'.
|
jsonFile := self folder / 'tiddlers.json'.
|
||||||
|
self name; file.
|
||||||
MarkupFile exportAsFileOn: jsonFile containing: tiddlersJson.
|
MarkupFile exportAsFileOn: jsonFile containing: tiddlersJson.
|
||||||
^ self fromString: tiddlersJson
|
^ self fromString: tiddlersJson
|
||||||
]
|
]
|
||||||
@ -568,6 +596,21 @@ TiddlyWiki >> rebuildTiddlers [
|
|||||||
^ stonTiddlers
|
^ stonTiddlers
|
||||||
]
|
]
|
||||||
|
|
||||||
|
{ #category : #accessing }
|
||||||
|
TiddlyWiki >> rebuildTiddlersFromSubfolder: subfolder [
|
||||||
|
|
||||||
|
| stonTiddlers contentTiddlersFiles |
|
||||||
|
contentTiddlersFiles := subfolder children
|
||||||
|
select: [ :each | each basename endsWith: 'ston' ].
|
||||||
|
|
||||||
|
stonTiddlers := OrderedCollection new.
|
||||||
|
stonTiddlers
|
||||||
|
addAll: (contentTiddlersFiles
|
||||||
|
collect:[ :each | STONJSON fromString: each contents ]).
|
||||||
|
stonTiddlers collect: [ :tiddler | tiddler wiki: self ].
|
||||||
|
^ stonTiddlers
|
||||||
|
]
|
||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
TiddlyWiki >> rebuildTiddlersJSON [
|
TiddlyWiki >> rebuildTiddlersJSON [
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user