Modelling configuration options.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2024-05-30 12:44:20 -05:00
parent 9c7e1c5291
commit 78cf027f39
18 changed files with 2208 additions and 2195 deletions

View File

@ -14,7 +14,8 @@ Class {
'jsonFile',
'tiddlers',
'folder',
'template'
'template',
'config'
],
#category : #'TiddlyWiki-Model'
}
@ -103,7 +104,7 @@ TiddlyWiki >> addToConfigFile [
newConfig := self configDictionary
at: cleaned name put: cleaned;
yourself.
^ MarkupFile exportAsFileOn: self configFile containing:(STON toStringPretty: newConfig)
^ self exportToConfigFile: newConfig
]
{ #category : #accessing }
@ -163,6 +164,11 @@ TiddlyWiki >> commonTiddlers [
^ content.
]
{ #category : #accessing }
TiddlyWiki >> config [
^ config ifNil: [ config := Dictionary new]
]
{ #category : #accessing }
TiddlyWiki >> configDictionary [
^ STONJSON fromString: self configFile contents.
@ -375,6 +381,13 @@ TiddlyWiki >> exportTW5Tiddlers [
^ notShadowTiddlers do: [ :each | each exportSTONFileInto: 'tiddlers' ]
]
{ #category : #accessing }
TiddlyWiki >> exportToConfigFile: newConfig [
^ MarkupFile
exportAsFileOn: self configFile
containing: (STON toStringPretty: newConfig)
]
{ #category : #accessing }
TiddlyWiki >> file [
@ -618,7 +631,7 @@ TiddlyWiki >> networkViewBackground [
{ #category : #accessing }
TiddlyWiki >> networkViewBackground: aColor [
self configDictionary at: 'networkView' at: 'background' put: aColor
self config at: 'networkView' at: 'background' put: aColor.
]
{ #category : #accessing }