Last update before restarting in a fresh moose 5.1 image.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2016-03-29 17:00:29 +00:00
parent 41f8485124
commit d08470823a

View File

@ -59,6 +59,16 @@ GrafoscopioNode class >> named: aString [
yourself yourself
] ]
{ #category : #'as yet unclassified' }
GrafoscopioNode class >> specialWords [
"I return a list of word that were used in the first versions of grafoscopio to mark node
headers to indicate special ways to handle them and their node contents.
Previous versions of first notebooks stored in grafoscopio using this convention should be
migrated to newer versions where tags are used for the same function with simpler code"
^ #('%config' '%abstract' '%invisible' '%idea' '%footnote' 'nuevoNodo' '%embed').
]
{ #category : #'add/remove nodes' } { #category : #'add/remove nodes' }
GrafoscopioNode >> addNode: aNode [ GrafoscopioNode >> addNode: aNode [
"Adds the given node to the receivers collection of children, and sets this object as the parent "Adds the given node to the receivers collection of children, and sets this object as the parent
@ -349,10 +359,9 @@ GrafoscopioNode >> level: anInteger [
GrafoscopioNode >> markdownContent [ GrafoscopioNode >> markdownContent [
"Extracts the markdown of a node using body as content, header as title and level as hierarchical level of the title. "Extracts the markdown of a node using body as content, header as title and level as hierarchical level of the title.
If special nodes types are present, converts them into proper markup to be embedded inside markdown" If special nodes types are present, converts them into proper markup to be embedded inside markdown"
| markdown configDict specialWords embedNodes temporalBody invisibleChildren | | markdown configDict embedNodes temporalBody invisibleChildren |
markdown := '' writeStream. markdown := '' writeStream.
specialWords := #('%config' '%abstract' '%invisible' '%idea' '%footnote' 'nuevoNodo' '%embed'). (self class specialWords includes: self header) not & (self class specialWords includes: ((self header findTokens: $ ) at: 1)) not & (self tags = 'código') not
(specialWords includes: self header) not & (specialWords includes: ((self header findTokens: $ ) at: 1)) not & (self tags = 'código') not
ifTrue: [ ifTrue: [
self level timesRepeat: [ markdown nextPutAll: '#' ]. self level timesRepeat: [ markdown nextPutAll: '#' ].
markdown nextPutAll: ' '. markdown nextPutAll: ' '.
@ -398,6 +407,11 @@ GrafoscopioNode >> markdownContent [
ifTrue: [ ifTrue: [
invisibleChildren := self children. invisibleChildren := self children.
invisibleChildren ifNotNil: [ ] ]. invisibleChildren ifNotNil: [ ] ].
(self tags = 'código')
ifTrue: [
markdown nextPutAll: ('\begin{minted}{smalltalk}'); lf.
markdown nextPutAll: (self body contents withInternetLineEndings); lf.
markdown nextPutAll: '\end{minted}';lf].
^markdown contents ^markdown contents
] ]