# It is possible to access and traverse the files inside a zip archive
# as though it were a mounted file system.
# If you are editing a directory, and MyOldWork.zip is one of the files,
# type g, and you will see a page that says Zip Archive at the top,
# with links to the files and directories at the top of the zip archive.
# From there you can descend into subdirectories, or extract files.
# Edbrowse never pulls the entire archive into a buffer, so the archive can be huge.
# 
# The system relies on made-up protocols zipx:// and zipxd://
# You will never find these protocols in the wild.
# It is prepended to zip files and directories,
# then used to trigger plugins which descend further into the zip archive.
# A similar system could be set up for gzip, bzip2, tar, cpio, etc.

# There are three plugins and a supporting bash script - edbrowse-plugin-zip.

# down_url means the plugin must run from a file on your system, not a url.
# The program cannot act on a url.
# It could be a temp file however.
# edbrowse can download the file, put it into a temp, and run.
# from_file is stronger. It means the file must be a local file.
# If the zip file is on the internet, save it to a local file,
# then you can use these plugins.

plugin {
type = zip
desc = zip archive
suffix = zip
program = edbrowse-plugin-zip %i
from_file
outtype = h
}

plugin {
type = zip
desc = zip show directory
protocol = zipxd
program = edbrowse-plugin-zip %i
outtype = h
}

# This plugin uses outtype = g, which is rare.
# A rendering program usually generates text or html, but in this case
# the file could be anything. We don't know in advance what it is,
# so use g for generic.

plugin {
type = zip
desc = zip extract file
protocol = zipx
program = edbrowse-plugin-zip %i
outtype = g
}
