STON exportation excludes binary images now, to keep the output diff friendly.
This commit is contained in:
parent
fecbd57f16
commit
fd89e60de8
@ -13,7 +13,7 @@ Class {
|
||||
'remote',
|
||||
'name'
|
||||
],
|
||||
#category : 'TiddlyWiki-Model'
|
||||
#category : #'TiddlyWiki-Model'
|
||||
}
|
||||
|
||||
{ #category : #accessing }
|
||||
@ -51,14 +51,14 @@ TiddlyWiki >> exportJSONSubtiddlers: subtiddlersCollection [
|
||||
|
||||
{ #category : #accessing }
|
||||
TiddlyWiki >> exportSTONFile [
|
||||
| stonFile output |
|
||||
| stonFile output wikiTemp |
|
||||
stonFile := self tiddlersJSONFile withoutExtension, 'ston'.
|
||||
output := '' writeStream.
|
||||
(STON writer on: output )
|
||||
newLine: String lf;
|
||||
prettyPrint: true;
|
||||
keepNewLines: true;
|
||||
nextPut: self.
|
||||
nextPut: self withoutImages.
|
||||
^ MarkupFile exportAsFileOn: stonFile containing:output contents
|
||||
]
|
||||
|
||||
@ -195,3 +195,13 @@ TiddlyWiki >> tiddlersJSONFile [
|
||||
].
|
||||
^ jsonFile
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
TiddlyWiki >> withoutImages [
|
||||
| filteredTiddlers tempWiki |
|
||||
filteredTiddlers := self tiddlers reject: [:tiddler | tiddler type isNotNil and: [tiddler type beginsWith: 'image/'] ].
|
||||
tempWiki := self copy
|
||||
tiddlers: filteredTiddlers.
|
||||
tempWiki tiddlers do: [:tiddler | tiddler wiki: tempWiki ].
|
||||
^ tempWiki
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user