Improving name consistency and formats exportation.
This commit is contained in:
parent
28d0e1eb20
commit
847d1f7bc4
@ -34,7 +34,8 @@ Tiddler class >> nowLocal [
|
||||
|
||||
{ #category : 'accessing' }
|
||||
Tiddler >> asDictionary [
|
||||
^ Dictionary new
|
||||
| response |
|
||||
response := Dictionary new
|
||||
at: 'title' put: self title;
|
||||
at: 'text' put: self text;
|
||||
at: 'created' put: self created asString;
|
||||
@ -45,15 +46,13 @@ Tiddler >> asDictionary [
|
||||
at: 'modified' put: self modified;
|
||||
at: 'bag' put: self bag;
|
||||
at: 'revision' put: self revision;
|
||||
at: 'customFields' put: self customFields;
|
||||
yourself.
|
||||
]
|
||||
|
||||
{ #category : 'accessing' }
|
||||
Tiddler >> asJSONFile [
|
||||
| jsonFile |
|
||||
jsonFile := self wiki file parent / 'tiddlers' / (self title asLowercase, '.json').
|
||||
^ MarkupFile exportAsFileOn: jsonFile containing:self asJson
|
||||
self customFields ifNotEmpty: [
|
||||
self customFields keysAndValuesDo: [:k :v |
|
||||
response at: k put: v
|
||||
]
|
||||
].
|
||||
^ response
|
||||
]
|
||||
|
||||
{ #category : 'converting' }
|
||||
@ -137,6 +136,13 @@ Tiddler >> customFields [
|
||||
^ customFields ifNil: [ customFields := Dictionary new]
|
||||
]
|
||||
|
||||
{ #category : 'accessing' }
|
||||
Tiddler >> exportJSONFile [
|
||||
| jsonFile |
|
||||
jsonFile := self wiki file parent / 'tiddlers' / (self title asDashedLowercase, self created asString, '.json').
|
||||
^ MarkupFile exportAsFileOn: jsonFile containing:self asJson
|
||||
]
|
||||
|
||||
{ #category : 'accessing' }
|
||||
Tiddler >> exportSTONFile [
|
||||
| stonFile output |
|
||||
|
Loading…
Reference in New Issue
Block a user