TiddlyWikiPharo/repository/TiddlyWiki/WebVideo.extension.st

24 lines
606 B
Smalltalk
Raw Normal View History

2024-05-29 14:42:33 +00:00
Extension { #name : #WebVideo }
{ #category : #'*TiddlyWiki' }
WebVideo >> asTiddler [
| tiddler body |
tiddler := Tiddler new
title: self title.
tiddler customFields
at: 'uid' put: self videoId;
at: 'author' put: self author;
at: 'authorId' put: self authorId;
at: 'duration' put: self duration.
body := '' writeStream.
body
nextPutAll: '<<richlink "https://www.youtube.com/watch?v=', self videoId ,'">>';
nextPutAll: '
* ''''Duración:'''' {{!!duration}}
* ''''Autor/a:'''' {{!!author}}'.
tiddler text: body contents withInternetLineEndings.
^ tiddler
]