Using external improved exporters.
This commit is contained in:
parent
e05a216b52
commit
4b49160bb1
@ -157,18 +157,39 @@ Tiddler >> exportSTONFile [
|
||||
{ #category : #accessing }
|
||||
Tiddler >> exportSTONFileInto: subfolder [
|
||||
|
||||
| stonFile output dashedTitle sanitized |
|
||||
dashedTitle := '-' join: (self title substrings collect: [ :each | each ]).
|
||||
sanitized := dashedTitle copyWithoutAll: #($¿ $? $! $¡ $/).
|
||||
stonFile := self wiki file parent / subfolder / (sanitized, '--', (self uid copyFrom: 1 to: 5), '.ston').
|
||||
| stonFile |
|
||||
stonFile := self wiki file parent / subfolder / self fileName.
|
||||
^ MarkupFile exportAsFileOn: stonFile containing: self asStonStringPretty
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
Tiddler >> exportSTONFileOptimized [
|
||||
|
||||
| exporter wikiFolder |
|
||||
wikiFolder := self wiki file parent.
|
||||
exporter := wikiFolder / 'scripts' / 'stringAsFileInto'.
|
||||
exporter exists ifFalse: [ self installTiddlerExporter ].
|
||||
|
||||
OSSUnixSubprocess new
|
||||
command: exporter fullName;
|
||||
arguments: { self asStonStringPretty . self fileName };
|
||||
workingDirectory: exporter parent fullName;
|
||||
runAndWaitOnExitDo: [ :process :outString | ^ wikiFolder / 'scripts' / self fileName ]
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
Tiddler >> exportWithTemplate: aTemplate [
|
||||
^ aTemplate asMustacheTemplate value: self asDictionary
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
Tiddler >> fileName [
|
||||
| dashedTitle sanitized |
|
||||
dashedTitle := '-' join: (self title substrings collect: [ :each | each ]).
|
||||
sanitized := dashedTitle copyWithoutAll: #($¿ $? $! $¡ $/).
|
||||
^ sanitized , '--', (self uid copyFrom: 1 to: 5), '.ston'.
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
Tiddler >> fromDictionary: aDictionary [
|
||||
| customKeys |
|
||||
@ -227,6 +248,10 @@ Tiddler >> importFedWikiPage: pageViewUrlString [
|
||||
^ STONJSON fromString: pageData retrieveContents
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
Tiddler >> installTiddlerExporter [
|
||||
]
|
||||
|
||||
{ #category : #testing }
|
||||
Tiddler >> isImage [
|
||||
|
||||
|
@ -158,7 +158,7 @@ TiddlyWiki >> exportCommonTiddlers [
|
||||
| content |
|
||||
content := self commonTiddlers.
|
||||
^ content do: [ :each |
|
||||
each exportSTONFileInto: 'tiddlers' ].
|
||||
each exportSTONFileOptimized ].
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
|
Loading…
Reference in New Issue
Block a user