Starting importation of Markdeep objects from files.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2024-03-03 18:48:00 -05:00
parent 06ccc84c29
commit 004b286835
2 changed files with 23 additions and 2 deletions

View File

@ -158,6 +158,23 @@ Markdeep >> converPubPubFootnoteBetween: footnote and: nextFootnote in: footnote
^ response contents
]
{ #category : #accessing }
Markdeep >> file: aFileReference [
file := aFileReference.
self fillInContentsFrom: aFileReference
]
{ #category : #accessing }
Markdeep >> fillInContentsFrom: aFileReference [
| docTree headTree |
docTree := (Markdown new contents: aFileReference contents) documentTree.
headTree := (docTree children
detect: [ :node |
node className = 'PPCMParagraph'
and: [ (node children detect: [ :subnode | subnode text = '<head>' ]) isNotNil ] ]).
^ headTree
]
{ #category : #accessing }
Markdeep >> folder [
^ self file parent
@ -199,8 +216,11 @@ Markdeep >> gtTextFor: aView [
{ #category : #accessing }
Markdeep >> head [
^ head ifNil: [ head := OrderedCollection new.
head add: self fontAwesomeHeader; yourself ]
^ head ifNil: [
head := OrderedCollection new.
head add: self fontAwesomeHeader; yourself.
].
]
{ #category : #accessing }

View File

@ -103,6 +103,7 @@ Markdown >> detectYAMLMetadata [
{ #category : #accessing }
Markdown >> documentTree [
| parser|
self contents ifNil: [^ nil].
parser := PPCommonMarkBlockParser new parse: self contents.
^ parser accept: CMBlockVisitor new
]