From 973df93f58309b0687de919b613d1fb82160d4a6 Mon Sep 17 00:00:00 2001 From: Offray Luna Date: Tue, 20 Dec 2022 09:25:49 -0500 Subject: [PATCH] Implementing Markdeep export for LePictureSnippet. --- src/MiniDocs/LePictureSnippet.extension.st | 35 +++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/src/MiniDocs/LePictureSnippet.extension.st b/src/MiniDocs/LePictureSnippet.extension.st index 78e945b..ecf052c 100644 --- a/src/MiniDocs/LePictureSnippet.extension.st +++ b/src/MiniDocs/LePictureSnippet.extension.st @@ -6,10 +6,43 @@ LePictureSnippet >> asMarkdeep [ output := WriteStream on: ''. output nextPutAll: self metadataDiv; - nextPutAll: self centeredFigure; + nextPutAll: '![](', self urlString, ')'; nextPut: Character lf; nextPutAll: ''; nextPut: Character lf; nextPut: Character lf. ^ output contents ] + +{ #category : #'*MiniDocs' } +LePictureSnippet >> metadata [ + ^ self optionAt: 'metadata' ifAbsentPut: [ self metadataInit ] +] + +{ #category : #'*MiniDocs' } +LePictureSnippet >> metadataDiv [ + | output | + output := WriteStream on: ''. + output + nextPutAll: '
'. + ^ output. + +] + +{ #category : #'*MiniDocs' } +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: 'created' put: self createTime asString; + at: 'modified' put: self latestEditTime asString; + at: 'creator' put: self createEmail asString; + at: 'modifier' put: self editEmail asString; + yourself +]