Suport for empty items.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2017-07-14 10:53:24 +00:00
parent 206725dc4f
commit bde5e0a938

View File

@ -92,7 +92,7 @@ GrafoscopioNode class >> specialWords [
Previous versions of first notebooks stored in grafoscopio using this convention should be 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" 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' } { #category : #'add/remove nodes' }
@ -534,6 +534,28 @@ GrafoscopioNode >> isEmpty [
body ifNil: [ ^ true ] ifNotNil: [ ^ false ] 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 } { #category : #accessing }
GrafoscopioNode >> key [ GrafoscopioNode >> key [
"Returns a unique key identifying the receiver in the help system" "Returns a unique key identifying the receiver in the help system"