diff --git a/src/Grafoscopio/GrafoscopioNode.class.st b/src/Grafoscopio/GrafoscopioNode.class.st index efe2ead..3f668c3 100644 --- a/src/Grafoscopio/GrafoscopioNode.class.st +++ b/src/Grafoscopio/GrafoscopioNode.class.st @@ -751,7 +751,8 @@ GrafoscopioNode >> metadata [ GrafoscopioNode >> metadataAsYamlIn: markdownStream [ "I convert the first '%metadata' node into a YAML preamble contents to be used by Pandoc exportation." - self metadata + self metadata + ifNil: [ markdownStream nextPutAll: String crlf. ] ifNotNil: [ self metadata keysAndValuesDo: [ :k :v | diff --git a/src/Grafoscopio/GrafoscopioNotebook.class.st b/src/Grafoscopio/GrafoscopioNotebook.class.st index 61097e3..6b98eae 100644 --- a/src/Grafoscopio/GrafoscopioNotebook.class.st +++ b/src/Grafoscopio/GrafoscopioNotebook.class.st @@ -189,10 +189,18 @@ GrafoscopioNotebook >> exportAsHTML [ htmlFile := self markdownFile parent fullName,'/', self markdownFile basenameWithoutExtension, '.html'. htmlFile asFileReference exists ifTrue: [ htmlFile asFileReference delete ]. Smalltalk platformName = 'unix' - ifTrue: [OSProcess command: 'pandoc --standalone ', self markdownFile fullName, ' -o ', htmlFile]. + ifTrue: [ + OSSUnixSubprocess new + command: 'pandoc'; + arguments: {'--standalone'. self markdownFile fullName. '--output' . htmlFile}; + redirectStdout; + runAndWaitOnExitDo: [ :process :outString :errString | + process isSuccess + ifTrue: [ self inform: ('File exported as: ', String cr, htmlFile) ] + ifFalse: [ self inform: 'Exportation unsuccesful. Please review that you have + installed Pandoc and have used the exportation options properly.' ]]]. Smalltalk platformName = 'Win32' - ifTrue: [WindowsProcess command: 'pandoc --standalone ', self markdownFile fullName, ' -o ', htmlFile]. - self inform: ('File exported as: ', String cr, htmlFile). + ifTrue: [WinProcess createProcess: 'pandoc --standalone ', self markdownFile fullName, ' -o ', htmlFile]. ] { #category : #persistence }