Modelling configuration options.
This commit is contained in:
parent
9c7e1c5291
commit
78cf027f39
@ -14,7 +14,8 @@ Class {
|
|||||||
'jsonFile',
|
'jsonFile',
|
||||||
'tiddlers',
|
'tiddlers',
|
||||||
'folder',
|
'folder',
|
||||||
'template'
|
'template',
|
||||||
|
'config'
|
||||||
],
|
],
|
||||||
#category : #'TiddlyWiki-Model'
|
#category : #'TiddlyWiki-Model'
|
||||||
}
|
}
|
||||||
@ -101,9 +102,9 @@ TiddlyWiki >> addToConfigFile [
|
|||||||
cleaned := self copy.
|
cleaned := self copy.
|
||||||
cleaned tiddlers: nil.
|
cleaned tiddlers: nil.
|
||||||
newConfig := self configDictionary
|
newConfig := self configDictionary
|
||||||
at: cleaned name put: cleaned;
|
at: cleaned name put: cleaned;
|
||||||
yourself.
|
yourself.
|
||||||
^ MarkupFile exportAsFileOn: self configFile containing:(STON toStringPretty: newConfig)
|
^ self exportToConfigFile: newConfig
|
||||||
]
|
]
|
||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
@ -163,6 +164,11 @@ TiddlyWiki >> commonTiddlers [
|
|||||||
^ content.
|
^ content.
|
||||||
]
|
]
|
||||||
|
|
||||||
|
{ #category : #accessing }
|
||||||
|
TiddlyWiki >> config [
|
||||||
|
^ config ifNil: [ config := Dictionary new]
|
||||||
|
]
|
||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
TiddlyWiki >> configDictionary [
|
TiddlyWiki >> configDictionary [
|
||||||
^ STONJSON fromString: self configFile contents.
|
^ STONJSON fromString: self configFile contents.
|
||||||
@ -375,6 +381,13 @@ TiddlyWiki >> exportTW5Tiddlers [
|
|||||||
^ notShadowTiddlers do: [ :each | each exportSTONFileInto: 'tiddlers' ]
|
^ notShadowTiddlers do: [ :each | each exportSTONFileInto: 'tiddlers' ]
|
||||||
]
|
]
|
||||||
|
|
||||||
|
{ #category : #accessing }
|
||||||
|
TiddlyWiki >> exportToConfigFile: newConfig [
|
||||||
|
^ MarkupFile
|
||||||
|
exportAsFileOn: self configFile
|
||||||
|
containing: (STON toStringPretty: newConfig)
|
||||||
|
]
|
||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
TiddlyWiki >> file [
|
TiddlyWiki >> file [
|
||||||
|
|
||||||
@ -618,7 +631,7 @@ TiddlyWiki >> networkViewBackground [
|
|||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
TiddlyWiki >> networkViewBackground: aColor [
|
TiddlyWiki >> networkViewBackground: aColor [
|
||||||
self configDictionary at: 'networkView' at: 'background' put: aColor
|
self config at: 'networkView' at: 'background' put: aColor.
|
||||||
]
|
]
|
||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
|
Loading…
Reference in New Issue
Block a user