Joplin: Create a Markdown-it plugin to support embedded videos

Created on 9 Mar 2020  Â·  10Comments  Â·  Source: laurent22/joplin

Videos would be embedded like so:

[My YouTube video](https://www.youtube.com/watch?v=StTqXEQ2l-Y)

So it is valid Markdown that works as a simple link by default.

However, when the plugin is enabled, it would parse the Markdown links in the page and, when it is a video, display a video player. For now, we only need to support YouTube, but the code should be generic enough to add more video platforms later on.

desktop enhancement good first issue mobile

Most helpful comment

Do you mean to install the plugin then open the plugin's source code where the link destination is parsed and then only keep the code with accepts the standard format?

I'm not sure what you mean. You're free to start from that existing plugin if you want. But to be honest the bulk of the work will be in detecting and parsing the YouTube URL and this is not in the existing plugin. Maybe start from scratch with a new plugin, and copy/paste the parts of the other plugin that might be useful (in particular the part to render the YouTube HTML code).

All 10 comments

@laurent22 I want to work on this, but it seems to be a plugin that already does this, here is it okay to just integrate it into the codebase?

I saw it but it's not good because it unecessarily introduces non standard markup. Perhaps it can be used as a starting point to generate the html markup.

okay, so you basically want the same functionality replicated, but should generate standard markup(semantic HTML)?

No I mean the input Markdown should be standard. The output HTML I don't mind so much as long as it's reasonably clean.

Their Markdown looks like this:

@[youtube](dQw4w9WgXcQ)

But that's not good as it's not standard and, if the plugin is not enabled, it won't work at all. So our Markdown should look like this:

[youtube](https://www.youtube.com/watch?v=dQw4w9WgXcQ)

which is standard. It's actually even easier to implement since markdown-it already parses this by default. You'll need to hook into link_open I think.

No I mean the input Markdown should be standard. The output HTML I don't mind so much as long as it's reasonably clean.

Their Markdown looks like this:

@[youtube](dQw4w9WgXcQ)

But that's not good as it's not standard and, if the plugin is not enabled, it won't work at all. So our Markdown should look like this:

[youtube](https://www.youtube.com/watch?v=dQw4w9WgXcQ)

which is standard. It's actually even easier to implement since markdown-it already parses this by default. You'll need to hook into link_open I think.

okay, I will give this a try

No I mean the input Markdown should be standard. The output HTML I don't mind so much as long as it's reasonably clean.

Their Markdown looks like this:

@[youtube](dQw4w9WgXcQ)

But that's not good as it's not standard and, if the plugin is not enabled, it won't work at all. So our Markdown should look like this:

[youtube](https://www.youtube.com/watch?v=dQw4w9WgXcQ)

which is standard. It's actually even easier to implement since markdown-it already parses this by default. You'll need to hook into link_open I think.

Do you mean to install the plugin then open the plugin's source code where the link destination is parsed and then only keep the code with accepts the standard format?

Do you mean to install the plugin then open the plugin's source code where the link destination is parsed and then only keep the code with accepts the standard format?

I'm not sure what you mean. You're free to start from that existing plugin if you want. But to be honest the bulk of the work will be in detecting and parsing the YouTube URL and this is not in the existing plugin. Maybe start from scratch with a new plugin, and copy/paste the parts of the other plugin that might be useful (in particular the part to render the YouTube HTML code).

@laurent22 I read the conversation in the @Rishgod 's PR. Can i still work on this issue?

Considering the last PR wasn't merged can I work on this issue? If I can then can you give me any clue how I should approach solving this issue?

Yeah sure. I am not working on that currently.

On Sat, Aug 29, 2020, 11:05 AM Koushik Sahu notifications@github.com
wrote:

Considering the last PR wasn't merged can I work on this issue?

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/laurent22/joplin/issues/2706#issuecomment-683240510,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AK7TM42IVYOZFNS3NUIRPJ3SDCHT5ANCNFSM4LEP2UBQ
.

Was this page helpful?
0 / 5 - 0 ratings