Improving creation and printing. Replacing old dependencies.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2023-03-09 09:45:47 -05:00
parent 6eada9fe00
commit 11dc04e39f
1 changed files with 7 additions and 2 deletions

View File

@ -110,6 +110,11 @@ Markdown >> fromFile: aFileReference [
self file: aFileReference.
]
{ #category : #'instance creation' }
Markdown >> fromString: markdownString [
self contents: markdownString.
]
{ #category : #accessing }
Markdown >> gtTextFor: aView [
<gtView>
@ -126,7 +131,7 @@ Markdown >> lines [
{ #category : #accessing }
Markdown >> metadata [
| rawMeta |
rawMeta := PPYAMLGrammar new parse: self yamlMetadataString.
rawMeta := MiniDocs yamlToJson: self yamlMetadataString.
rawMeta associationsDo: [ :assoc |
assoc value = 'false' ifTrue: [ assoc value: false ].
assoc value = 'true' ifTrue: [ assoc value: true ] ].
@ -137,7 +142,7 @@ Markdown >> metadata [
Markdown >> printOn: aStream [
super printOn: aStream.
aStream
nextPutAll: '( ', (self metadata at: 'title'), ' )'
nextPutAll: '( ', (self metadata at: 'title' ifAbsent: ['untitled']), ' )'
]
{ #category : #utilities }