Skip to content

Instantly share code, notes, and snippets.

@jdkato
Created February 17, 2019 23:17
Show Gist options
  • Select an option

  • Save jdkato/b9f3e9d74059a9d91df51c7fd2365bde to your computer and use it in GitHub Desktop.

Select an option

Save jdkato/b9f3e9d74059a9d91df51c7fd2365bde to your computer and use it in GitHub Desktop.
def main(meta, video, clip=[]):
"""Example directive for including a YouTube video.
`meta` is a dictionary containing any front matter that was
listed in the Markdown file.
`clip` specifies an optional start and stop point for the video.
"""
link = "https://www.youtube.com/embed/{0}".format(video)
if clip:
link += "?start={0}&end={1}".format(*clip)
return '<iframe src="{0}"></iframe>'.format(link)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment