diff --git a/src/MiniDocs/Markdown.class.st b/src/MiniDocs/Markdown.class.st index 24be866..a50e674 100644 --- a/src/MiniDocs/Markdown.class.st +++ b/src/MiniDocs/Markdown.class.st @@ -87,6 +87,12 @@ Markdown >> contentsWithoutYAMLMetadata [ ^ newContents contents. ] +{ #category : #accessing } +Markdown >> defaultOptions [ + ^ { 'sourceCodeLink' -> true . + 'commentsProvider' -> 'Hypothesis' } asDictionary +] + { #category : #operation } Markdown >> deleteYAMLMetadata [ | newContents | @@ -212,7 +218,7 @@ Markdown >> metadata: rawMeta [ { #category : #accessing } Markdown >> metadataAsYAML [ - self metadata isEmptyOrNil ifTrue: [ ^ self ]. + self metadata isEmptyOrNil ifTrue: [ ^ '' ]. ^ YQ jsonToYaml: self metadata ] @@ -223,6 +229,11 @@ Markdown >> notifyExportAsFileOn: aFileReference [ ^ aFileReference ] +{ #category : #accessing } +Markdown >> options [ + ^ self metadata at: 'options' ifAbsentPut: [ self defaultOptions] +] + { #category : #accessing } Markdown >> populateMetadata [ | rawMeta |