# Websourcebrowser

## Introduction

Websourcebrowser makes it easy to visually scan trees of source code. In particular, you can view the directory tree and the source code of a file side by side, so you can quickly change to a different file.

Some features of Websourcebrowser:

• Platform-independent, any web browser with JavaScript support can be used to view the source code.
• Includes a small webserver, so the source code and the browser to view it can be on different computers.
• By default, they are on the same computer. :-)
• If Pygments is installed on the server side, which may be the local computer, source code is automatically highlighted.
• If CherryPy is installed, it's used as the server infrastructure.
• Image files supported by the browser are displayed.
• Uncompressed and compressed (gzip, bzip2) tar files are shown as a list of the contained directories and files.
• Binary files are displayed as hexdumps.
• Written in portable Python .

Go to the Websourcebrowser website to see screenshots.

## Documentation

There's not much documentation for Websourcebrowser yet. However, once you started the program and typed the displayed URL into the address line of a web browser, the program should be easy to use after experimenting a bit with it.

To get help for the command line options, invoke the installed program with the help option:

$wsbrowser --help  where$ is a shell prompt. Probably, the most useful options are --root and --line-numbers. Ignore patterns given via the command line option --ignore-pattern are added to those from the environment variable WSB_IGNORE. (Note that you can't use a whitespace-separated list with --ignore-pattern but instead use the option multiple times.)

There's an environment variable which influences Websourcebrowser. WSB_IGNORE can contain a whitespace-separated list of wildcards which are used as ignore patterns. My list is usually:

*.pyc  *.pyo  */.svn  *.svn/*  */.hg  */.hg/*  *.swp


which ignores Python bytecode files, version control files from Subversion and Mercurial, and Vim swap files.

## Requirements

Websourcebrowser requires only Python, version 2.5 or later. It's recommended though not strictly necessary to also install Pygments to get syntax highlighting.

## Using Websourcebrowser without installation

Though it's recommended, you don't have to install Websourcebrowser. Instead you can get away with extracting the source archive (see below) and adding the extracted directory to the PYTHONPATH environment variable. For example, if the directory is /home/me/downloads/websourcebrowser-0.2, add that to PYTHONPATH.

## Installation

You install Websourcebrowser like most Python packages.

• If you have an older version of Websourcebrowser installed, delete it or move it somewhere else, so that it doesn't conflict with the new version!

• Extract the downloaded archive. Under Unix/Linux, you usually do this from the shell prompt:

$tar xzf websourcebrowser-0.1.tar.gz  • Change to the directory: $ cd websourcebrowser-0.1

• Become root:

\$ su -


The shell prompt changes to #.

• To install Websourcebrowser system-wide, type:

# python setup.py install


Otherwise, consult the distutils documentation on how to install Python packages into another directory.