More refactoring
This commit is contained in:
parent
4f251b08c5
commit
6a92669efd
@ -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
|
||||
ensureCreateFile;
|
||||
writeStreamDo: [:stream |
|
||||
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 ].
|
||||
self inform: 'Exported as: ', String cr, aFile fullName
|
||||
('---' , 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.
|
||||
|
@ -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.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user