Creating TWServer and modifying tiddlers by tag JSON exporters.
This commit is contained in:
parent
fadbdf7ec2
commit
a1270d6ca2
41
repository/TiddlyWiki/TWServer.class.st
Normal file
41
repository/TiddlyWiki/TWServer.class.st
Normal file
@ -0,0 +1,41 @@
|
||||
Class {
|
||||
#name : #TWServer,
|
||||
#superclass : #Object,
|
||||
#instVars : [
|
||||
'wikis'
|
||||
],
|
||||
#category : #TiddlyWiki
|
||||
}
|
||||
|
||||
{ #category : #'instance creation' }
|
||||
TWServer class >> new [
|
||||
|
||||
| instance |
|
||||
instance := super new.
|
||||
^ instance
|
||||
wikis: Dictionary new
|
||||
|
||||
]
|
||||
|
||||
{ #category : #'export - json' }
|
||||
TWServer >> exportTiddlersFrom: aWikiName tagged: aTag into: aFolder [
|
||||
|
||||
| wiki |
|
||||
wiki := wikis at: aWikiName.
|
||||
^ wiki exportJSONTiddlersTagged: aTag in: aFolder
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
TWServer >> wikiNames [
|
||||
|
||||
| return |
|
||||
return := OrderedCollection new.
|
||||
wikis keysDo: [ :key | return add: key ].
|
||||
^ return
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
TWServer >> wikis: aTiddlyWikisDictionary [
|
||||
|
||||
wikis := aTiddlyWikisDictionary
|
||||
]
|
@ -269,15 +269,15 @@ TiddlyWiki >> exportJSONSubtiddlers: subtiddlersCollection as: aName [
|
||||
^ MarkupFile exportAsFileOn: self file parent / aName, 'json' containing: (self jsonSubtiddlers: subtiddlersCollection)
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
{ #category : #'export - json' }
|
||||
TiddlyWiki >> exportJSONTiddlersTagged: aTag in: aFolder [
|
||||
|
||||
| dateNowString |
|
||||
dateNowString := (DateAndTime now asLocalStringYMDHM copyReplaceAll: ':' with: '-') copyReplaceAll: ' ' with: '-'.
|
||||
^ self exportJSONTiddlersTagged: aTag in: aFolder named: (self name, '-', aTag, '-', dateNowString)
|
||||
^ self exportJSONTiddlersTagged: aTag in: aFolder named: (self name, '-tagged-', aTag, '-', dateNowString)
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
{ #category : #'export - json' }
|
||||
TiddlyWiki >> exportJSONTiddlersTagged: aTag in: aFolder named: aFileName [
|
||||
|
||||
| taggedTiddlers jsonString |
|
||||
|
Loading…
Reference in New Issue
Block a user