diff --git a/repository/Grafoscopio/GrafoscopioNode.class.st b/repository/Grafoscopio/GrafoscopioNode.class.st index e936aa3..84b4696 100644 --- a/repository/Grafoscopio/GrafoscopioNode.class.st +++ b/repository/Grafoscopio/GrafoscopioNode.class.st @@ -661,6 +661,16 @@ GrafoscopioNode >> newNode [ ] +{ #category : #accessing } +GrafoscopioNode >> output [ + ^ output +] + +{ #category : #accessing } +GrafoscopioNode >> output: anObject [ + output := anObject +] + { #category : #accessing } GrafoscopioNode >> parent [ "Returns the parent of the current node" diff --git a/repository/Grafoscopio/GrafoscopioNodeTest.class.st b/repository/Grafoscopio/GrafoscopioNodeTest.class.st index d77e3ac..5334cd4 100644 --- a/repository/Grafoscopio/GrafoscopioNodeTest.class.st +++ b/repository/Grafoscopio/GrafoscopioNodeTest.class.st @@ -33,6 +33,18 @@ GrafoscopioNodeTest >> testDemoteNode [ ] +{ #category : #tests } +GrafoscopioNodeTest >> testHasMarkdownSubtreesToExport [ + "Because becomeDefaultTestTree contains at least one non empty 'links' object that + points to a relative path in the file system, ending in '.md' or '.markdown' the + result of this test is true. + Please see look #becomeDefaultTestTree message to see the details that makes this test true." + | tree | + tree := GrafoscopioNode new becomeDefaultTestTree. + self assert: tree selectMarkdownSubtreesToExport isNotEmpty equals: true. + +] + { #category : #tests } GrafoscopioNodeTest >> testInitializeIsOk [ self shouldnt: [ GrafoscopioNode new ] raise: Error diff --git a/repository/Grafoscopio/GrafoscopioNotebook.class.st b/repository/Grafoscopio/GrafoscopioNotebook.class.st index 0718ceb..c7dfbf1 100644 --- a/repository/Grafoscopio/GrafoscopioNotebook.class.st +++ b/repository/Grafoscopio/GrafoscopioNotebook.class.st @@ -56,14 +56,17 @@ GrafoscopioNotebook >> addNode [ { #category : #operation } GrafoscopioNotebook >> autoSaveBodyOf: aNode [ + | playground | body body class = TextModel ifTrue: [ body body whenTextChanged: [ :arg | aNode body: arg ] ]. body body class = GlamourPresentationModel - ifTrue: [ | playground | - playground := body body glmPres. - playground - onChangeOfPort: #text - act: [ :x | aNode body: x entity value content ]] + ifFalse: [ ^ self ]. + playground := body body glmPres. + playground + onChangeOfPort: #text + act: [ :x | aNode body: x entity value content ]; + onChangeOfPort: #activePresentation + act: [ aNode output: (Compiler evaluate: aNode body) ] ] { #category : #accessing }