yepstepz / remarkable-youtube

Renders YouTube video links with iframe

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

remarkable-youtube

npm version npm

Remarkable plugin renders YouTube links as iframe.

Installation

  • npm: npm install --save-dev remarkable-youtube

  • yarn: yarn add -D remarkable-youtube

Usage

const Remarkable = require('remarkable');
const youtube = require('remarkable-youtube');
const md = new Remarkable();

md
  .use(youtube, {
    className: 'youtube-iframe'
  });

In markdown files write link like:

[Video](youtube:YOUR_VIDEO_ID)

Options

className {String}

Additional class name to add on iframe element.

origin {String}

Specify web-site origin parameter.

related {Boolean}

Specify if YouTube player should show related videos at the end of a playback.

attr {String}

Specify the attribute name to use for source. Default value src. Could be used to make videos lazy loaded, for example.

About

Renders YouTube video links with iframe

License:MIT License


Languages

Language:JavaScript 100.0%