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);
|
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)
|
||||||
|
@ -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' }
|
||||||
|
Loading…
Reference in New Issue
Block a user