2022-01-24 01:38:07 +00:00
|
|
|
Extension { #name : #LeTextualSnippet }
|
|
|
|
|
|
|
|
{ #category : #'*Grafoscopio-Utils-Core' }
|
|
|
|
LeTextualSnippet >> asMarkdeep [
|
2022-01-27 14:23:34 +00:00
|
|
|
"Inspired by Alpine.js and Assembler CSS 'x-' properties, we are going to use
|
|
|
|
'st-' properties as a way to extend divs metadata regarding its contents."
|
2022-01-24 01:38:07 +00:00
|
|
|
| output |
|
|
|
|
output := '' writeStream.
|
|
|
|
output
|
2022-01-27 14:23:34 +00:00
|
|
|
nextPutAll: '<div st-class="', self class asString, '"'; lf;
|
|
|
|
nextPutAll: ' st-data="', (STON toString: self metadata), '">'; lf;
|
2022-01-24 01:38:07 +00:00
|
|
|
nextPutAll: self markdeepCustomOpener;
|
|
|
|
nextPutAll: self contentAsString; lf;
|
|
|
|
nextPutAll: self markdeepCustomCloser;
|
|
|
|
nextPutAll: '</div>'; lf; lf.
|
|
|
|
^ output contents
|
|
|
|
]
|
|
|
|
|
|
|
|
{ #category : #'*Grafoscopio-Utils-Core' }
|
|
|
|
LeTextualSnippet >> childrenIds [
|
2022-01-27 14:23:34 +00:00
|
|
|
^ self children collect: [ :each | each uidString ]
|
2022-01-24 01:38:07 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
{ #category : #'*Grafoscopio-Utils-Core' }
|
|
|
|
LeTextualSnippet >> markdeepCustomCloser [
|
|
|
|
^ ''
|
|
|
|
]
|
|
|
|
|
|
|
|
{ #category : #'*Grafoscopio-Utils-Core' }
|
|
|
|
LeTextualSnippet >> markdeepCustomOpener [
|
|
|
|
^ ''
|
|
|
|
]
|
|
|
|
|
|
|
|
{ #category : #'*Grafoscopio-Utils-Core' }
|
|
|
|
LeTextualSnippet >> metadata [
|
|
|
|
^ OrderedDictionary new
|
2022-01-27 14:23:34 +00:00
|
|
|
at: 'id' put: self uidString;
|
|
|
|
at: 'parent' put: self parent uidString;
|
2022-01-24 01:38:07 +00:00
|
|
|
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.
|
|
|
|
]
|