2022-01-30 18:57:25 +00:00
|
|
|
Extension { #name : #LePictureSnippet }
|
|
|
|
|
|
|
|
{ #category : #'*Grafoscopio-Utils-Core' }
|
|
|
|
LePictureSnippet >> centeredFigure [
|
|
|
|
|
|
|
|
^ '<center>
|
|
|
|
<figure>
|
|
|
|
<img src="' , self urlString , '"
|
|
|
|
width="' , (self optionAt: 'width' ifAbsent: [ '75%' ]) , '"
|
|
|
|
/>
|
|
|
|
<figcaption>*' , (self optionAt: 'caption' ifAbsent: [ '' ]) , '*
|
|
|
|
</figcaption>
|
|
|
|
</figure>
|
|
|
|
</center>'
|
|
|
|
]
|
2022-02-02 23:35:39 +00:00
|
|
|
|
|
|
|
{ #category : #'*Grafoscopio-Utils-Core' }
|
|
|
|
LePictureSnippet >> contentFrom: markdeepDiv [
|
|
|
|
| caption width |
|
|
|
|
caption := markdeepDiv contentString.
|
|
|
|
width := (markdeepDiv // 'img' @ 'width') stringValue.
|
|
|
|
self
|
|
|
|
optionAt: 'caption' put: caption;
|
|
|
|
optionAt: 'width' put: width.
|
2022-02-04 15:44:19 +00:00
|
|
|
self urlString: (markdeepDiv // 'img' @ 'src') stringValue.
|
2022-02-02 23:35:39 +00:00
|
|
|
]
|
2022-02-03 18:01:35 +00:00
|
|
|
|
|
|
|
{ #category : #'*Grafoscopio-Utils-Core' }
|
2022-02-04 15:44:19 +00:00
|
|
|
LePictureSnippet >> metadata [
|
|
|
|
^ self optionAt: 'metadata' ifAbsentPut: [ self metadataInit ]
|
2022-02-03 18:01:35 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
{ #category : #'*Grafoscopio-Utils-Core' }
|
2022-02-04 15:44:19 +00:00
|
|
|
LePictureSnippet >> metadataInit [
|
|
|
|
| surrogate |
|
|
|
|
self parent
|
|
|
|
ifNil: [ surrogate := nil]
|
|
|
|
ifNotNil: [ surrogate := self parent uidString ].
|
|
|
|
^ OrderedDictionary new
|
|
|
|
at: 'id' put: self uidString;
|
|
|
|
at: 'parent' put: surrogate;
|
|
|
|
at: 'url' put: self contentAsString;
|
|
|
|
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-03 18:01:35 +00:00
|
|
|
]
|