More refactoring

This commit is contained in:
SantiagoBragagnolo 2020-03-22 12:04:07 +00:00
parent 01bbebd53f
commit 562244028c
2 changed files with 17 additions and 14 deletions

View File

@ -362,20 +362,22 @@ GrafoscopioNewNotebook >> exportLinkContent [
{ #category : #persistence }
GrafoscopioNewNotebook >> exportNode: aGrafoscopioNode asMarkdownIn: aFile [
"I export the current tree/document to a markdown file"
aFile ensureDelete.
aFile
aFile
ensureCreateFile;
writeStreamDo: [:stream |
stream
nextPutAll:
('---', String cr,
'exportedFrom: ', self checksumForRootSubtree, String cr) withInternetLineEndings.
writeStreamDo: [ :stream |
stream
nextPutAll:
('---' , String cr , 'exportedFrom: ' , self checksumForRootSubtree
, String cr) withInternetLineEndings.
aGrafoscopioNode metadataAsYamlIn: stream.
stream
nextPutAll:
('---', String cr, String cr) withInternetLineEndings,
aGrafoscopioNode asMarkdown ].
self inform: 'Exported as: ', String cr, aFile fullName
stream
nextPutAll:
('---' , String cr , String cr) withInternetLineEndings
, aGrafoscopioNode asMarkdown.
stream flush ].
self inform: 'Exported as: ' , String cr , aFile fullName
]
{ #category : #persistence }
@ -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.