Deep %invisible nodes, that is, the ones that have '%invisible' as one of its ancestors are ignored now.
This commit is contained in:
parent
6fecaa9b51
commit
684fa43915
@ -80,15 +80,32 @@ GrafoscopioNode >> addNodeAfter [
|
||||
|
||||
]
|
||||
|
||||
{ #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
|
||||
children instead of having two separate methods"
|
||||
| currentNode ancestors |
|
||||
|
||||
currentNode := self.
|
||||
ancestors := OrderedCollection new.
|
||||
(self level - 1)
|
||||
timesRepeat: [
|
||||
ancestors add: currentNode parent.
|
||||
currentNode := currentNode parent.].
|
||||
ancestors := ancestors reversed.
|
||||
^ ancestors collect: [:ancestor | ancestor header ]
|
||||
|
||||
|
||||
]
|
||||
|
||||
{ #category : #exporting }
|
||||
GrafoscopioNode >> asMarkdown [
|
||||
"Exports children of the curren node as pandoc markdown, using special nodes for config options and bibliography."
|
||||
| markdownOutput |
|
||||
|
||||
markdownOutput := '' writeStream.
|
||||
"(self preorderTraversal) do: [ :eachNode | markdownOutput nextPutAll: (eachNode markdownContent) ]."
|
||||
(self preorderTraversal) do: [ :eachNode |
|
||||
(eachNode level > 0) ifTrue: [(eachNode parent header = '%invisible') not ifTrue: [markdownOutput nextPutAll: (eachNode markdownContent)]]].
|
||||
(eachNode level > 0) ifTrue: [(eachNode ancestorsHeaders includes: '%invisible') not ifTrue: [ markdownOutput nextPutAll: (eachNode markdownContent) ]]].
|
||||
|
||||
^markdownOutput contents
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user