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

Add <!doctype html> to html snippets #1866

Closed
rikschennink opened this issue Feb 28, 2018 · 13 comments
Closed

Add <!doctype html> to html snippets #1866

rikschennink opened this issue Feb 28, 2018 · 13 comments

Comments

@rikschennink
Copy link

rikschennink commented Feb 28, 2018

Yesterday I blindly copied the Webpack "Getting Started" index.html page to build a quick prototype. The next 50 minutes I'm debugging weird layout bugs. It seems the example snippet does not contain a DOCTYPE and I forgot to add it myself.

Maybe have it there by default?

@montogeek
Copy link
Member

webpack website shows in its examples the minimal requirements to wort with it, specify details about other technologies are no essential.

@rikschennink
Copy link
Author

rikschennink commented Feb 28, 2018

@montogeek I understand that examples need to be kept as concise as possible. It worries me that a DOCTYPE is considered a "specific detail". Following that reasoning, the <title> tag could also be removed. edit: It can't be removed as it's a requirement for a valid HTML page.

If other devs are building their products/prototypes based on these examples they could find themselves in unnecessary trouble.

@montogeek
Copy link
Member

title is part of the guide. HTML knowledge is out of the scope of webpack documentation

@timseverien
Copy link

timseverien commented Feb 28, 2018

I'm with @rikschennink here. If you're providing an entire HTML file, I would expect those to be complete.

@bramsmulders
Copy link

+1

@montogeek
Copy link
Member

We are not providing an entire HTML file, just the minimal HTML to show how webpack works

@rikschennink
Copy link
Author

@montogeek A minimal HTML file (that is still valid) really should have a <!doctype html> at the top.

I'm reading here that it should also have a <title> tag, my earlier statement about removing it seems to be incorrect.

@montogeek
Copy link
Member

Can you please submit a PR to add it in all necessary examples? Not those generated by plugins.

@rikschennink
Copy link
Author

@montogeek happy to do that somewhere this week or the next.

@TheDutchCoder
Copy link
Collaborator

TheDutchCoder commented Mar 1, 2018

@rikschennink this is a really good point. I'm probably responsible for this mishap, so I've taken the liberty to include it for our v4 Guides (#1862) and I will open a quick PR (#1868) for the current docs as well.

You're totally right: the examples should be working and correct, even if they're minimal examples.

Thanks for the good catch!

TheDutchCoder added a commit that referenced this issue Mar 1, 2018
As pointed out in Issue #1866, this should be added for valid HTML.
@TheDutchCoder TheDutchCoder self-assigned this Mar 1, 2018
@rikschennink
Copy link
Author

@TheDutchCoder Fantastic! Thanks for taking the time to fix it Reinier. I'll remove it from my todo list 🙂

@jeremenichelli
Copy link
Member

It would b good to check the rest of the site and try to spot places where this was also happening and fix it.

@TheDutchCoder TheDutchCoder changed the title Add DOCTYPE to html snippets Add <!doctype html> to html snippets Mar 1, 2018
@TheDutchCoder
Copy link
Collaborator

This was solved by #1868

Thanks everyone!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants