Improving data serialization and making it more diff friendly.
This commit is contained in:
parent
27eb70e928
commit
d7da993cd0
@ -51,7 +51,12 @@ Tiddler >> asDictionary [
|
|||||||
|
|
||||||
{ #category : 'converting' }
|
{ #category : 'converting' }
|
||||||
Tiddler >> asJson [
|
Tiddler >> asJson [
|
||||||
^ STONJSON toStringPretty: self asDictionary
|
^ STON toStringPretty: { self asDictionary }
|
||||||
|
]
|
||||||
|
|
||||||
|
{ #category : 'converting' }
|
||||||
|
Tiddler >> asJsonString [
|
||||||
|
^ STONJSON toStringPretty: self asDictionary
|
||||||
]
|
]
|
||||||
|
|
||||||
{ #category : 'accessing' }
|
{ #category : 'accessing' }
|
||||||
@ -60,6 +65,20 @@ Tiddler >> asJsonTempFile [
|
|||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
{ #category : 'accessing' }
|
||||||
|
Tiddler >> asStonStringPretty [
|
||||||
|
| output temp |
|
||||||
|
temp := self.
|
||||||
|
temp wiki: nil.
|
||||||
|
output := '' writeStream.
|
||||||
|
(STON writer on: output)
|
||||||
|
newLine: String crlf;
|
||||||
|
prettyPrint: true;
|
||||||
|
keepNewLines: true;
|
||||||
|
nextPut: temp.
|
||||||
|
^ output contents
|
||||||
|
]
|
||||||
|
|
||||||
{ #category : 'accessing' }
|
{ #category : 'accessing' }
|
||||||
Tiddler >> bag [
|
Tiddler >> bag [
|
||||||
^ bag
|
^ bag
|
||||||
|
@ -16,9 +16,15 @@ Class {
|
|||||||
|
|
||||||
{ #category : 'accessing' }
|
{ #category : 'accessing' }
|
||||||
TiddlyWiki >> exportSTONTiddlersFile [
|
TiddlyWiki >> exportSTONTiddlersFile [
|
||||||
| stonFile |
|
| stonFile output |
|
||||||
stonFile := self tiddlersJSONFile withoutExtension, 'ston'.
|
stonFile := self tiddlersJSONFile withoutExtension, 'ston'.
|
||||||
^ MarkupFile exportAsFileOn: stonFile containing:(STON toStringPretty: self)
|
output := '' writeStream.
|
||||||
|
(STON writer on: output )
|
||||||
|
newLine: String lf;
|
||||||
|
prettyPrint: true;
|
||||||
|
keepNewLines: true;
|
||||||
|
nextPut: self.
|
||||||
|
^ MarkupFile exportAsFileOn: stonFile containing:self
|
||||||
]
|
]
|
||||||
|
|
||||||
{ #category : 'accessing' }
|
{ #category : 'accessing' }
|
||||||
|
Loading…
Reference in New Issue
Block a user