diff --git a/repository/Grafoscopio/GrafoscopioNode.class.st b/repository/Grafoscopio/GrafoscopioNode.class.st index ee5507b..b18ea00 100644 --- a/repository/Grafoscopio/GrafoscopioNode.class.st +++ b/repository/Grafoscopio/GrafoscopioNode.class.st @@ -92,7 +92,7 @@ GrafoscopioNode class >> specialWords [ 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'). + ^ #('%config' '%abstract' '%invisible' '%idea' '%footnote' 'nuevoNodo' '%embed' '%item'). ] { #category : #'add/remove nodes' } @@ -534,6 +534,28 @@ GrafoscopioNode >> isEmpty [ body ifNil: [ ^ true ] ifNotNil: [ ^ false ] ] +{ #category : #exporting } +GrafoscopioNode >> itemAsMarkdownInto: aStream [ + "I export a node with %item in its header as valid Pandoc's markdown + and replace all line endings to make them Internet friendly. + Maybe I should include the condition about my own header, instead of leaving it to markdownContent..." + + | lines | + lines := self body contents asString withInternetLineEndings lines. + lines ifEmpty: [ ^ self ]. + aStream + nextPutAll: ' - '; + nextPutAll: lines first; + lf. + lines + allButFirstDo: [ :line | + aStream + nextPutAll: ' '; + nextPutAll: line; + lf ]. + aStream nextPutAll: String lf +] + { #category : #accessing } GrafoscopioNode >> key [ "Returns a unique key identifying the receiver in the help system"