GrafoscopioUtils/repository/Grafoscopio-Utils/LeTextualSnippet.extension.st

42 lines
1.1 KiB
Smalltalk

Extension { #name : #LeTextualSnippet }
{ #category : #'*Grafoscopio-Utils-Core' }
LeTextualSnippet >> asMarkdeep [
| output |
output := '' writeStream.
output
nextPutAll: '<div x-class="', self class asString, '" '; lf;
nextPutAll: 'x-data="', (STON toString: self metadata), '">'; lf;
nextPutAll: self markdeepCustomOpener;
nextPutAll: self contentAsString; lf;
nextPutAll: self markdeepCustomCloser;
nextPutAll: '</div>'; lf; lf.
^ output contents
]
{ #category : #'*Grafoscopio-Utils-Core' }
LeTextualSnippet >> childrenIds [
^ self children select: [ :each | each uidString ]
]
{ #category : #'*Grafoscopio-Utils-Core' }
LeTextualSnippet >> markdeepCustomCloser [
^ ''
]
{ #category : #'*Grafoscopio-Utils-Core' }
LeTextualSnippet >> markdeepCustomOpener [
^ ''
]
{ #category : #'*Grafoscopio-Utils-Core' }
LeTextualSnippet >> metadata [
^ OrderedDictionary new
at:'id' put: self uidString;
at: 'created' put: self createTime asString;
at: 'edited' put: self latestEditTime asString;
at: 'creator' put: self createEmail asString;
at: 'editor' put: self editEmail asString;
yourself.
]