This commit is contained in:
Offray Vladimir Luna Cárdenas 2024-09-25 17:40:32 -05:00
commit cccf81e89b
2 changed files with 11 additions and 12 deletions

View File

@ -50,7 +50,7 @@ Markdown >> body: aString [
{ #category : #operation }
Markdown >> commentYAMLMetadata [
| newContents |
self detectYAMLMetadata ifFalse: [ ^ self ].
self contents detectYAMLMetadata ifFalse: [ ^ self ].
newContents := '' writeStream.
newContents nextPutAll: '<!--@yaml'; lf.
newContents nextPutAll: self yamlMetadataString.
@ -230,3 +230,8 @@ Markdown >> printOn: aStream [
Markdown >> title [
^ title ifNil: [ title:= self headerAsTitle ]
]
{ #category : #accessing }
Markdown >> title: aString [
title := aString
]

View File

@ -147,17 +147,11 @@ Pandoc class >> markdownToHtmlOnUnix: inputFile [
outputFile := inputFile parent / (inputFile basenameWithoutExtension , '.html').
outputFile ensureDelete.
outputFile ensureCreateFile.
OSSUnixSubprocess new
command: 'pandoc';
arguments: {'-f'. 'markdown+startnum+task_lists'. '--standalone'. '-t'. 'html'. inputFile fullName.
'--output'. outputFile fullName };
redirectStdout;
redirectStderr;
runAndWaitOnExitDo: [ :process :outString :errString |
process isSuccess
ifTrue: [ ^ outputFile ]
ifFalse: [ ^ inputFile ]
]
GtSubprocessWithInMemoryOutput new
shellCommand: 'pandoc -f markdown+startnum+task_lists --standalone -t html ', inputFile fullName, ' --output ', outputFile fullName;
runAndWait;
stdout.
^ outputFile.
]
{ #category : #converters }