Improving tiddlers exportation.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2024-07-01 20:42:59 -05:00
parent c7fca28305
commit 46565aa522
2 changed files with 29 additions and 2 deletions

View File

@ -214,7 +214,10 @@ Tiddler >> exportSTONFile [
{ #category : #accessing }
Tiddler >> exportSTONFileInto: subfolder [
| stonFile |
| stonFile tiddlersSubfolder |
tiddlersSubfolder := self wiki folder / subfolder.
tiddlersSubfolder exists
ifFalse: [ tiddlersSubfolder ensureCreateDirectory ].
stonFile := self wiki folder / subfolder / self fileName.
^ MarkupFile exportAsFileOn: stonFile containing: self asStonStringPretty
]
@ -537,6 +540,16 @@ Tiddler >> tagsAsString [
^ response contents
]
{ #category : #accessing }
Tiddler >> tagsReformating [
| response |
self tags class ~= ByteString ifTrue: [ ^ self ].
response := Set new.
response add: self tags.
self tags: response.
]
{ #category : #accessing }
Tiddler >> text [

View File

@ -493,6 +493,18 @@ TiddlyWiki >> importJSONLink [
^ self fromString: self remoteTiddlersContentsString
]
{ #category : #accessing }
TiddlyWiki >> importSTONFilesFrom: aFolder [
| tiddlerFiles |
self folder: aFolder parent.
tiddlerFiles := aFolder children
select: [ :localFile | localFile basename endsWith: '.ston' ].
self tiddlers: (tiddlerFiles collect: [ :each | | tempTiddler|
tempTiddler := STON fromString: each contents.
tempTiddler wiki: self.
tempTiddler])
]
{ #category : #accessing }
TiddlyWiki >> installJsonExporter [
@ -718,9 +730,11 @@ TiddlyWiki >> oldestCreatedTiddler [
{ #category : #accessing }
TiddlyWiki >> printOn: aStream [
| printName |
printName := self name ifNil: ['unamed'].
super printOn: aStream.
aStream
nextPutAll: '( ', self name ,' )'
nextPutAll: '( ', printName ,' )'
]
{ #category : #accessing }