UNIVERSITY of VIRGINIA
Computer Science
Research  Teaching  People  Community   

Search
Directory
Contact Us
 
Undergrads • Grad Students • Faculty • Staff • Alumni • Locator • Phones

Editing Basics

Logging In

The first step in any project is getting onto the server to access, edit, create and delete files. To do this, ssh into one of the department machines (cobra.cs.virginia.edu, viper.cs.virginia.edu, or mamba.cs.virginia.edu). If you don't have ssh, you may click here to log on.

Finding Files

When you log on, you'll be at a line that finishes with: /server/htdocs$. This is the base directory for the cs page. Now, you need to navigate to the location you want to work in.

Lets say you are going to the work on a file in the directory: http://www.cs.virginia.edu/mydirectory, you would type in cd mydirectory then return. To go up one level in the directory structure, just type: cd ...

Most files on the CS web site mirror the file system in ~webteam/server/htdocs/. For example, the file you see in your browser as http://www.cs.virginia.edu/admissions/classes.html would be found in ~webteam/server/htdocs/admissions/classes.html. Files in the http:/ww.cs.virginia.edu/~webteam tree would be find in ~webteam/public_html/.

Raw Files

When making websites, you will not actually be working with .html files, you will be working with .raw files, which you will later make into .html files. These raw files will have several differences with normal .html files:

Other than this, use regualr HTML.

Editing a file

The first thing you need to do when editing a file is to make a copy of it. You will actually be editing the copy version and then, when all changes are made, you will replace the old file with the updated copy. To make the copy, type: cp originalfile.raw originalfilesave.raw. Now you will are ready to edit the originalfilesave.raw file (not the original.raw file).

You can edit files using any text editor. If you are not already familiar with some other text editor, we recommend using emacs. To edit the file in emacs, run emacs originalfilesave.raw. If you are creating a new file, just type in emacs newfilename.raw and emacs will create that file for you and open it.

When you are finished editing, you can type Ctrl-X Ctrl-C to exit emacs and return to the shell. (More sophisticated Unix users will just suspend the emacs process so it is easy to return to editing.)

Making the .html page

In order to create the .html from the .raw page, you need to run make originalfilesave.html. Next, check your page by looking at http://www.cs.virginia.edu/originalfilesave.html with a web browser. If you have made major changes or used any fancy formatting, you should check your page with at least three different browrsers: Internet Explorer, Netscape and Lynx.

If the page doesn't look satisfactory, go back to editing a file to see how to open emacs and make your changes to the .raw file, not the .html file. Once done, just remake the .html file.

Go through this loop as many times as nescessary to complete the changes.

Finishing Up

Now, all that remains to be done is to replace the old .raw with the new one, as well as getting rid of your temporary file. Type

mv originalfile.raw originalfile.backup
   This saves a copy of the original .raw file.
mv originalfilesave.raw originalfile.raw
   This renames the file you edited over the original .raw file.
make originalfile.html
   This creates the new .html file.
Once you have done this, check the new .html file with your browser.


UVa CS Department of Computer Science
School of Engineering, University of Virginia
151 Engineer's Way, P.O. Box 400740
Charlottesville, Virginia 22904-4740

(434) 982-2200  Fax: (434) 982-2214
Web Comments: webteam@cs.virginia.edu
Admissions Inquiries: inquiry@cs.virginia.edu
Site directory, Other addresses
Server statistics
© Created by the CS Web Team