Skip to content
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

unwanted whitespace/indentation in playable editors (interactive examples) #28174

Closed
glmvc opened this issue Jul 25, 2023 · 4 comments · Fixed by mdn/css-examples#153
Closed
Labels
Content:Learn:CSS Learning area CSS docs help wanted If you know something about this topic, we would love your help!

Comments

@glmvc
Copy link
Contributor

glmvc commented Jul 25, 2023

MDN URL

https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Selectors/Type_Class_and_ID_Selectors#type_selectors

What specific section or headline is this issue about?

the interactive examples (playable editors)

What information was incorrect, unhelpful, or incomplete?

not a big deal imho, but i wanted to bring this up a while ago because i've come across it a few times before (especially in the learning area) and today I've noticed it again...

the html files for the interactive examples/editors (iframes; rendered with the EmbedGHLiveSample macro) contain all whitespace from their original files.
as it is the case atm, this can be annoying when editing, since most of the time you will start with an indentation of 4 spaces on a newline.
and on lines where a default indentation would be appreciated/expected, there is almost never an indentation...

often there is also weird formatting in the interactive examples - i guess this is maybe the result of code formatting with prettier?

another point is the fact that rendered code blocks on mdn articles have a default indentation of 2 spaces.

see the following screenshots for understanding:

Screenshot 2023-07-25 at 21 25 57

Screenshot 2023-07-25 at 21 29 37

Screenshot 2023-07-25 at 21 27 11


my question is if

  • this can be ignored for current examples and should be implemented in a better way for future examples
  • or if the current examples need to be revised and improved regarding the described issues
    • and if so, can this be done programmatically or does it have to be done manually file by file?

What did you expect to see?

-> helpful and consistent whitespace/indentation as it is commonly used in code editors

we should encourage readers, especially beginners, to be consistent with such things...

Do you have any supporting links, references, or citations?

you can find some interactive examples here:
https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Selectors/Type_Class_and_ID_Selectors
https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Multicol_skills

Do you have anything more you want to share?

the right repo might be css-examples, but I wasn't sure if the issue described affects other parts as well...

@glmvc glmvc added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Jul 25, 2023
@github-actions github-actions bot added the Content:Learn:CSS Learning area CSS docs label Jul 25, 2023
@sideshowbarker sideshowbarker added help wanted If you know something about this topic, we would love your help! and removed needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. labels Jul 26, 2023
@OnkarRuikar
Copy link
Contributor

The source file is not formatted.

To address this these auxiliary repositories need the same tooling implemented as mdn/content does. If we merge these repos in mdn/content it will be easy to maintain.

For now we can manually run Prettier on all the files periodically.

@glmvc
Copy link
Contributor Author

glmvc commented Oct 8, 2023

Thanks for the input @OnkarRuikar
I saw your comment in the related discussion.

If there is an active plan and discussion to move the repo(s) to mdn/content and auto formatting by Prettier will solve this small problem, I guess it is okay to close this issue.

@OnkarRuikar
Copy link
Contributor

I guess it is okay to close this issue.

We'll have to manually format the code before merging and enabling auto formattings anyway. So it's better to format the code sooner. I've created a PR to fix this issue in all the files.

@glmvc
Copy link
Contributor Author

glmvc commented Oct 11, 2023

@OnkarRuikar Alright, thanks for the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:Learn:CSS Learning area CSS docs help wanted If you know something about this topic, we would love your help!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants