Adding configuration file.
This commit is contained in:
parent
d8f4888aa7
commit
0d0f17bdb7
@ -16,6 +16,30 @@ Class {
|
||||
#category : 'TiddlyWiki-Model'
|
||||
}
|
||||
|
||||
{ #category : 'accessing' }
|
||||
TiddlyWiki >> addToConfigFile [
|
||||
| configDict cleaned |
|
||||
configDict := STONJSON fromString: self configFile contents.
|
||||
cleaned := self copy.
|
||||
cleaned tiddlers: nil.
|
||||
configDict
|
||||
at: cleaned name put: cleaned;
|
||||
yourself.
|
||||
MarkupFile exportAsFileOn: self configFile containing:(STON toStringPretty: configDict)
|
||||
]
|
||||
|
||||
{ #category : 'accessing' }
|
||||
TiddlyWiki >> configFile [
|
||||
| tempFile |
|
||||
tempFile := FileLocator home / '.config' / 'TiddlyWikiPharo' / 'tiddlywiki.conf.ston'.
|
||||
tempFile ensureCreateFile.
|
||||
tempFile contents isEmpty ifTrue: [
|
||||
MarkupFile exportAsFileOn: tempFile containing: ( STON toStringPretty: Dictionary new)
|
||||
].
|
||||
^ tempFile
|
||||
|
||||
]
|
||||
|
||||
{ #category : 'accessing' }
|
||||
TiddlyWiki >> exportSTONFile [
|
||||
| stonFile output |
|
||||
|
Loading…
Reference in New Issue
Block a user