Preparing improvements on parenthood detection for the document tree.
This commit is contained in:
parent
9361094bf6
commit
60cfd01f0d
@ -35,7 +35,11 @@ LeDatabase >> addPageFromMarkdeep: markdeepDocTree withRemote: externalDocLocati
|
||||
latestEditTime: (LeTime new time: (remoteMetadata at: 'modified') asDateAndTime);
|
||||
createEmail: (remoteMetadata at: 'creator');
|
||||
editEmail: (remoteMetadata at: 'modifier').
|
||||
snippets do: [ :snippet | page addSnippet: snippet ].
|
||||
snippets do: [ :snippet | | currentParent |
|
||||
page addSnippet: snippet.
|
||||
currentParent := page detectParentSnippetWithUid: (snippet metadata at: 'parent').
|
||||
snippet parent: currentParent.
|
||||
].
|
||||
page children
|
||||
do: [ :snippet |
|
||||
(self hasBlockUID: snippet uid)
|
||||
|
@ -85,9 +85,8 @@ LePage >> defaultPandocTemplate [
|
||||
|
||||
{ #category : #'*MiniDocs' }
|
||||
LePage >> detectParentSnippetWithUid: uidString [
|
||||
"Answer a boolean indicating whether the supplied uid is present"
|
||||
|
||||
^ self preorderTraversal detect: [ :snippet | snippet uidString = uidString ] ifNone: [ ^ self ]
|
||||
uidString = self uid asString36 ifTrue: [ ^ self ].
|
||||
^ self preorderTraversal detect: [ :snippet | snippet uidString = uidString ]
|
||||
]
|
||||
|
||||
{ #category : #'*MiniDocs' }
|
||||
|
Loading…
Reference in New Issue
Block a user