Fixing JSON exportation.
This commit is contained in:
parent
1a198b9380
commit
28d0e1eb20
@ -49,9 +49,16 @@ Tiddler >> asDictionary [
|
||||
yourself.
|
||||
]
|
||||
|
||||
{ #category : 'accessing' }
|
||||
Tiddler >> asJSONFile [
|
||||
| jsonFile |
|
||||
jsonFile := self wiki file parent / 'tiddlers' / (self title asLowercase, '.json').
|
||||
^ MarkupFile exportAsFileOn: jsonFile containing:self asJson
|
||||
]
|
||||
|
||||
{ #category : 'converting' }
|
||||
Tiddler >> asJson [
|
||||
^ STON toStringPretty: { self asDictionary }
|
||||
^ STONJSON toStringPretty: { self asDictionary }
|
||||
]
|
||||
|
||||
{ #category : 'converting' }
|
||||
@ -68,7 +75,7 @@ Tiddler >> asJsonTempFile [
|
||||
{ #category : 'accessing' }
|
||||
Tiddler >> asStonStringPretty [
|
||||
| output temp |
|
||||
temp := self.
|
||||
temp := self copy.
|
||||
temp wiki: nil.
|
||||
output := '' writeStream.
|
||||
(STON writer on: output)
|
||||
@ -130,6 +137,13 @@ Tiddler >> customFields [
|
||||
^ customFields ifNil: [ customFields := Dictionary new]
|
||||
]
|
||||
|
||||
{ #category : 'accessing' }
|
||||
Tiddler >> exportSTONFile [
|
||||
| stonFile output |
|
||||
stonFile := self wiki file parent / 'tiddlers' / (self title asLowercase, '.ston') .
|
||||
^ MarkupFile exportAsFileOn: stonFile containing: self asStonStringPretty
|
||||
]
|
||||
|
||||
{ #category : 'accessing' }
|
||||
Tiddler >> exportWithTemplate: aTemplate [
|
||||
^ aTemplate asMustacheTemplate value: self asDictionary
|
||||
|
Loading…
Reference in New Issue
Block a user