vmg / sundown

Standards compliant, fast, secure markdown processing library in C
1.99k stars 385 forks source link

Support the HTML5 Video tag as an Extension #112

Closed anaisbetts closed 12 years ago

anaisbetts commented 12 years ago

Now that the HTML5 Video tag is evolved to the point where it's reasonable to use, it'd be more awesome if we could be embedding screencasts / product demos / whatever in Markdown content.

To do this, I've started implementing an extension to Markdown to support the video tag. I'm proposing the following syntax, which is completely up for debate / changeable:

!![Alt Text](/path/to/video1.mp4,/path/to/video2.webm /path/to/poster.jpg)

The main difference is the ability to specify more than one URL, corresponding to the multiple URLs in the

TODO:

[X] - Add a new callback for video
[X] - Implement a renderer for the callback
[ ] - Add a new parse function to parse the video tag
vmg commented 12 years ago

Nice C, brah. :+1:

You know however, that I despise both

  1. The idea of embedding videos in Markdown documents. WHY WOULD YOU DO THAT. WE ARE PROGRAMMERS
  2. The idea of adding even more custom elements to the already cluttered Markdown syntax of .com

Can I beg you to reconsider this, before jumping in the clusterfuck that is the actual parsing code? I absolutely don't see the use case for this, besides the GitHub blog where we can already embed videos using plain HTML. I don't want videos on my READMEs, I want plaintext.

mildsunrise commented 12 years ago

@tanoku I disagree with your opinion:

From the Markdown guide:

Markdown is a front-end to (X)HTML.

So, Markdown is not only for programmers. In fact, it's used in my school for displaying the web posts. Thus, won't still be fine to have a Sundown extension for displaying videos? That way, my Physics teacher (which knows nothing about HTML) could embed a video explaining our last homework.

Oh, and it's an extension. Some sites may use it and some others may not. But Sundown should give his users the possibility of enabling it. Don't you think?

FSX commented 12 years ago

Markdown is not only used for READMEs. This would be useful on blogs.

Why not use the image tag instead of adding extra syntax? If that's possible of course.

gampleman commented 12 years ago

How about having this syntax:

 ![Alt Text](/path/to/poster.jpg /path/to/video1.mp4,/path/to/video2.webm)

It's (somewhat) backward's compatible to other markdown implementations.

FSX commented 12 years ago

I think that looks nicer. :)

lepture commented 12 years ago

@gampleman :+1:

@tanoku many people write blog in markdown, it would be great for them.

mildsunrise commented 12 years ago

@gampleman yes, it definitively looks nicer :+1:

craigbarnes commented 12 years ago

Now that the HTML5 Video tag is evolved to the point where it's reasonable to use, it'd be more awesome if we could be embedding screencasts / product demos / whatever in Markdown content.

@xpaulbettsx You already can. Just use inline HTML in the Markdown document. Something that's composed entirely of metadata doesn't really need a shorthand syntax.

That way, my Physics teacher (which [sic] knows nothing about HTML) could embed a video explaining our last homework.

@jmendeth If HTML can do it and Markdown doesn't make it any more readable -- why not just use HTML? If someone can learn Markdown, they can learn the equivalent HTML.

mildsunrise commented 12 years ago

@vmg please, could you close or merge this pull at once? If you don't want to add this extension, it's fine, we won't shoot you. ;)

Thanks.

anaisbetts commented 12 years ago

Let's just kill this with :fire:

vmg commented 12 years ago

Yeah, sorry I overlooked this. The video tag is 99% metadata, so if you need to embed videos in a Markdown document, you can just paste the HTML directly. It makes little sense to have a shorthand for this.