markup icon indicating copy to clipboard operation
markup copied to clipboard

Add ability to ignore YAML front matter

Open eggshell opened this issue 8 years ago • 6 comments

Since github officially supports jekyll as its static site generator for github pages, there should be a way to ensure front matter can be excluded from rendering when being displayed on github.com

eggshell avatar Feb 09 '17 04:02 eggshell

This a tricky one; do you have any suggested implementations? We could scan the front matter for a particular key, for instance.

kivikakk avatar Mar 16 '17 06:03 kivikakk

I was just looking for this and was going to build it in my app. I'm planning on doing it like this:

html = my_markdown.gsub(/\A\-\-\-(\r\n?|\n).*?\-\-\-(\r\n?|\n)+/m, '')

That removes an initial line of --- followed by an OS-flexible line break, then a minimum number of characters until a closing --- and one or more OS-flexible line breaks.

Might help...

andyjeffries avatar Mar 16 '17 10:03 andyjeffries

@andyjeffries :wave: Thanks for that! Seeing as we're already parsing it out, I think the actual act of removing it should be simple; my concern is more around controlling how we trigger the behaviour. I'm struggling to come up with a neat way to do this that doesn't feel orthogonal to the design.

kivikakk avatar Mar 16 '17 10:03 kivikakk

What about defining a specific variable yaml-frontmatter-display: false inside the frontmatter itself?

morallo avatar Jul 27 '21 15:07 morallo

I wish this was possible. The front matter table the appears in github has no purpose.

mwestphal avatar Oct 22 '22 02:10 mwestphal