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