Starting multiplatform support for Pandoc.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2020-11-07 14:00:01 -05:00
parent ef93ecca8c
commit 5bb4c29bac

View File

@ -114,6 +114,13 @@ Pandoc class >> luaFilters [
{ #category : #converters } { #category : #converters }
Pandoc class >> markdownToHtml: inputFile [ Pandoc class >> markdownToHtml: inputFile [
(Smalltalk os isUnix or: [ Smalltalk os isMacOS ]) ifTrue: [ self markdownToHtmlOnUnix: inputFile ].
Smalltalk os isWindows ifTrue: [ self markdownToHtmlOnWindows: inputFile ].
]
{ #category : #converters }
Pandoc class >> markdownToHtmlOnUnix: inputFile [
| outputFile | | outputFile |
outputFile := FileLocator temp / (inputFile basenameWithoutExtension , '.html'). outputFile := FileLocator temp / (inputFile basenameWithoutExtension , '.html').
outputFile ensureDelete. outputFile ensureDelete.
@ -130,3 +137,10 @@ Pandoc class >> markdownToHtml: inputFile [
ifFalse: [ ^ inputFile ] ifFalse: [ ^ inputFile ]
] ]
] ]
{ #category : #converters }
Pandoc class >> markdownToHtmlOnWindows: inputFile [
^ LibC resultOfCommand: 'pandoc -f markdown+startnum+task_lists -t html inputFile fullName'.
]