w3m Documentation

repository·master·Indexed 22 days ago

https://github.com/tats/w3m

A text-based web browser featuring support for SSL/TLS via OpenSSL, cookie management, and dictionary search. Includes documentation on local CGI scripts for SMB shares (smb.cgi) and 2ch data (2ch.cgi), utilities like makeref, htmldump, and html2latex, and detailed build and troubleshooting instructions for Cygwin environments.

Tokens
29.8K
Snippets
77
Records
164
Agent score
69%

What's inside w3m

  1. Install w3mimgdisplayfb and w3mimgsizefb

    master

    To use image display in a framebuffer environment, you need to compile the w3mimgdisplayfb and w3mimgsizefb utilities.

    Prerequisites

    • An environment supporting TRUE-COLOR framebuffer.
    • Either GdkPixbuf or Imlib2 installed.

    Compilation Steps

    1. Open the Makefile.
    2. Edit the CFLAGS and LDFLAGS to enable either Imlib2 or GdkPixbuf (whichever library you intend to use).
    3. Run make to build the binaries.
    make
  2. Use w3mimgdisplayfb and w3mimgsizefb

    master

    The w3mimgdisplayfb and w3mimgsizefb utilities are designed to be (almost) fully compatible with the standard w3mimgdisplay and w3mimgsize tools, but specifically for framebuffer usage.

    Usage

    Use them in the same manner as the original w3mimgdisplay and w3mimgsize commands.

  3. Overview of w3m

    master

    w3m is a pager with WWW (World Wide Web) capabilities. It functions as a text-mode web browser that can be used as a pager.

    Key features include:

    • HTML Rendering: When reading HTML documents, you can follow links and view images using an external image viewer.
    • Internet Message Mode: Automatically determines document types based on the Content-Type header (e.g., displaying text/html as an HTML document).
    • URL Recognition: Automatically converts plain text URL descriptions (like http://hogege.net) into clickable links.
  4. Overview of w3m: WWW wo Miru Tool

    master
    w3m is a pager with WWW capability. While it functions primarily as a pager, it can be used as a text-mode web browser for navigating the World Wide Web.
  5. Use w3m as a text-based browser or pager

    master

    w3m is a text-based browser capable of displaying local or remote web pages, HTML tables, and frames. It can also function as a pager for text files or a general-purpose directory browser.

    Key behaviors:

    • Web Browsing: Processes HTML but ignores JavaScript and CSS.
    • Tabs/Buffers: Organizes content in buffers or tabs for easy navigation.
    • Graphics: Can display inline graphics if the w3m-img extension is installed.
    • Standard Input: If no arguments are provided, it reads from stdin (defaulting to text/plain).
    w3m [OPTION]... [ FILE | URL ]...
  6. Use multi-character escape sequences in keymaps

    master

    w3m supports specific multi-character escape sequences for keybindings. The supported patterns are:

    • Escape character
    • Escape [ followed by a character (e.g., Escape [ O)
    • Escape [ followed by two digits and a tilde (e.g., Escape [ 1 2 ~)

    Depending on your terminal, additional sequences like function keys (F1-F10) or PageUp/PageDown may also be available.

  7. Configure site-specific settings with siteconf

    master

    The siteconf feature allows you to apply specific configurations based on URL patterns. This is useful for specifying character sets to improve decode_url output, bypassing redirectors (like Google's) for better privacy/performance, or spoofing User Agents to receive text-friendly versions of websites.

    By default, siteconf is loaded from ~/.w3m/siteconf.

  8. Render command output as HTML with x-htmloutput

    master

    The x-htmloutput field is a w3m-specific extension. Similar to copiousoutput, it reads the command's standard output into a buffer, but it treats the resulting output as HTML for rendering.

    If you want to use this feature without affecting other browsers, consider using a dedicated mailcap file for w3m or ensuring entries without x-htmloutput appear earlier in the file.

  9. Access Environment Variables for w3m

    master

    When running external programs (e.g., via a CGI script or a shell command), w3m sets several environment variables to provide context about the current browsing state.

    Buffer Context

    • W3M_SOURCEFILE: The path to the source file.
    • W3M_FILENAME: The filename of the current buffer.
    • W3M_TITLE: The buffer name/title.
    • W3M_URL: The current URL (parsed).
    • W3M_TYPE: The MIME type of the document.
    • W3M_CHARSET: The document character set (if USE_M17N is enabled).
    • W3M_CURRENT_WORD: The word currently under the cursor.
    • W3M_CURRENT_LINK: The URL of the anchor currently under the cursor.
    • W3M_CURRENT_IMG: The URL of the image currently under the cursor.
    • W3M_CURRENT_FORM: The string representation of the current form (if any).
    • W3M_CURRENT_LINE: The current line number (1-indexed).
    • W3M_CURRENT_COLUMN: The current column position (1-indexed).
  10. Use mailcap placeholders %s and %t

    master

    When defining external commands in a mailcap file, use the following placeholders to pass data to the command:

    • %s: The path to the file/content being passed to the external command.
    • %t: The content-type of the resource.
  11. Configure w3m environment and file locations

    master

    Environment Variables

    • WWW_HOME: Defines a fallback target if w3m is invoked without arguments.
    • W3M_DIR: If set to a directory, w3m will store its user files there instead of ~/.w3m.

    Default File Locations (can be changed via W3M_DIR)

    • ~/.w3m/bookmark.html: Default bookmark file.
    • ~/.w3m/config: User configuration file (overrides /etc/w3m/config).
    • ~/.w3m/cookie: Cookie jar.
    • ~/.w3m/history: Browser history (visited files/URLs).
    • ~/.w3m/keymap: User key bindings (overrides defaults).
    • ~/.w3m/mailcap: External viewer configuration.
    • ~/.w3m/menu: User defined menu.
    • ~/.w3m/mime.types: MIME types file.
    • ~/.w3m/mouse: Mouse settings.
    • ~/.w3m/passwd: Password and username file.
    • ~/.w3m/pre_form: Predefined values for HTML forms.