Grafoscopio document conversion to Lepiter pages started.
This commit is contained in:
parent
128f5b8d7c
commit
2fe11cb753
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue