Just before testing pager as a way to make custom visualization of nodes instead of opening a new file in a new mode. This save us from reloading the file, gives more flexibility and inmediate feedback according to the kind of node (as marked by tags ) we're located on.
This commit is contained in:
parent
a1a8d0d21c
commit
990ff595b1
@ -609,7 +609,7 @@ GrafoscopioBrowser >> panelBrowserForTransmediaton [
|
||||
Opens grafoscopio in several 'modes'. Each mode corresponds to a operation way, with an specific interface.
|
||||
We will start with a 'transmediaton' mode to let the people create some transmedia content.
|
||||
After that we will enable other modes"
|
||||
| transmediaNode |
|
||||
| transmediaNode originalNode |
|
||||
|
||||
browser := GLMTabulator new.
|
||||
browser
|
||||
@ -624,9 +624,11 @@ GrafoscopioBrowser >> panelBrowserForTransmediaton [
|
||||
format:[:eachNode |
|
||||
(eachNode tags) = 'original'
|
||||
ifFalse: [ '' ]
|
||||
ifTrue: [
|
||||
transmediaNode := eachNode children detect: [:node | node tags = 'transmediado'].
|
||||
eachNode body]]].
|
||||
ifTrue: [
|
||||
originalNode := eachNode.
|
||||
originalNode children isNotNil
|
||||
ifTrue: [transmediaNode := originalNode children detect: [:node | node tags = 'transmediado'] ifNone: [ transmediaNode := nil ] ].
|
||||
originalNode body]]].
|
||||
(browser transmit)
|
||||
from: #original;
|
||||
toOutsidePort: #text.
|
||||
|
@ -82,6 +82,23 @@ GrafoscopioNode >> addNodeAfter [
|
||||
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
GrafoscopioNode >> ancestors [
|
||||
"Returns a collection of all the nodes wich are ancestors of the receiver node"
|
||||
| currentNode ancestors |
|
||||
|
||||
currentNode := self.
|
||||
ancestors := OrderedCollection new.
|
||||
(self level - 1)
|
||||
timesRepeat: [
|
||||
ancestors add: currentNode parent.
|
||||
currentNode := currentNode parent.].
|
||||
ancestors := ancestors reversed.
|
||||
^ ancestors
|
||||
|
||||
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
GrafoscopioNode >> ancestorsHeaders [
|
||||
"Returns the headers of all the ancestors of the node. Maybe this and 'headers' should be integrated, so both act on a collection of
|
||||
@ -108,7 +125,7 @@ GrafoscopioNode >> asMarkdown [
|
||||
markdownOutput := '' writeStream.
|
||||
(self preorderTraversal) do: [ :eachNode |
|
||||
(eachNode level > 0) & (eachNode header notNil) ifTrue: [
|
||||
(eachNode hasAncestorWith: '%invisible') not
|
||||
(eachNode hasAncestorHeaderWith: '%invisible') not
|
||||
ifTrue: [ markdownOutput nextPutAll: (eachNode markdownContent) ]]].
|
||||
|
||||
^markdownOutput contents
|
||||
@ -184,12 +201,21 @@ GrafoscopioNode >> demote [
|
||||
]
|
||||
|
||||
{ #category : #exporting }
|
||||
GrafoscopioNode >> hasAncestorWith: aSpecialWord [
|
||||
GrafoscopioNode >> hasAncestorHeaderWith: aSpecialWord [
|
||||
"Looks if the receptor node has an ancestor with a header with 'aSpecialWord' as the only or the first word"
|
||||
|
||||
^ (self ancestorsHeaders includes: aSpecialWord) | ((self ancestorsHeaders collect: [:eachHeader | (eachHeader findTokens: $ ) at: 1 ]) includes: aSpecialWord)
|
||||
|
||||
|
||||
]
|
||||
|
||||
{ #category : #exporting }
|
||||
GrafoscopioNode >> hasAncestorTaggedAs: aSpecialWord [
|
||||
"Looks if the receptor node has an ancestor with a header with 'aSpecialWord' as the only or the first word"
|
||||
|
||||
^ self ancestors detect: [:eachAncestor | eachAncestor tags = aSpecialWord ]
|
||||
|
||||
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
|
Loading…
Reference in New Issue
Block a user