gopher - Luakit

# Luakit Documentation / Modules / gopher

# Module `gopher`

Add gopher:// scheme support

The module adds support for Gopher network with basic rendering.

## Functions

### gopher.parse_gopher_line (line, url)

Parse Gopher menu entry.

#### Parameters

- line
  Type: string
  Literal string line representing a Gopher menu entry.
- url
  Type: table
  Parsed URL structure from parse_url().

#### Return Values

- table
  Structure representing the menu entry tokens.

### gopher.href_source (entry)

Evaluate hyperlink for a gopher menu entry.

#### Parameters

- entry
  Type: table
  Gopher menu entry structure from parsegopherline().

#### Return Values

- string
  Valid URL for the menu entry.

### gopher.image_mime_type (ext)

Guess the image MIME type by a filename suffix.

#### Parameters

- ext
  Type: string
  The filename suffix (without leading dot).

#### Return Values

- string
  Appropriate MIME type.

### gopher.parse_url (url)

Parse Gopher URL.

#### Parameters

- url
  Type: string
  Gopher URL starting with gopher://

#### Return Values

- table
  A structure representing the URL tokens.