Renaming to improve consistency and not revealing implementation details in message names. Improving messages to the user.
This commit is contained in:
parent
847d1f7bc4
commit
b8b4c6863e
@ -139,14 +139,14 @@ Tiddler >> customFields [
|
|||||||
{ #category : 'accessing' }
|
{ #category : 'accessing' }
|
||||||
Tiddler >> exportJSONFile [
|
Tiddler >> exportJSONFile [
|
||||||
| jsonFile |
|
| jsonFile |
|
||||||
jsonFile := self wiki file parent / 'tiddlers' / (self title asDashedLowercase, self created asString, '.json').
|
jsonFile := self wiki file parent / 'tiddlers' / (self title asDashedLowercase,'.', self created asString, '.json').
|
||||||
^ MarkupFile exportAsFileOn: jsonFile containing:self asJson
|
^ MarkupFile exportAsFileOn: jsonFile containing:self asJson
|
||||||
]
|
]
|
||||||
|
|
||||||
{ #category : 'accessing' }
|
{ #category : 'accessing' }
|
||||||
Tiddler >> exportSTONFile [
|
Tiddler >> exportSTONFile [
|
||||||
| stonFile output |
|
| stonFile output |
|
||||||
stonFile := self wiki file parent / 'tiddlers' / (self title asLowercase, '.ston') .
|
stonFile := self wiki file parent / 'tiddlers' / (self title asDashedLowercase, '.', self created asString, '.ston') .
|
||||||
^ MarkupFile exportAsFileOn: stonFile containing: self asStonStringPretty
|
^ MarkupFile exportAsFileOn: stonFile containing: self asStonStringPretty
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ Class {
|
|||||||
}
|
}
|
||||||
|
|
||||||
{ #category : 'accessing' }
|
{ #category : 'accessing' }
|
||||||
TiddlyWiki >> exportSTONTiddlersFile [
|
TiddlyWiki >> exportSTONFile [
|
||||||
| stonFile output |
|
| stonFile output |
|
||||||
stonFile := self tiddlersJSONFile withoutExtension, 'ston'.
|
stonFile := self tiddlersJSONFile withoutExtension, 'ston'.
|
||||||
output := '' writeStream.
|
output := '' writeStream.
|
||||||
@ -38,7 +38,11 @@ TiddlyWiki >> file: anObject [
|
|||||||
]
|
]
|
||||||
|
|
||||||
{ #category : 'accessing' }
|
{ #category : 'accessing' }
|
||||||
TiddlyWiki >> importJSONTiddlersFile [
|
TiddlyWiki >> importJSONFile [
|
||||||
|
"I import a JSON representation of my tiddlers data, that has been previosly exported
|
||||||
|
by the TiddlyWiki HTML self contained file.
|
||||||
|
Such file is called, by convention, 'tiddlers.json' and stored in the same folder where
|
||||||
|
the HTML file is located."
|
||||||
| tiddlersDict |
|
| tiddlersDict |
|
||||||
self tiddlersJSONFile ifNil: [ ^ self ].
|
self tiddlersJSONFile ifNil: [ ^ self ].
|
||||||
tiddlersDict := STONJSON fromString: self tiddlersJSONFile contents.
|
tiddlersDict := STONJSON fromString: self tiddlersJSONFile contents.
|
||||||
@ -89,7 +93,15 @@ TiddlyWiki >> tiddlers: anOrderedCollection [
|
|||||||
|
|
||||||
{ #category : 'accessing' }
|
{ #category : 'accessing' }
|
||||||
TiddlyWiki >> tiddlersJSONFile [
|
TiddlyWiki >> tiddlersJSONFile [
|
||||||
file ifNil: [ self inform: 'You need to export tiddlers as JSON from TiddlyWiki'.
|
| jsonFile |
|
||||||
^ nil ].
|
file ifNil: [
|
||||||
^ file parent / 'tiddlers.json'.
|
self inform: 'Provide the location of the TiddlyWiki HTML file.'.
|
||||||
|
^ nil
|
||||||
|
].
|
||||||
|
jsonFile := file parent / 'tiddlers.json'.
|
||||||
|
jsonFile exists ifFalse: [
|
||||||
|
self inform: 'You need to export tiddlers as JSON from TiddlyWiki and locate it in the same folder as the HTML file'.
|
||||||
|
^ nil
|
||||||
|
].
|
||||||
|
^ jsonFile
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user