{"id":13906250,"url":"https://github.com/showdownjs/youtube-extension","last_synced_at":"2025-04-11T16:52:27.363Z","repository":{"id":32729318,"uuid":"36319353","full_name":"showdownjs/youtube-extension","owner":"showdownjs","description":"Embed YouTube videos within showdown","archived":false,"fork":false,"pushed_at":"2022-02-17T02:32:58.000Z","size":80,"stargazers_count":19,"open_issues_count":2,"forks_count":16,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-05-09T13:14:39.071Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"gmr/helper","license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/showdownjs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-26T19:39:08.000Z","updated_at":"2024-03-10T08:22:27.000Z","dependencies_parsed_at":"2022-08-07T18:01:07.525Z","dependency_job_id":null,"html_url":"https://github.com/showdownjs/youtube-extension","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/showdownjs%2Fyoutube-extension","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/showdownjs%2Fyoutube-extension/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/showdownjs%2Fyoutube-extension/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/showdownjs%2Fyoutube-extension/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/showdownjs","download_url":"https://codeload.github.com/showdownjs/youtube-extension/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248443291,"owners_count":21104381,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-06T23:01:32.017Z","updated_at":"2025-04-11T16:52:27.342Z","avatar_url":"https://github.com/showdownjs.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"Showdown's Youtube Extension\n==========================\n\n[![Build Status](https://travis-ci.org/showdownjs/youtube-extension.svg)](https://travis-ci.org/showdownjs/youtube-extension) [![npm version](https://badge.fury.io/js/showdown-youtube.svg)](http://badge.fury.io/js/showdown-youtube) [![npm version](https://badge.fury.io/bo/showdown-youtube.svg)](http://badge.fury.io/bo/showdown-youtube)\n\n------\n\n**An extension to embed [Youtube](http://youtube.com/) and [Vimeo](http://www.vimeo.com/) videos in showdown documents using markdown syntax**\n\n## Introduction\n\nThis extension enables embedding youtube videos using markdown's image syntax. Instead of creating a new definition,\nit borrows image syntax `![foo][bar.jpg]` to create an inframe pointing to the desired video.\nAlthough it uses the same syntax as images, only valid youtube video links are actually parsed.\nBasically it looks for urls that start with:\n - `http://www.youtube.com/watch?v=` or `youtube.com/watch?v=`\n - `http://www.youtube.com/embed/` or `youtube.com/embed/`\n - `http://youtu.be/` or `youtu.be/`\n - `http://vimeo.com/`\n\n## Installation\n\n### With [npm](http://npmjs.org)\n\n    npm install showdown-youtube\n\n### With [bower](http://bower.io/)\n\n    bower install showdown-youtube\n\n### Manual\n\nYou can also [download the latest release zip or tarball](https://github.com/showdownjs/youtube-extension/releases) and include it in your webpage, after showdown:\n\n    \u003cscript src=\"showdown.min.js\"\u003e\n    \u003cscript src=\"showdown-youtube.min.js\"\u003e\n\n## Enabling the extension\n\nAfter including the extension in your application, you just need to enable it in showdown.\n\n    var converter = new showdown.Converter({extensions: ['youtube']});\n\nWhen using in node, ensure to first require the extension so it can register itself with showdown before any converters try to use it.\n\n```javascript\nvar showdown = require('showdown');\nrequire('showdown-youtube');\nvar converter = new showdown.Converter({extensions: ['youtube']});\n```\n\n## Example\n\n```javascript\nvar converter = new showdown.Converter({extensions: ['youtube']}),\n    input = '![youtube video](http://www.youtube.com/watch?v=dQw4w9WgXcQ)';\n    html = converter.makeHtml(input);\nconsole.log(html);\n```\n\nThis should output the equivalent to:\n\n```html\n\u003ciframe src=\"//www.youtube.com/embed/dQw4w9WgXcQ?rel=0\" frameborder=\"0\" allowfullscreen\u003e\u003c/iframe\u003e\n```\n\n## Video size\n\nSince youtube extension uses the image syntax for videos, you can set the video dimensions the same way.\n\n```md\n![youtube video](http://www.youtube.com/watch?v=dQw4w9WgXcQ =800x600)\n```\n\nThis should output the equivalent to:\n\n```html\n\u003ciframe src=\"//www.youtube.com/embed/dQw4w9WgXcQ?rel=0\" width=\"800px\" height=\"600px\" frameborder=\"0\" allowfullscreen\u003e\u003c/iframe\u003e\n```\n\nYou can also use units:\n\n```md\n![foo](youtu.be/dQw4w9WgXcQ =100x80)     simple, assumes units are in px\n![bar](youtu.be/dQw4w9WgXcQ =100x*)      sets the height to \"auto\"\n![baz](youtu.be/dQw4w9WgXcQ =80%x5em)   width of 80% and height of 5em\n```\n\n\n\n## Options\n\nYoutube extension reads the options from Showdown Core. So, to pass an option, use the methods explained in\n[Showdown's documentation](https://github.com/showdownjs/showdown#setting-options).\n\n\n### youtubeHeight\nSets the default height of the Youtube iframe.\n\n\n### youtubeWidth\nSets the default width of the Youtube iframe.\n\n\n### smoothLivePreview\n\n(borrowed from Showdown core)\n\nWhen using the extension in live editors (for instance, with angularjs), every time the text is changed, a new iframe is created.\nThis leads to a lot of requests done to youtube, which translates as an overall feel of sluggishness.\nTurning **smoothLivePreview** on replaces the actual video objects (iframes) with an image placeholder. This way the live editing\nfeels more smooth.\n\nThis should only be enabled during live preview and not on the final document.\n\n\n### youtubeUseSimpleImg\nOnly used if smoothLivePreview is on.\n\nUses a simple black image preview instead of an svg. This is quicker and ensures max compatibility with older browsers.\n\nDefault is false\n\n\n## License\nThese files are distributed under BSD license. For more information,\nplease check the [LICENSE file](https://github.com/showdownjs/youtube-extension/blob/master/LICENSE) in the source code.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshowdownjs%2Fyoutube-extension","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshowdownjs%2Fyoutube-extension","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshowdownjs%2Fyoutube-extension/lists"}