-
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] Decide what to do about class="hidden" #3694
Comments
Quick thoughts here:
|
👍 I filed #3755 to do this in the JS docs. |
Since #3512 is closed now, it might be worth looking at this again. For the code block comments, I assume, it contains content we want to keep. Perhaps worth already converting them to HTML comments (via the element that got hidden?) and fill a PR so we can omit them from the consideration here. |
I think there are a couple of things we need before this is closed. (1) a resolution on what this means for our our "MDN Markdown" spec. I think this part is done in #3512, and recorded at https://developer.mozilla.org/en-US/docs/MDN/Contribute/Markdown_in_MDN#example_code_blocks (2) a resolution on what our conversion process from HTML to Markdown should look like. I think this part is not yet done but could look something like:
A simpler and possibly safer version, which involves more manual work:
|
I just updated #3350 (comment) with a description of what the converter should do with |
This overlaps a bit with "[Markdown] Decide how to represent code blocks".
In MDN we use
class="hidden"
to have content that's not displayed. I think there are two categories here:pre
blocks that we want to participate in a live sample but not be shown to readersIf there are more categories than this it would be great to know about them!
Dealing with comments
The large majority of these are the comments after interactive examples and BCD tables, that say something like:
A small minority are more targeted to particular bits of content.
To deal with comments, the more conservative option is to convert them to HTML comments. It ought to be possible to automate a lot of this, as long as we can reliably distinguish between this kind and the "hidden code" kind.
The less conservative option is just to delete them (or at least, to delete the boilerplate ones that come after interactive examples and BCD tables).
Dealing with hidden code
The obvious suggestion here is to:
hidden
attribute is not on a code block directly (for example, it's on a containing<div>
, to transfer the attribute from the<div>
to any blocks it contains.This isn't always going to work, though, because as @chrisdavidmills points out in #3512 (comment), we have some live samples where all the sources and the heading are inside
<div class="hidden">
, and these need some different treatment.Some numbers
I looked at how many
hidden
attributes exist in our docs, and in particular:This is pretty much what we might expect. It would be worth analysing the hidden-code group more deeply to see if many of them seem to be automatically fixable.
As far as the JS docs are concerned, almost all the uses of
hidden
are for comments. I dug a bit more deeply into this, and almost all of the comments (all except 20-30) are associated with BCD or interactive examples. One nice thing about this is that we can convert to HTML comments in advance of a Markdown conversion.The text was updated successfully, but these errors were encountered: