Include html

Is there a way to include html in markdown (and if not, why not).

I find that I have to resort to all sorts of trickery, which is contrary to the ease and maintainability of sites using Markdown.

For instance, the (beta) video inclusion can be done in twig, but not (yet) in Markdown. I think including html in Markdown is ugly, but creating ad hoc twig templates just to show a video worse.

You should be able to just put HTML in markdown. Markdown totally supports that.

If you want to put markdown in HTML, that’s a little tricker, but is supported if you enable markdown extended in the page header.

What specific HTML is giving you problems?

FYI we use the Parsedown Markdown library and they have a number of test related to HTML in markdown: http://parsedown.org/tests/

Wow. I feel dumb again. Thanks.

Not my intention!

Do want to say though that if you are pasting in some simple YouTube code or something, it could be fine to just do it on the page.

However, someone already wrote a Video plugin (VideoEmbed) that ensures that code is responsive and provides other features.

If you start needing something a few times, it might be a perfect opportunity for a plugin.

checked the docs and couldn’t find anything on embedding html, but I should have just tried.

In my case it’s just the one video, because I’m porting a site into grav. Then cut-and-paste is by far the least amount of work. But I will keep videoembed in mind for future projects

Hi, I quite can’t get, how does that work… installed this plugin with “bin/gpm install videoembed”: SUCCESS! Now, in sidebar, wanted to add Video Of The Week… instructions say, that simple address “https://www.youtube.com/watch?v=SOME_VIDEO” is converted into “<iframe…”, but instead I’m getting this address as text there. DO I need to compile anything or?

Really need @namaless to answer your question. You can try reaching him on our Gitter chat: https://gitter.im/getgrav/grav

Hello PumWalters, for videoembedding you don’t need to add iframe code or anyother html code, you put in the page content ONLY the video url, example https://www.youtube.com/watch?v=DVwHCGAr_OE and the plugin convert with iframe version.

For Boryszeblade, you need to edit your theme if every week you need to change this, or give me more informations about what you want, and I reply to you with what you can :slight_smile:

Well, I found out, what my problem is. When I put such a link inside .md file it’s being rendered correctly. Sidebar plugin is not a .md file :slight_smile: When I add this link there, nothing can be rendered since it’s not a markdown file. I simply added manually and will change it every week or so. Ty!