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 } { #category : #operation }
Markdown >> commentYAMLMetadata [ Markdown >> commentYAMLMetadata [
| newContents | | newContents |
self detectYAMLMetadata ifFalse: [ ^ self ]. self contents detectYAMLMetadata ifFalse: [ ^ self ].
newContents := '' writeStream. newContents := '' writeStream.
newContents nextPutAll: '<!--@yaml'; lf. newContents nextPutAll: '<!--@yaml'; lf.
newContents nextPutAll: self yamlMetadataString. newContents nextPutAll: self yamlMetadataString.
@ -230,3 +230,8 @@ Markdown >> printOn: aStream [
Markdown >> title [ Markdown >> title [
^ title ifNil: [ title:= self headerAsTitle ] ^ 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 := inputFile parent / (inputFile basenameWithoutExtension , '.html').
outputFile ensureDelete. outputFile ensureDelete.
outputFile ensureCreateFile. outputFile ensureCreateFile.
OSSUnixSubprocess new GtSubprocessWithInMemoryOutput new
command: 'pandoc'; shellCommand: 'pandoc -f markdown+startnum+task_lists --standalone -t html ', inputFile fullName, ' --output ', outputFile fullName;
arguments: {'-f'. 'markdown+startnum+task_lists'. '--standalone'. '-t'. 'html'. inputFile fullName. runAndWait;
'--output'. outputFile fullName }; stdout.
redirectStdout; ^ outputFile.
redirectStderr;
runAndWaitOnExitDo: [ :process :outString :errString |
process isSuccess
ifTrue: [ ^ outputFile ]
ifFalse: [ ^ inputFile ]
]
] ]
{ #category : #converters } { #category : #converters }