Topic: Kete Coding Guidelines

Topic type:

A small list of things to keep in mind when writing code for Kete.

With the recent improvements in accessibility, there are a few things to keep in mind when writing code so you don't have to go over it later on.

The Obvious Stuff

( partly taken from Rails Source styling guide )

  • Use two spaces for a indenting, not tabs
  • No spaces on blank lines
  • Use '&&' and '||' , not 'and' and 'or'
  • Reuse existing functionality from plugins
  • Split up long lines over a serious of lines (should not have to use horizontal scrollbars)

The not-so Obvious Stuff

  • Make sure all non-text elements you add (static or user generated images) have the following
    - See web standards 1.1 and 5.1.3
    • An alt tag, containing a meanful piece of text (not the filename), and make sure it ends with a period (.), and a space.
      • e.g.  alt="Screenshot of Kete from Firefox. "
    • An height and width attribute matching the exact height and width of the image to be displayed.
  • Make sure all links, and form elements have tabindexs depending on their type position in the page.
    - See web standard 7.2
    • All form elements and links on page should have tabindex="1"
    • All navigation links around the content (header / footer) should have tabindex="2"
    • The only content that doesn't get tabindexs are ones where user content is submitted
  • Use relative font sizes (em), not absolute (pt/px)
    - See web standard 3.4
  • All table header cells contain an abbr attribute, with preferably a one word description of what the column is.
    - See web standard 3.1.3

Discuss This Topic

There are 0 comments in this discussion.

join this discussion

Tags