HyperTextMarkupLanguage

meiner einer

Wie schreibe ich richtiges HTML?
Wie kann ich das geschriebene überprüfen?
Ein Erklärungsversuch...




HTML ist nun bis zur Version 4 gekommen. Es wird auch keine Version 5 geben, weil die nächste Version XHTML ist. HTML ist lediglich eine Textauszeichnungssprache, das Layout sollte Cascading Style Sheets übernehmen.
Die Amiga-Browser kommen mit CSS aber noch nicht zurecht und es bleibt den Amiga-User nix anderes übrig, als auf die HTML-Elemente zuzugreifen.

Als Anleitung zum Schreiben gibt es von Stefan Münz die HTML-Datei ´SelfHTML´ in der Version 8 auf der HP http://selfhtml.teamone.de/
Diese Version ist auch auf der AMIGAplus Leser-CD 13 enthalten.
Weitergehende Ratschläge zu XHTML und CSS gibt es bei Michael Jendryschik. Unter http://jendryschik.de/html/
XHTML soll auf allen drei Amiga-Browser funktionieren.

Zum prüfen des HTML-Codes gibt es unter http://validator.w3.org/ eine Möglichkeit den Quellcode auf Fehler untersuchen zu lassen. Wichtig ist dabei, das die erste Zeile des Codes den Doctype angibt. Die Seite ist in English und wer es in deutsch lieber mag, der nehme dann die URL http://www.validator.projektmedien.de/ dort erhält man die Fehlermeldungen in Deutsch. Diese überprüfung erfolgt online. Mit dem Programm Tidy kann man seine Seiten auch offline überprüfen. Ich denke es sollte im AmiNET unter comm/www eine Amiga-Version in english vorhanden sein. Ein -und Ausgabe erfolgt über die Shell. Ansonsten gibt es sie auf der HP http://tidy.sourceforge.net/. Noch interessanter dürfte die HP http://www.blakemore-noble.net/ sein.

Tidy

Wer einen PC mit Windows zur Verfügung hat, der kann sich eine deutsche GUI-Version auf der HP http://www.sielkamp.de/ besorgen.

Nach überprüfung der NoCover 94 waren gerade drei HTML-Dokumente einwandfrei geschrieben. Das waren Beiträge von Murmel, Rolf und Spezi. Zehn Artikel hatten bis zu 10 Warnungen/Fehler. Alle anderen hatten Warnungen/Fehler im Bereich von 10 bis 1012! :) Wenn man die aufgelisteten Fehler mit einem Editor entfernt, sollte man ein Gefühl für richtiges HTML bekommen.

Anhand der Amiga-Version nun eine kleine Einführung. Nach erfolgreichen Entpacken von tidy.lha (135761 bytes) das Programm tidy (133992) nach C: kopieren. Im Archiv sind noch HTML-Dateien auf english zur Anleitung.
Ein Beispiel:
Eine Shell öffnen. Kopieren der Datei NC 94:nc/nt_kilian.htm nach Ram:
Nun tippen wir:
tidy -h
und wir erhalten eine Befehls-Datei

tidy -f fehler.txt nt_kilian.htm
und haben im Ram: eine Datei fehler.txt, die wir uns nun ansehen:

Tidy (vers 4th August 2000) Parsing "nt_kilian.html"
line 4 column 1 - Error: <author:> is not recognized!
line 4 column 1 - Warning: discarding unexpected <author:>
line 8 column 1 - Warning: <table> lacks "summary" attribute
line 9 column 1 - Warning: <p> isn't allowed in <table> elements
line 9 column 4 - Warning: <h1> isn't allowed in <table> elements
line 9 column 8 - Warning: <center> isn't allowed in <table> elements
line 9 column 16 - Warning: <font> isn't allowed in <table> elements
line 9 column 36 - Warning: plain text isn't allowed in <table> elements
line 9 column 65 - Warning: </font> isn't allowed in <table> elements
line 9 column 65 - Warning: trimming empty <table>
line 9 column 65 - Warning: discarding unexpected </font>
line 9 column 72 - Warning: discarding unexpected </center>
line 9 column 81 - Warning: discarding unexpected </h1>
line 9 column 86 - Warning: replacing element </p> by <br>
line 9 column 86 - Warning: inserting implicit <br>
line 10 column 1 - Warning: missing <li>
line 10 column 4 - Warning: trimming empty <p>
line 10 column 4 - Warning: trimming empty <li>
line 11 column 65 - Warning: trimming empty <p>
line 14 column 1 - Warning: missing </a> before <p>
line 41 column 2 - Warning: missing </a> before <p>
line 51 column 35 - Warning: <img> lacks "alt" attribute
line 51 column 67 - Warning: missing </a> before <p>
line 51 column 70 - Warning: discarding unexpected </a>
line 54 column 1 - Warning: replacing element </p> by <br>
line 54 column 1 - Warning: inserting implicit <br>

nt_kilian.html: Doctype given is "-//W3C/DTD HTML 3.2//EN"
nt_kilian.html: Document content looks like HTML proprietary
26 warnings/errors were found!

This document has errors that must be fixed before
using HTML Tidy to generate a tidied up version.

The table summary attribute should be used to describe
the table structure. It is very helpful for people using
non-visual browsers. The scope and headers attributes for
table cells are useful for specifying which headers apply
to each table cell, enabling non-visual browsers to provide
a meaningful context for each cell.

The alt attribute should be used to give a short description
of an image; longer descriptions should be given with the
longdesc attribute which takes a URL linked to the description.
These measures are needed for people using non-graphical browsers.

For further advice on how to make your pages accessible
see "http://www.w3.org/WAI/GL". You may also want to try
"http://www.cast.org/bobby/" which is a free Web-based
service for checking URLs for accessibility.

You are recommended to use CSS to specify the font and
properties such as its size and color. This will reduce
the size of HTML files and make them easier maintain
compared with using <FONT> elements.

HTML & CSS specifications are available from http://www.w3.org/
To learn more about Tidy see http://www.w3.org/People/Raggett/tidy/
Please send bug reports to Dave Raggett care of <html-tidy@w3.org>
Lobby your company to join W3C, see http://www.w3.org/Consortium

Gut nun müssen wir beigehen die Fehler zu beseitigen.

Hier war es einer, die Zeile mit dem Autor. Korrekt muss es heißen:
<meta name="author" content="Kilian Servais">
oder als Kommentar:
<!-- AUTHOR: Kilian Servais on Amiga Computer -->

Wir tippen nun:
tidy -im nt-kilian.htm
tidy -f fehler.txt nt_kilian.htm
und wir sehen:
ein Fehler ist noch da!

Tidy (vers 4th August 2000) Parsing "nt_kilian.htm"
line 148 column 41 - Warning: <img> lacks "alt" attribute

nt_kilian.htm: Doctype given is "-//W3C/DTD HTML 3.2//EN"
nt_kilian.htm: Document content looks like HTML proprietary
1 warnings/errors were found!

Diese Warnung kann das Programm nicht beseitigen, wenn es nicht weiss was alternativ enthalten ist. Man kann eine Config schreiben, wo dann steht: alle Grafiken mit alt"" versehen.
Sowas ist mit dem deutschen Tidy auf dem PC einfacher, da kann man über Benutzer-Oberfläche eine Config erstellen.

Ich hoffe, das mein Text irgendwem hilft und die NoCover bald ohne Warnungen und Fehler ist. :-) Es gibt viel zu tun...

zum Anfang
Schöne Grüße aus Hannover von

Charly

Autor:Charly Bader  Mail:charly-ham@t-online.de  Web:http://charly-ham.bei.t-online.de/