Improving Markdeep files reading and Markdown document tree views.
This commit is contained in:
parent
004b286835
commit
4199ed0a6c
@ -166,13 +166,22 @@ Markdeep >> file: aFileReference [
|
||||
|
||||
{ #category : #accessing }
|
||||
Markdeep >> fillInContentsFrom: aFileReference [
|
||||
| docTree headTree |
|
||||
| docTree docTreeChildren headTree tempTitle bodyLineIndex |
|
||||
docTree := (Markdown new contents: aFileReference contents) documentTree.
|
||||
headTree := (docTree children
|
||||
docTreeChildren := docTree children.
|
||||
headTree := (docTreeChildren
|
||||
detect: [ :node |
|
||||
node className = 'PPCMParagraph'
|
||||
and: [ (node children detect: [ :subnode | subnode text = '<head>' ]) isNotNil ] ]).
|
||||
^ headTree
|
||||
headTree children allButFirst allButLast do: [:node |
|
||||
(node className = 'PPCMHtml') ifTrue: [ self head add: node text ]
|
||||
].
|
||||
self head: self head asSet asOrderedCollection.
|
||||
tempTitle := ((docTreeChildren detect: [ :node | node className = 'PPCMIndentedCode'])
|
||||
children detect: [:subnode | subnode text trimmed beginsWith: '**']) text trimmed.
|
||||
bodyLineIndex := docTreeChildren detectIndex: [ :node | node text includesSubstring: tempTitle ].
|
||||
self title: (tempTitle copyFrom: 3 to: tempTitle size - 2).
|
||||
^ { self head . self title . bodyLineIndex . docTree }
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
|
@ -23,3 +23,8 @@ PPCMBlockQuote >> initialize [
|
||||
PPCMBlockQuote >> isBlockLevel [
|
||||
^ true
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
PPCMBlockQuote >> viewBody [
|
||||
^ (self className ,' ', self text) asRopedText.
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user