LePictureSnippets from Markdeep: importing from plain content strings (not yet tested with multiline captions).
This commit is contained in:
parent
eda63bfc3a
commit
5c4f6ab55b
@ -30,6 +30,21 @@ LePictureSnippet >> fromMarkdeep: markdeepDiv [
|
|||||||
^ markdeepDiv asSnippetDictionary asLepiterSnippet
|
^ markdeepDiv asSnippetDictionary asLepiterSnippet
|
||||||
]
|
]
|
||||||
|
|
||||||
|
{ #category : #'*MiniDocs' }
|
||||||
|
LePictureSnippet >> fromString: aString [
|
||||||
|
"aString should be a valid Markdown/Markdeep image string"
|
||||||
|
| args captionTemp urlTemp |
|
||||||
|
|
||||||
|
args := aString splitOn: ']('.
|
||||||
|
captionTemp := args first.
|
||||||
|
captionTemp := captionTemp copyFrom: 3 to: captionTemp size.
|
||||||
|
urlTemp := args second.
|
||||||
|
urlTemp := urlTemp copyFrom: 1 to: urlTemp size - 1.
|
||||||
|
self caption: captionTemp.
|
||||||
|
self urlString: urlTemp.
|
||||||
|
^ self
|
||||||
|
]
|
||||||
|
|
||||||
{ #category : #'*MiniDocs' }
|
{ #category : #'*MiniDocs' }
|
||||||
LePictureSnippet >> metadata [
|
LePictureSnippet >> metadata [
|
||||||
^ self optionAt: 'metadata' ifAbsentPut: [ self metadataInit ]
|
^ self optionAt: 'metadata' ifAbsentPut: [ self metadataInit ]
|
||||||
|
@ -22,7 +22,7 @@ OrderedDictionary >> asLepiterSnippet [
|
|||||||
(self at: 'className') = 'LePictureSnippet'
|
(self at: 'className') = 'LePictureSnippet'
|
||||||
ifTrue: [
|
ifTrue: [
|
||||||
response := LePictureSnippet new.
|
response := LePictureSnippet new.
|
||||||
"response code: (self at: 'content')"
|
response fromString: (self at: 'content')
|
||||||
].
|
].
|
||||||
response
|
response
|
||||||
uid: (LeUID new uidString: (self at: 'id'));
|
uid: (LeUID new uidString: (self at: 'id'));
|
||||||
|
Loading…
Reference in New Issue
Block a user