Using GtSubProcess to work on memory and avoid external files creation.
This commit is contained in:
parent
b500a65c00
commit
af81f92399
@ -24,14 +24,17 @@ Class {
|
||||
|
||||
{ #category : #operation }
|
||||
BreaPage >> bodyContentsAsHTML [
|
||||
| sourcePage |
|
||||
| sourcePage commandParameters |
|
||||
self contentsFile ifNil: [ ^ self ].
|
||||
sourcePage := self file file.
|
||||
Smalltalk os isWindows ifTrue: [
|
||||
^ Pandoc markdownToHtml: self file file
|
||||
].
|
||||
sourcePage := FileLocator temp / 'wikiPage.md'.
|
||||
MarkupFile exportAsFileOn: sourcePage containing: self contents.
|
||||
^ Pandoc markdownToHtml: sourcePage
|
||||
].
|
||||
commandParameters := ' -f markdown+startnum+task_lists -t html '.
|
||||
^ GtSubprocessWithInMemoryOutput new
|
||||
shellCommand: 'pandoc', commandParameters, sourcePage fullName;
|
||||
runAndWait;
|
||||
stdout.
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
@ -63,7 +66,7 @@ BreaPage >> contents [
|
||||
result nextPutAll: (Markdown fromFile: markdownTempFile) contents.
|
||||
]
|
||||
].
|
||||
^ result contents.
|
||||
^ result contents withInternetLineEndings.
|
||||
]
|
||||
|
||||
{ #category : #operation }
|
||||
|
Loading…
Reference in New Issue
Block a user