markup
markup copied to clipboard
Add ability to ignore YAML front matter
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
This a tricky one; do you have any suggested implementations? We could scan the front matter for a particular key, for instance.
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 :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.
What about defining a specific variable yaml-frontmatter-display: false
inside the frontmatter itself?
I wish this was possible. The front matter table the appears in github has no purpose.