2022-01-21 22:10:56 +00:00
|
|
|
Class {
|
|
|
|
#name : #TWSeed,
|
|
|
|
#superclass : #Object,
|
|
|
|
#instVars : [
|
|
|
|
'name',
|
|
|
|
'demo'
|
|
|
|
],
|
|
|
|
#classVars : [
|
|
|
|
'list'
|
|
|
|
],
|
|
|
|
#category : #'TiddlyWiki-Model'
|
|
|
|
}
|
|
|
|
|
2022-01-22 00:29:55 +00:00
|
|
|
{ #category : #accessing }
|
|
|
|
TWSeed class >> default [
|
|
|
|
|
|
|
|
^ (self list select: [ :seed | seed name = 'ProjectifyMod' ]) first
|
|
|
|
]
|
|
|
|
|
|
|
|
{ #category : #accessing }
|
|
|
|
TWSeed class >> deleteWikiFileFromFolder: folder andSubfolder: shortName [
|
|
|
|
|
|
|
|
| file |
|
|
|
|
file := folder / shortName / 'index.html'.
|
|
|
|
file exists ifFalse: [^ self].
|
|
|
|
^ file ensureDelete.
|
|
|
|
]
|
|
|
|
|
2022-01-21 22:10:56 +00:00
|
|
|
{ #category : #accessing }
|
|
|
|
TWSeed class >> initialize [
|
|
|
|
|
|
|
|
super initialize.
|
2022-01-22 00:29:55 +00:00
|
|
|
list := OrderedCollection new.
|
|
|
|
list
|
|
|
|
add: (self new
|
|
|
|
name: 'ProjectifyMod';
|
|
|
|
demo: 'https://mutabit.com/repos.fossil/tiddlywiki/uv/seeds/projectify/projectify-mod.html');
|
|
|
|
add: (self new
|
|
|
|
name: 'Wikilexias';
|
|
|
|
demo: '');
|
|
|
|
add: (self new
|
|
|
|
name: 'NotebookMod';
|
|
|
|
demo: '');
|
|
|
|
add: (self new
|
|
|
|
name: 'Grafoscopedia';
|
|
|
|
demo: '');
|
|
|
|
add: (self new
|
|
|
|
name: 'Holonica';
|
|
|
|
demo: '').
|
|
|
|
^ self
|
2022-01-21 22:10:56 +00:00
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
{ #category : #accessing }
|
|
|
|
TWSeed class >> installDefaultInto: folder as: shortName [
|
|
|
|
|
2022-01-22 00:29:55 +00:00
|
|
|
| url subfolder file |
|
|
|
|
url := self default demo.
|
|
|
|
subfolder := (folder / shortName) ensureCreateDirectory.
|
|
|
|
file := subfolder / 'index.html'.
|
|
|
|
file exists
|
|
|
|
ifTrue: [ self inform: 'Index file in the wiki subfolder already exists. Please choose:
|
|
|
|
1 select another folder + shortName combination or
|
|
|
|
2 run:
|
|
|
|
self deleteWikiFileFromFolder: folder andSubfolder: shortName.'.
|
|
|
|
^ self
|
|
|
|
].
|
|
|
|
^ url asUrl saveContentsToFile: file.
|
2022-01-21 22:10:56 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
{ #category : #accessing }
|
|
|
|
TWSeed class >> list [
|
|
|
|
|
2022-01-22 00:29:55 +00:00
|
|
|
^ list
|
|
|
|
ifNil: [ self initialize.
|
|
|
|
^ self list.
|
|
|
|
]
|
|
|
|
|
2022-01-21 22:10:56 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
{ #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
|
|
|
|
]
|