Grafoscopio now stores the output of calculations! Reification of notebooks was done

on packages, so it was not needed until now (almost 2.5 years after first public commit!).
Impressive what the Pharo live coding environment can do, and the stuff you can "just leave for later" :-).
This commit is contained in:
Offray Vladimir Luna Cárdenas 2017-04-14 19:35:04 +00:00
parent ecd04cdd5a
commit ebeb8acfcb
3 changed files with 30 additions and 5 deletions

View File

@ -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"

View File

@ -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

View File

@ -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 }