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

41 lines
1.0 KiB
Smalltalk
Raw Normal View History

Extension { #name : #LeTextSnippet }
{ #category : #'*Grafoscopio-Utils-Core' }
LeTextSnippet >> contentFrom: markdeepDiv [
| sanitized |
sanitized := markdeepDiv contentString.
sanitized := sanitized allButFirst.
sanitized := sanitized allButLast.
self string: sanitized.
]
2022-02-04 17:15:57 +00:00
2022-02-11 21:41:25 +00:00
{ #category : #'*Grafoscopio-Utils-Core' }
LeTextSnippet >> metadata [
^ self optionAt: 'metadata' ifAbsentPut: [ self metadataInit ]
]
{ #category : #'*Grafoscopio-Utils-Core' }
LeTextSnippet >> metadataInit [
^ OrderedDictionary new
at: 'id' put: self uidString;
2022-03-11 16:16:51 +00:00
at: 'parent' put: self parentId;
2022-02-11 21:41:25 +00:00
at: 'created' put: self createTime asString;
at: 'modified' put: self latestEditTime asString;
at: 'creator' put: self createEmail asString;
at: 'modifier' put: self editEmail asString;
yourself
]
2022-02-04 17:15:57 +00:00
{ #category : #'*Grafoscopio-Utils-Core' }
LeTextSnippet >> options [
^ options
]
2022-03-11 16:16:51 +00:00
{ #category : #'*Grafoscopio-Utils-Core' }
LeTextSnippet >> parentId [
self parent ifNil: [ ^ self ].
^ self parent uidString.
]