71 lines
1.2 KiB
Smalltalk
71 lines
1.2 KiB
Smalltalk
|
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 [
|
||
|
|
||
|
| url file |
|
||
|
url := self list first demo.
|
||
|
file := (folder / shortName / 'index.html') asFileReference.
|
||
|
url asUrl saveContentsToFile: file.
|
||
|
^ file asFileReference
|
||
|
]
|
||
|
|
||
|
{ #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
|
||
|
]
|