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

27 lines
615 B
Smalltalk

Extension { #name : #LePictureSnippet }
{ #category : #'*Grafoscopio-Utils-Core' }
LePictureSnippet >> asMarkdeep [
| output |
output := '' writeStream.
output
nextPutAll: self metadataDiv;
nextPutAll: self centeredFigure; lf;
nextPutAll: '</div>'; lf; lf.
^ output contents
]
{ #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>'
]