Grafoscopio document conversion to Lepiter pages started.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2023-01-22 17:49:46 -05:00
parent 128f5b8d7c
commit 2fe11cb753
1 changed files with 32 additions and 0 deletions

View File

@ -15,6 +15,38 @@ Class {
#category : #MiniDocs
}
{ #category : #accessing }
GrafoscopioNode >> asLePage [
| page |
page := LePage new
title: 'Grafoscopio Notebook (imported)'.
self nodesInPreorder allButFirst do: [:node |
page addSnippet: node asSnippet.
(node level = 1)
ifFalse: [ node asSnippet parent: node parent asSnippet ]
].
^ page.
]
{ #category : #accessing }
GrafoscopioNode >> asSnippet [
| snippet child |
snippet := LeTextSnippet new
string: self header;
createTime: self created.
(self tags includes: 'código')
ifFalse: [
child := LeTextSnippet new;
string: self body. ]
ifTrue: [
child := LePharoSnippet new;
code: self body ].
child createTime: self created.
snippet addFirstSnippet: child.
snippet optionAt: 'tags' put: self tags.
^ snippet
]
{ #category : #accessing }
GrafoscopioNode >> body [
^ body