Make the HTML file template more useful
ClosedPublic

Authored by gszymaszek on Apr 22 2020, 6:56 AM.

Details

Summary

This commit removes the empty meta tag and adds the following:

  • a DOCTYPE declaration,
  • an html[lang] attribute,
  • a document charset declaration,
  • a newline at the end of the document.

Adding the DOCTYPE and charset make the template HTML5‐complant.

BUG: 419935

Diff Detail

Repository
R241 KIO
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
gszymaszek created this revision.Apr 22 2020, 6:56 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptApr 22 2020, 6:56 AM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
gszymaszek requested review of this revision.Apr 22 2020, 6:56 AM
ognarb accepted this revision.Apr 22 2020, 8:45 AM

Good idea to improve the default HTML file.

Improvement ideas:

  • Don't include <style></syle>, it's not recommanded to inclde <style> elements but instead to link to a css file.
  • Maybe you could also include the usual HTML semantic elements:
<body>
  <header>
    <nav></nav>
  </header>
  <section></section>
  <footer></footer>
</body>
This revision is now accepted and ready to land.Apr 22 2020, 8:45 AM
  • Don't include <style></syle>, it's not recommanded to inclde <style> elements but instead to link to a css file.

Well, it depends on the purpose of the HTML document (a self‐contained one, or a part of a website). But I agree that it would be better to remove the style element. If the user wants to add some stylesheets, they can always add either a link or a style, whatever they prefer.

  • Maybe you could also include the usual HTML semantic elements:
<body>
  <header>
    <nav></nav>
  </header>
  <section></section>
  <footer></footer>
</body>

I can add a header and a footer, but I would prefer main over section and I’d rather not add nav. Again, the HTML document may be a part of a website, and require some navigation in such case, but it may be an individual marked‐up document as well, an HTML equivalent of an OpenDocument/RST/TeX.

gszymaszek updated this revision to Diff 80853.Apr 22 2020, 9:14 AM
  • Remove stylesheets from the HTML file template
  • Don't include <style></syle>, it's not recommanded to inclde <style> elements but instead to link to a css file.

Well, it depends on the purpose of the HTML document (a self‐contained one, or a part of a website). But I agree that it would be better to remove the style element. If the user wants to add some stylesheets, they can always add either a link or a style, whatever they prefer.

  • Maybe you could also include the usual HTML semantic elements:
<body>
  <header>
    <nav></nav>
  </header>
  <section></section>
  <footer></footer>
</body>

I can add a header and a footer, but I would prefer main over section and I’d rather not add nav. Again, the HTML document may be a part of a website, and require some navigation in such case, but it may be an individual marked‐up document as well, an HTML equivalent of an OpenDocument/RST/TeX.

Ok :)

gszymaszek updated this revision to Diff 80859.Apr 22 2020, 9:52 AM
  • Add common HTML elements to the HTML file template
gszymaszek requested review of this revision.Apr 22 2020, 10:46 AM
This revision was not accepted when it landed; it landed in state Needs Review.Apr 27 2020, 4:04 PM
This revision was automatically updated to reflect the committed changes.