Debugging initializtion of seeds.
This commit is contained in:
parent
2a966e6e0d
commit
401168ac91
@ -11,33 +11,71 @@ Class {
|
||||
#category : #'TiddlyWiki-Model'
|
||||
}
|
||||
|
||||
{ #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.
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
TWSeed class >> initialize [
|
||||
|
||||
super initialize.
|
||||
"self name: (self class list at: #Wikilexias) asFileReference basenameWithoutExtension.
|
||||
self preview: (self class list at: #Wikilexias) contents."
|
||||
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
|
||||
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
TWSeed class >> installDefaultInto: folder as: shortName [
|
||||
|
||||
| url subfolder |
|
||||
url := self list first demo.
|
||||
subfolder := (folder / shortName) ensureCreateDirectory.
|
||||
^ url asUrl saveContentsToFile: subfolder / 'index.html'.
|
||||
| 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.
|
||||
]
|
||||
|
||||
{ #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
|
||||
^ list
|
||||
ifNil: [ self initialize.
|
||||
^ self list.
|
||||
]
|
||||
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
|
14
repository/TiddlyWiki/TiddlyWikiExamples.class.st
Normal file
14
repository/TiddlyWiki/TiddlyWikiExamples.class.st
Normal file
@ -0,0 +1,14 @@
|
||||
Class {
|
||||
#name : #TiddlyWikiExamples,
|
||||
#superclass : #Object,
|
||||
#category : #'TiddlyWiki-Model'
|
||||
}
|
||||
|
||||
{ #category : #accessing }
|
||||
TiddlyWikiExamples >> createDefaultWiki [
|
||||
<gtExample>
|
||||
<description: 'I create a wiki with the default seed as a temporal file.'>
|
||||
|
||||
TWSeed deleteWikiFileFromFolder: FileLocator temp andSubfolder: 'test'.
|
||||
^ TWSeed installDefaultInto: FileLocator temp as: 'test'
|
||||
]
|
Loading…
Reference in New Issue
Block a user