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