monkeytype icon indicating copy to clipboard operation
monkeytype copied to clipboard

HTML tags aren't entirely semantic

Open borisnezlobin opened this issue 1 year ago • 14 comments

Did you clear cache before opening an issue?

  • [X] I have cleared my cache

Is there an existing issue for this?

  • [X] I have searched the existing issues

Does the issue happen when logged in?

Yes

Does the issue happen when logged out?

Yes

Does the issue happen in incognito mode when logged in?

Yes

Does the issue happen in incognito mode when logged out?

Yes

Account name

randomletters

Account config

No response

Current Behavior

The HTML tags throughout the frontend are lacking in semantic structure (i.e., h1 for titles, h2 for subtitles, ul/ol for lists, etc)

Expected Behavior

Currently, the layout looks something like:

 <div class="section">
    <div class="bigtitle">about</div>
    <h2>
      Monkeytype is a minimalistic and customizable typing test. It features
      many test modes, an account system to save your typing speed history, and
      user-configurable features such as themes, sounds, a smooth caret, and
      more. Monkeytype attempts to emulate the experience of natural keyboard
      typing during a typing test, by unobtrusively presenting the text prompts
      and displaying typed characters in-place, providing straightforward,
      real-time feedback on typos, speed, and accuracy.
      <br />
      <br />
      Test yourself in various modes, track your progress and improve your
      speed.
    </h2>
  </div>

Using semantics, it would look like:

  <section class="section">
    <h1 class="bigtitle">about</h1>
    <p>
      Monkeytype is a minimalistic and customizable typing test. It features
      many test modes, an account system to save your typing speed history, and
      user-configurable features such as themes, sounds, a smooth caret, and
      more. Monkeytype attempts to emulate the experience of natural keyboard
      typing during a typing test, by unobtrusively presenting the text prompts
      and displaying typed characters in-place, providing straightforward,
      real-time feedback on typos, speed, and accuracy.
      <br />
      <br />
      Test yourself in various modes, track your progress and improve your
      speed.
    </p>
  </section>

This would improve SEO and make things more clear for developers

Steps To Reproduce

Go to any .html file in the frontend

Environment

  • OS: all
  • Browser: all
  • Browser Version: all

Anything else?

https://www.w3schools.com/html/html5_semantic_elements.asp

Can I work on this? It's rather tedious, but worth doing

borisnezlobin avatar Dec 11 '23 03:12 borisnezlobin

Known issue. Ive been slowly converting everything recently.

Miodec avatar Dec 11 '23 11:12 Miodec

if you want, I could help you out

should I close this (github) issue?

borisnezlobin avatar Dec 11 '23 14:12 borisnezlobin

You could if you wanted to, all though i wouldnt modify the header tags due to the way the website is structured (and the fact that Im not using SSR)

Miodec avatar Dec 11 '23 15:12 Miodec

What do you mean? I can get sample pr done today (like modifying just the About page for example), and you can take a look? I'm a bit confused with what header tags you are talking about

borisnezlobin avatar Dec 11 '23 16:12 borisnezlobin

I mean H1, H2 and so on.

Miodec avatar Dec 11 '23 16:12 Miodec

Ok, I'll leave them untouched and just work on the other parts

borisnezlobin avatar Dec 11 '23 17:12 borisnezlobin

hello i would like to contribute? Can someone walk me through??

sidharth-23 avatar Jan 23 '24 04:01 sidharth-23

I've somewhat paused working on this because I couldn't find that many egregious errors. I'll push all my changes to this branch, but basically what this pr does is replace things like <div class="title"> with the semantically correct html tags (in the example, <h1> or <h2>). If you want the PR, take it!

https://github.com/monkeytypegame/monkeytype/pull/4859

borisnezlobin avatar Jan 23 '24 04:01 borisnezlobin

solution `

about

Monkeytype is a minimalistic and customizable typing test. It features many test modes, an account system to save your typing speed history, and user-configurable features such as themes, sounds, a smooth caret, and more. Monkeytype attempts to emulate the experience of natural keyboard typing during a typing test, by unobtrusively presenting the text prompts and displaying typed characters in-place, providing straightforward, real-time feedback on typos, speed, and accuracy.

Test yourself in various modes, track your progress and improve your speed.
' @borisnezlobin

Anm4219b avatar Jan 26 '24 05:01 Anm4219b

<article>
    <h1>about</h1>
  Monkeytype is a minimalistic and customizable typing test. It features
  many test modes, an account system to save your typing speed history, and
  user-configurable features such as themes, sounds, a smooth caret, and
  more. Monkeytype attempts to emulate the experience of natural keyboard
  typing during a typing test, by unobtrusively presenting the text prompts
  and displaying typed characters in-place, providing straightforward,
  real-time feedback on typos, speed, and accuracy.
  <br >
 <br>
  Test yourself in various modes, track your progress and improve your
  speed.
</article>
code

Anm4219b avatar Jan 26 '24 05:01 Anm4219b

yeah basically like that, but everywhere I've done a few pages already in the PR I linked if you want to work off that or you can just make a new pr and start from scratch

borisnezlobin avatar Jan 26 '24 16:01 borisnezlobin

Hey I can work on this

plbstl avatar Feb 02 '24 18:02 plbstl

Go ahead!

borisnezlobin avatar Feb 02 '24 19:02 borisnezlobin