Starting importation of Markdeep objects from files.
This commit is contained in:
parent
06ccc84c29
commit
004b286835
@ -158,6 +158,23 @@ Markdeep >> converPubPubFootnoteBetween: footnote and: nextFootnote in: footnote
|
|||||||
^ response contents
|
^ 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 }
|
{ #category : #accessing }
|
||||||
Markdeep >> folder [
|
Markdeep >> folder [
|
||||||
^ self file parent
|
^ self file parent
|
||||||
@ -199,8 +216,11 @@ Markdeep >> gtTextFor: aView [
|
|||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
Markdeep >> head [
|
Markdeep >> head [
|
||||||
^ head ifNil: [ head := OrderedCollection new.
|
|
||||||
head add: self fontAwesomeHeader; yourself ]
|
^ head ifNil: [
|
||||||
|
head := OrderedCollection new.
|
||||||
|
head add: self fontAwesomeHeader; yourself.
|
||||||
|
].
|
||||||
]
|
]
|
||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
|
@ -103,6 +103,7 @@ Markdown >> detectYAMLMetadata [
|
|||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
Markdown >> documentTree [
|
Markdown >> documentTree [
|
||||||
| parser|
|
| parser|
|
||||||
|
self contents ifNil: [^ nil].
|
||||||
parser := PPCommonMarkBlockParser new parse: self contents.
|
parser := PPCommonMarkBlockParser new parse: self contents.
|
||||||
^ parser accept: CMBlockVisitor new
|
^ parser accept: CMBlockVisitor new
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user