-
Notifications
You must be signed in to change notification settings - Fork 22.5k
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
[Markdown] Prepare Web/API docs for Markdowning #7898
Comments
Resolving <sup> and <sub>There's an issue listed above to decide what to do about For Web/API there are no uses of https://developer.mozilla.org/en-US/docs/Web/API/RTCIceCandidateStats/priority (just two here) Since these usages are in just a few pages, I'm going to propose we keep them. |
I'd go further and say that unless the More generally, markdown is there to help editors and reviewers. In the cases where it doesn't, we should have no qualms about using HTML. Main case in point being tables. |
Tables in Web/APIThere are 980 tables in the Web/API documentation. Of these we are not converting 597. Properties tablesOf the unconverted tables, 362 are I think these are not getting converted because they have a header column. Even if they didn't, we might decide we like this different styling enough to want to leave these tables as HTML, so they can still get the It would be good to have a consistent policy here - if we want to keep them in HTTP then we probably also want to keep them in Web/API, and we should document The restSo if we don't consider those Are we converting too few tables?This proportion is more or less in line with other areas we've migrated so far. I've looked through the tables that aren't being converted, and there are a few themes:
Then there are clusters that use non-standard page structures that involve lots of tables. This includes the IndexedDB docs, lots of the file-related docs, and some of the SVG docs. For example: It would be good to fix these up to use standard structures, but that's a lot of work that I don't want to include now. Finally there are tables that are "accidentally" unconvertible, that could be made convertible with small changes that improve the pages anyway. I've tried to address these in #8588. Are we converting too many tables?GFM tables are nice for simple tables but become unusable when the table rows get too long. We should pick a max length and refuse to convert tables longer than that. I propose 150 or 200 characters as the max. Of the 396 converted tables:
It would be nice if the conversion tool helped us here, but I think we can do this in content, if we can agree on max length. |
Let's keep them for the moment (for events). When we have a better idea, they will be easy to find & replace. Note that there are a few events that have a
Agreed.
Do we have many of these? It may be interesting to have a look at these and to decide on a case by case basis.
I think we should convert these to the modern structure. It is annoying to do, but it has to be done anyway and that way we won't drag these old structures into the new shiny Markdown world. If you have a list, happy to give you a hand.
I am not sure this is so easy to define. Automatic line breaks are making quite a few "long" tables shorter on display, aren't they? |
@teoli2003 @wbamberg All sounds very pragmatic. I'm leaning more and more towards the "default" should be not to not convert tables to markdown. They make things harder to edit and add no benefit to review. Therefore they do not add any value in markdown. Anyway, IMO
|
To help answer these questions I've written up an analysis for the pages that contain (non- Column B lists the reason the table was unconverted. There are a few patterns here as I said:
So one thing that came out of this analysis is that there are quite a few tables that use In general though I don't think we should try to change pages that have cells containing multiple paragraphs or lists (for example, https://developer.mozilla.org/en-US/docs/web/api/idbcursor/continue#exceptions). It's quite reasonable for authors to want to do things like this, and I think undoing changes like this would make the docs worse. We do have to acknowledge and work around the limitations of GFM table markup.
Well there is a list in the spreadsheet, but I don't really want to do this for the Markdown work. It's a substantial amount of work including adding a fair few new pages. And it's not really related to Markdown. And we are dragging all kinds of terrible things into the Markdown world already :).
I'm not sure what "automatic line breaks" means here. If you mean soft wrapping added by editors, the way I'm calculating this is with a Python script that reads a converted MD file line by line hunting for GFM tables, and reporting the line length. I don't think this is going to be affected by that. Or did you have something else in mind? |
I'm not sure what work "default" is doing here. There are really only 3 options:
I don't think anyone's arguing for (1) so we're choosing (2) or (3). (2) has the great benefit of simplicity and clarity in the meta-documentation. However I think there are a substantial number of tables (probably somewhere between a third and a half) in MDN which work well as GFM tables. If we're prepared to accept that, and that the value they add is worth the extra meta-documentation complexity, then we are really just discussing the conditions in which we want GFM tables. I'm trying to document these conditions in https://developer.mozilla.org/en-US/docs/MDN/Contribute/Markdown_in_MDN#tables. If we want to adjust this in specific ways then I'm happy to do so - and I think defining a max line length is worth doing, for example.
+1
I think this is |
Ah, I mean our "intent" is to convert as many tables as possible to GFM - we try to find ways to move to GFM if we can and the table still works. I was suggesting that a change in intent to really only look at a very small subset that really suit GFM. I am leaning towards "2" because as an editor I am not sure how many tables I have seen where using GFM will actually make things easier to edit. You're suggesting "(probably somewhere between a third and a half)". I'd say that is around the number you can convert and which look OK. That doesn't make them easier to edit and review changes in. Try and edit any table with more than 2 columns or over a page width of chars and and you'll see what I mean - spotting the change is hard in review, and fixing the lines to have the nice layout is irritating. The number of easy to edit GFM tables would be much smaller - IMO order of 5 to 10%. Those with 2 columns, a small number of rows, no need for multiple paragraphs or bullets, width less than a page for all lines. That said, I'll go with the consensus. What we are doing now is completely workable. |
I'm not sure about those numbers and wouldn't be without doing some real analysis. In general I am sympathetic to your worries here - I agree that there is a lot of space for tables that are technically Markdownable but are not actually usable in Markdown format, and I worry that we are not getting this right. That said: to me this isn't about "intent" so much as defining clear guidelines for what makes a table suitable for Markdown, beyond the hard requirements (i.e. no block elements in cells, fancy rowspan...). Line length is definitely a good one here. I'm not sure about number of cols or rows. We don't currently consider this, I think 2 cols is pretty limiting, and I'm not sure how limiting row count is useful. I find that it's difficult to get a sense about what is usable - which restrictions we should define - without spending some time working with these tables. So I hope it's good enough to make the best call we can for now, and be open to revisiting this later on if we want to adjust things. One thing I'm definitely not doing is making changes that regress the content, and most of the changes clearly improve it. For example, many of the "make tables Markdownable" changes are to add proper headings to tables that should have them but don't. That's an improvement to the content whether it stays in HTML or gets converted to GFM. |
Yes, I made up the numbers :-).
We don't auto-fix the layout (do we?) so by default that is manual work to alighn on change. It is fine for small tables, but quickly becomes painful. With more columns the alignment can become more annoying.
Could not agree more. All this work is useful and the end result is better. |
Prettier will take care of this for you. I just filed #8729 to figure out how we can run Prettier on commit, but you can configure your editor to format on save. |
Re: |
I've filed #8736 for this, using 150 characters as the max length. |
I'd like to summarise the state of the conversation about converting tables:
Other tables (honestly not that many after all those exclusions) are being converted. |
I just ran a conversion of Web/API from mdn/content at 59e9fd4 . Here's the summary conversion report:
(full report is at https://gist.github.com/wbamberg/06ebf797687f466a7cca503aeee13ece) Note the unconverted Apart from that the only unconverted elements are:
For So I think this work is done and we can close this issue - once #8776 we can create a PR for the conversion. |
Agree. FWIW you said "Prettier will take care of this for you". Unless it is part of the standard yari toolchain, it is "dead to me". So no that is not a valid assumption. |
This is a tracking bug for the work we have to do to prepare the Web/API documentation for Markdown conversion.
id
attributes except on headings: filed as [Markdown] [ Web/API] Removeid
attributes #7899<strong><code>
markup: fixed in [Markdown] [Web/API] Fix unconvertible strong/code markup #8544The text was updated successfully, but these errors were encountered: