Markdown YAML metadata and default options.
This commit is contained in:
parent
4c661e0b6d
commit
9744a8c6b0
@ -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 |
|
||||
|
Loading…
Reference in New Issue
Block a user