From 8634047be91da086c986c0c47ed6ca9eefcbe18b Mon Sep 17 00:00:00 2001 From: Offray Luna Date: Wed, 21 Aug 2024 11:12:28 -0500 Subject: [PATCH] Debuggin picture importation code. --- src/MiniDocs/LePictureSnippet.extension.st | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/MiniDocs/LePictureSnippet.extension.st b/src/MiniDocs/LePictureSnippet.extension.st index af0f1d0..4efc120 100644 --- a/src/MiniDocs/LePictureSnippet.extension.st +++ b/src/MiniDocs/LePictureSnippet.extension.st @@ -41,6 +41,22 @@ LePictureSnippet >> contentFrom: markdeepDiv [ self urlString: (markdeepDiv // 'img' @ 'src') stringValue. ] +{ #category : #'*MiniDocs' } +LePictureSnippet >> fromDictionary: anOrderedDictionary [ + | sanitizedUrl| + sanitizedUrl := (anOrderedDictionary at: 'url'). + sanitizedUrl := sanitizedUrl copyFrom: 5 to: sanitizedUrl size - 3. + self + uid: (LeUID new uidString: (anOrderedDictionary at: 'id')); + parent: (anOrderedDictionary at: 'parent'); + createTime: (LeTime new time: ((anOrderedDictionary at: 'created')asDateAndTime)); + editTime: (LeTime new time: ((anOrderedDictionary at: 'modified') asDateAndTime)); + editEmail: (anOrderedDictionary at: 'modifier'); + createEmail: (anOrderedDictionary at: 'creator'); + urlString: sanitizedUrl; + caption: (anOrderedDictionary at: 'content') first +] + { #category : #'*MiniDocs' } LePictureSnippet >> fromMarkdeep: markdeepDiv [ ^ markdeepDiv asSnippetDictionary asLepiterSnippet