Preparing improvements on parenthood detection for the document tree.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2023-10-20 13:54:43 -05:00
parent 9361094bf6
commit 60cfd01f0d
2 changed files with 7 additions and 4 deletions

View File

@ -35,7 +35,11 @@ LeDatabase >> addPageFromMarkdeep: markdeepDocTree withRemote: externalDocLocati
latestEditTime: (LeTime new time: (remoteMetadata at: 'modified') asDateAndTime); latestEditTime: (LeTime new time: (remoteMetadata at: 'modified') asDateAndTime);
createEmail: (remoteMetadata at: 'creator'); createEmail: (remoteMetadata at: 'creator');
editEmail: (remoteMetadata at: 'modifier'). 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 page children
do: [ :snippet | do: [ :snippet |
(self hasBlockUID: snippet uid) (self hasBlockUID: snippet uid)

View File

@ -85,9 +85,8 @@ LePage >> defaultPandocTemplate [
{ #category : #'*MiniDocs' } { #category : #'*MiniDocs' }
LePage >> detectParentSnippetWithUid: uidString [ LePage >> detectParentSnippetWithUid: uidString [
"Answer a boolean indicating whether the supplied uid is present" uidString = self uid asString36 ifTrue: [ ^ self ].
^ self preorderTraversal detect: [ :snippet | snippet uidString = uidString ]
^ self preorderTraversal detect: [ :snippet | snippet uidString = uidString ] ifNone: [ ^ self ]
] ]
{ #category : #'*MiniDocs' } { #category : #'*MiniDocs' }