2022-01-21 22:10:56 +00:00
|
|
|
Class {
|
|
|
|
#name : #TWSeed,
|
|
|
|
#superclass : #Object,
|
|
|
|
#instVars : [
|
|
|
|
'name',
|
|
|
|
'demo'
|
|
|
|
],
|
|
|
|
#classVars : [
|
|
|
|
'list'
|
|
|
|
],
|
|
|
|
#category : #'TiddlyWiki-Model'
|
|
|
|
}
|
|
|
|
|
|
|
|
{ #category : #accessing }
|
|
|
|
TWSeed class >> initialize [
|
|
|
|
|
|
|
|
super initialize.
|
|
|
|
"self name: (self class list at: #Wikilexias) asFileReference basenameWithoutExtension.
|
|
|
|
self preview: (self class list at: #Wikilexias) contents."
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
{ #category : #accessing }
|
|
|
|
TWSeed class >> installDefaultInto: folder as: shortName [
|
|
|
|
|
2022-01-21 22:21:52 +00:00
|
|
|
| url subfolder |
|
2022-01-21 22:10:56 +00:00
|
|
|
url := self list first demo.
|
2022-01-21 22:21:52 +00:00
|
|
|
subfolder := (folder / shortName) ensureCreateDirectory.
|
|
|
|
^ url asUrl saveContentsToFile: subfolder / 'index.html'.
|
2022-01-21 22:10:56 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
{ #category : #accessing }
|
|
|
|
TWSeed class >> list [
|
|
|
|
|
|
|
|
| l |
|
|
|
|
l := OrderedCollection new.
|
|
|
|
l add: (self new
|
|
|
|
name: 'Projectify';
|
|
|
|
demo: 'https://mutabit.com/repos.fossil/tiddlywiki/uv/seeds/projectify/projectify-mod.html').
|
|
|
|
^ l
|
|
|
|
]
|
|
|
|
|
|
|
|
{ #category : #accessing }
|
|
|
|
TWSeed >> demo [
|
|
|
|
|
|
|
|
^ demo
|
|
|
|
]
|
|
|
|
|
|
|
|
{ #category : #accessing }
|
|
|
|
TWSeed >> demo: anUrl [
|
|
|
|
|
|
|
|
demo := anUrl asZnUrl
|
|
|
|
]
|
|
|
|
|
|
|
|
{ #category : #accessing }
|
|
|
|
TWSeed >> name [
|
|
|
|
^ name
|
|
|
|
]
|
|
|
|
|
|
|
|
{ #category : #accessing }
|
|
|
|
TWSeed >> name: aString [
|
|
|
|
name := aString
|
|
|
|
]
|
|
|
|
|
|
|
|
{ #category : #accessing }
|
|
|
|
TWSeed >> preview: anObject [
|
|
|
|
|
|
|
|
^ demo := anObject
|
|
|
|
]
|