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

View File

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