-
Notifications
You must be signed in to change notification settings - Fork 65
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
Pre-proposal: Specify the Markdown cell's markdown flavor #98
Comments
The opened questions already seen are:
|
Some thoughts:
For users' sake, the default should be as backwards-compatible as possible, therefore probably
The original author of Markdown has granted that fenced code blocks and tables pretty much were grossly missing, and it is widely known the reference perl implementation contains bugs and onconsistences that can never be fixed. The only real fallback is
Seems like "you change it, you buy it" it less surprising: opening a notebook shouldn't makes changes. If just consuming it (or annotating), then it should likely consume an
Sure, why not? Also it's hard as hell to "enforce" anything in an ecosystem where we can't get major players to even follow the schema. So better just to plan for it.
Would reduce portability, also see above.
As something of a counterpoint, over on #95......we're considering an even more drastic approach that collapses formerly-N, now-3 cell types to One Cell Type. So, in a nutshell going from: cells: - cell_id: cell-id-abcd-12345 cell_type: markdown special_markdown_thing: zany source: - "# Zany Markdown" to cells: cell-id-abcd-12345: source: data: text/zany+markdown: - "# Zany Markdown" |
I'm happy to see this start to get codified as its an essential step to having a real spec. The long term goal should be to specify the markdown format as rigorously as CommonMark and GitHub flavored markdown do. At least specifying which variant of markdown is supported in a notebook is a good first start. Just happy to see people moving this along. |
FWIW GitHub doesn't appear to publish a consolidated document of what is currently supported by their markdown parser. Piecing it together from their docs and blog posts, I think it currently constitutes the original spec https://github.github.com/gfm/ + tex math dollars + footnotes + emojis + diagrams. I agree something like classic gfm + tex math dollars is probably adequate as a baseline, but just noting that footnotes and diagrams should at least also be discussed. |
One idea introduced in the draft doc and JEP proposal is having a fallback rendering available for clients that don't know how to deal with the markdown variant in play. One suggestion was |
i agree in the identifying the markdown flavor. while doing so we want to do in the context of notebooks and cells. i think this enhancement proposal continues to differentiate markdown and code cells. this enhancement adds it might be important to consider what kind of precedence this divergence might set. perhaps we consider the likenesses between markdown and code cells to get the similar representations. some suggestion i have are (all schema in toml for convenience):
|
There is an interesting feature request to support defining links in one markdown cell and using them in others: jupyterlab/jupyterlab#14260. How would the proposed specification of markdown flavour interact across cells? Would it be possible that one cell has flavour X and another cell has flavour Y? If so, what would happen if a link definition is in a cell with with flavour X but link in cell Y? Would it be better to have flavour defined per-notebook rather than per-cell? What are arguments for having a per-cell definition of markdown flavour? |
in general, markdown flavors don't ever really conflict with footnotes and link definitions. their syntax is defined in the commonmark spec. even if there were multiple variants i wouldn't expect much variance across markdown variants. because of this consistency, it should be possible for notebook provides to have globally scoped references. eg with |
@krassowski I just made a comment over on the PR about the per-cell definition. However, in the context of this JEP as we're not proposing anything that is able to provide a proper fallback (i.e. a Even though in that case I am still not clear on what a frontend should do after edits to markdown cells are made in a notebook that originated elsewhere else with a different markdown flavour identified in that miimetype. |
This is a proposition to add a new key to markdown cells defining precisely the flavor of markdown used in the cell source. The associated rendered content should be stored for compatibility with the tooling ecosystem. As a side effect, it forces us to clarify the current default markdown flavor that should be used as fallback when a client does not support the specified flavor.
The focus of the associated JEP is primarily on describing current behaviour.
During the workshop we wrote a draft JEP to ease structuring the goals and discussion. You can find it on the following draft PR: #99
The text was updated successfully, but these errors were encountered: