github / markup

Determines which markup library to use to render a content file (e.g. README) on GitHub
MIT License
5.84k stars 3.4k forks source link

Add ability to ignore YAML front matter #994

Open eggshell opened 7 years ago

eggshell commented 7 years ago

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

kivikakk commented 7 years ago

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

andyjeffries commented 7 years ago

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...

kivikakk commented 7 years ago

@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.

morallo commented 3 years ago

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

mwestphal commented 1 year ago

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

jonnypetraglia commented 3 weeks ago

I wish this was possible.

Is it not? I see this issue was mentioned in "Rework Documentation completely" but the conversation seemed to be inconclusive.