More refactoring

This commit is contained in:
Santiago Bragagnolo 2020-03-22 12:04:07 +00:00 committed by Offray Luna
parent 4f251b08c5
commit 6a92669efd
2 changed files with 17 additions and 14 deletions

View File

@ -362,19 +362,21 @@ GrafoscopioNewNotebook >> exportLinkContent [
{ #category : #persistence }
GrafoscopioNewNotebook >> exportNode: aGrafoscopioNode asMarkdownIn: aFile [
"I export the current tree/document to a markdown file"
aFile ensureDelete.
aFile
ensureCreateFile;
writeStreamDo: [ :stream |
stream
nextPutAll:
('---', String cr,
'exportedFrom: ', self checksumForRootSubtree, String cr) withInternetLineEndings.
('---' , String cr , 'exportedFrom: ' , self checksumForRootSubtree
, String cr) withInternetLineEndings.
aGrafoscopioNode metadataAsYamlIn: stream.
stream
nextPutAll:
('---', String cr, String cr) withInternetLineEndings,
aGrafoscopioNode asMarkdown ].
('---' , String cr , String cr) withInternetLineEndings
, aGrafoscopioNode asMarkdown.
stream flush ].
self inform: 'Exported as: ' , String cr , aFile fullName
]
@ -513,8 +515,8 @@ GrafoscopioNewNotebook >> initializePresenter [
item := tree selectedItem.
tree selectedItem header: arg.
tree selectedItem updateEditionTimestamp.
tree roots: tree roots.
tree selectItem: item ] ].
" tree roots: tree roots."
" tree selectItem: item "] ].
links
whenTextChangedDo: [ :arg |
(tree respondsTo: #link:)
@ -1036,6 +1038,7 @@ GrafoscopioNewNotebook >> selectedItem: aGrafoscopioTextNode path: aPath [
{ #category : #'asdas yet unclassified' }
GrafoscopioNewNotebook >> selectedPathNextTo: aPath [
aPath isEmpty ifTrue: [ ^ self ].
aPath
at: aPath size
put: (aPath at: aPath size) + 1.

View File

@ -649,7 +649,7 @@ GrafoscopioTextNode >> markdownContent [
GrafoscopioTextNode >> metadata [
| mnode |
mnode := self root preorderTraversal
detect: [ :n | n headerStartsWith: '%metadata' ]
detect: [ :n | n header beginsWith: '%metadata' ]
ifNone: [ ^ nil ].
^ mnode output.