1.3.2 ā€¢ Published 1 month ago

remark-youtube v1.3.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

remark-youtube npm.io

Embed YouTube player in your Markdown.

šŸ‘ This package is ESM only!

āŒ CommonJS modules not supported!

Install

  1. Install plugin to your site:
npm i remark-youtube
  1. Setup plugin:
import { unified } from 'unified'
import remarkParse from 'remark-parse';
import remarkRehype from 'remark-rehype';
import rehypeStringify from 'rehype-stringify';
import remarkYoutube from 'remark-youtube';

const input = 'your markdown content';

unified()
    .use(remarkParse)
    .use(remarkYoutube)
    .use(remarkRehype)
    .use(rehypeStringify)
    .process(input)
    .then((file) => {
        console.log(String(file))
    });

Usage

## Watch this video

https://youtu.be/enTFE2c68FQ

https://www.youtube.com/watch?v=enTFE2c68FQ

Usage with react-markdown

import ReactMarkdown from 'react-markdown';
import remarkGfm from 'remark-gfm';
import remarkYoutube from 'remark-youtube';

interface PageProps {
    markdownContent?: string
}

export const Page: React.FC<PageProps> = ({ markdownContent = '' }) => {
  return (
    <ReactMarkdown remarkPlugins={[remarkGfm, remarkYoutube]}>
        {markdownContent}
    </ReactMarkdown>
  );
};

License

MIT

1.3.2

1 month ago

1.3.1

3 months ago

1.2.0

11 months ago

1.1.1

12 months ago

1.3.0

10 months ago

1.2.1

11 months ago

1.1.0

1 year ago

1.0.1-2

1 year ago

1.0.1-1

1 year ago

1.0.1-0

1 year ago