1.5. Hypertext Markup Language (HTML)#
How do we go about disseminating meteorological information? Well, there are actually a number of different mechanisms to do so including, television, radio, newspaper, fax machine, and the Internet. Since the advent of the Internet, dissemination of all types of meteorological information has gotten easier. Previously, difax (digital fax) maps were the primary mechanism to view weather data. We used to hang maps on the wall; it was a legacy from the era before high-speed Internet. With the Internet we can post many more images than what would be transmitted via fax, in a better quality, with color! So it is important to know at least the very basics of how to construct a simple html page and putting images and text on them for public consumption.
As part of your account on bergeron and us placing an Apache server on it, you all have the ability to create a public html page. This page should only be used for generally meteorological purposes and we’ll use it for the remainder of the semester for our assignments and the semester project. First, we need to get everyone started, so we will make a simple webpage using the tag language of html. You’ll be introduced to the most common tags that are used in creating an html page. You can create a webpage through other means, such as PHP, but we will keep it to the basics here.
Note
The following commands are going to be different depending on how and where you are creating a website. The HTML tags are applicable across systems. So you may need to create any HTML pages in a different location/manner, but the contents of a simple example webpage would be the same.
Step 1: Creating your homepage#
The next step is to create an index file. Your homepage is the index.html file.
Go into your web directory:
kgoebber@bergeron:~> cd public_html\
Use vi to edit a file called index.html. Even though this file does not exist, editing it will create the file. To edit the file type:
kgoebber@bergeron:~> vi index.html
Step 2: HTML document essentials#
HTML uses a series of “tags” or “switches” as programming code.
Anything in between the tags will be displayed as text on the webpage.
The text is modified depending on which tags are used. Tags are
designated by being surrounded by <
and >
(for a start of a tag) and
</tag>
(for the end of a tag). For example, the tag for bold is
<B>
. To make the word “Hello” in bold on your webpage, you would enter
the following code:
<B>Hello</B>
This code would display Hello. Notice how the start and end of a tag are different.
Any webpage must have, in the very least, the following code. Think of these tags as a basic skeleton that must go into all HTML files. Go ahead and write this into your index.html file:
<HTML>
<HEAD>
<TITLE>This is the page title</TITLE>
</HEAD>
<BODY>
</BODY>
</HTML>
Be sure to save your work often!
Step 5: Pulling up your webpage#
Save the .html file. Open a web browser and go to the following address:
http://bergeron.valpo.edu/~<username>
Obviously, replace username with your username. For example, my username is kgoebber, so my website address is:
http://bergeron.valpo.edu/~kgoebber
THAT’S IT!! EASY!
Now, you may want to make a separate folder to store all of your lab
images, html pages, etc. To do this, use the mkdir
command. Thus, if
we wanted to create a directory for this class we could do the
following:
mkdir wxtech
This would create a subdirectory of our current directory named
wxtech
. Don’t believe me? Look for yourself. Do a ls -F
. You
should now see an entry that looks like wxtech
. You can type cd
wxtech and see that you are now working inside the directory you just
created!
Practice Tasks - HTML#
Create a surface image using the script that you got working from a previous lab and post it to your home page with some sort of commentary.
Create an upper-air map from your favorite model and do the same thing as the first task.
Customize your webpage. Use Google (or your favorite search engine) to figure out how to change the colors and do other amazing things with a webpage. The only way to learn about making a webpage is to try and do something with your own page.
Create a webpage that has information from the different assignments for this class.