Improving LeSnippet to LePage conversion.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2024-04-16 14:18:41 -05:00
parent 13f9b8050e
commit 573c929845

View File

@ -2,9 +2,14 @@ Extension { #name : #LeTextSnippet }
{ #category : #'*MiniDocs' } { #category : #'*MiniDocs' }
LeTextSnippet >> asLePage [ LeTextSnippet >> asLePage [
| page | | page title currentSnippet |
title := self contentAsString markdownHeaders associations first value.
title := (title trimBoth: [:char | char = $# ]) trimmed.
page := LePage new page := LePage new
initializeTitle: self contentAsString. initializeTitle: title.
currentSnippet := LeTextSnippet new
string: self contentAsString.
page addSnippet: currentSnippet.
self database addPage: page. self database addPage: page.
self childrenDo: [:child | self childrenDo: [:child |
child moveToPageTitled: page title child moveToPageTitled: page title