-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change (or drop) removal of YAML front matter from Markdown before rendering #14772
Comments
Thanks @fperez! This is something that is tripping up a lot of the users of the MyST extension as we make extensive use of YAML frontmatter for title, authors, affiliations, etc. It was unintuitive to us as extension authors that this is happening in the model, and there is no way to access this from the renderer once it is stripped off of the markdown value. Looking forward to any comments! |
Welp... in my case, the JEP front matter was just breaking ToC, due to hard-coded whitespace "grammar" inconsistencies around a leading At the implementation level: doing weird stuff to As to stripping it out: I guess I understand the motivation, sort of. It seems front matter is very frequently destructively consumed by downstreams, and not passed directly to end users. Looking at specifications for "correct" frontmatter behavior: it's not part of the OG markdown spec, or GFM. So pretty much that means the Jekyll handling of it is probably the "canonical" usage, but that is purely a processing engine, and doesn't provide any kind of intermediate, partially-authored UI. So not a lot of help there. To my original frustration with even having to do front matter on that issue, Jupyter's own JEPs: why expend effort having metadata if it doesn't appear anywhere in the output without a bunch of clicks to other sites? The underlying data in |
Problem
Today, the default (as shown in this JupyterLab-MyST issue behavior is for YAML frontmatter to be entirely stripped out of the document before reaching the renderer. Since we now have renderers, such as JupyterLab-MyST, that can properly render frontmatter, perhaps we should reconsider this decision.
As it stands, unless the user changes the default, they won't see frontmatter in MyST-rendered documents.
Proposed Solution
I'm not 100% sure, but it seems to me that we should send the entire document to the renderers, and leave it to them to strip out parts of a file they can't handle. For example, right now if the default renderer were to improve its frontmatter handling, it still wouldn't benefit users as the frontmatter isn't making it to the renderer at all.
I'm inclined to suggest removing that setting altogether, but at least switching the default to False seems better to me.
In any case, mostly opening this for discussion/input, as there's competing constraints at play.
Additional context
Relevant to this: #14200, #14203.
CC @rowanc1, @agoose77.
The text was updated successfully, but these errors were encountered: