Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
ReadableStream.from() static method #28316
ReadableStream.from() static method #28316
Changes from all commits
5f485f0
4779a71
fca16cf
71ab25c
9cbcb46
9df30b6
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have a template structure for live samples: https://developer.mozilla.org/en-US/docs/MDN/Writing_guidelines/Page_structures/Code_examples#traditional_live_samples. Although technically authors have a lot of flexibility in how to organize them, I'd prefer us to use a much more consistent approach, because it might make it possible for us to extract live samples and have them be usable in other contexts.
This would include having code blocks in a consistent order, with subheadings, and with prose in a consistent place (at the start of the example)
But maybe I'm fighting a losing battle here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wbamberg I did it this way, in particular, because I understood that now the code blocks include their "type" the headings are not needed or wanted. With their removal I find the documentation easier to parse, because the isn't quite so much scrolling between the relevant bits.
If you tell me I must change, then I will, but I'm not keen :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see you marked this as requiring approval, so you do need it changed. Bah. Will do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't really tell you you must change. I can say that unless examples are consistently organized then it won't be possible to include them in other contexts, and any tool which tries to do that will most likely throw them out (or maybe we will just throw out the explanatory prose, and hope the example still makes sense).
But I don't know if this use case is important enough to be worth the cost of imposing more constraints on authors. I think it is, but maybe others don't.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added the sections in for the first example, unhiding the code that shows how logging works. In the second section I just have the JavaScript section: showing it once perhaps makes sense so there is no "magic" involved in the description, but showing it twice in the page when it is not central to the example seems unhelpful.
I "fairly" strongly feel that this use case is not workable, or even all that useful, and certainly not worth the constraint. Remember all the reasons we decided to remove the page inclusion macro - same problems. The "fairly" is because perhaps you have thought through some cases where content mismatch is not an issue.
I think these headings should be removed. But only after it's agree and https://developer.mozilla.org/en-US/docs/MDN/Writing_guidelines/Page_structures/Code_examples is updated :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/orgs/mdn/discussions/439