Git Product home page Git Product logo

w3m-man's Introduction

w3m-man

A simple script to view man pages in the terminal.

It uses wget and w3m (by default) to get the man pages from various websites.

Quickstart

man <command>        # view man page in plain text in $PAGER
man -H <command>     # view man page as HTML in $TERM_BROWSER
man <command> --url  # print the URL of the man page to STDOUT

Usage

Some of the GNU man options are supported:

  man <command>           # [get and] print the man page

  man <section> <command> # [get and] print the man page in given section

  man <command> --url     # print the URL from which the man
                          # page was/would be downloaded

  man --help              # print this help info

Where <command> is the command name you want to read about.

If needed, man will cycle through each category to find an existing man page.

To view man pages as HTML (using $TERM_BROWSER, or w3m if this variable doesn't exit), use -H as the first option.

About man page sections

Man pages are divided into sections, as follows:

  1. User: most user commands and programs.
  2. System: calls by the Linux kernel.
  3. Library: documents provided by the standard C library.
  4. Devices: documents various devices, most of which reside in /dev.
  5. Files: describes various file formats and filesystems and proc(5).
  6. Overviews, conventions, and miscellaneous.
  7. Superuser and system administration commands.

Examples

  man mount               # view 'mount' command

  man intro.1             # view info about section 1

  man mount.8             # view 'mount' in section 8 (config stuff)

  man 8 mount             # same as above, but doesn't work with -H

  man 5 xorgconf          # get xorg.conf from section 5 (dont use . in name)

  man -H mount            # view 'mount' man page as HTML using $BROWSER

  man <command> --url     # only print the URL from which the man page
                          # was/would be downloaded

More info

Uses these URLs from the following websites:

the Ubuntu or Debian man pages, also:

http://manpages.org/${command}/${section}
https://linux.die.net/man/${section}/${command}
https://www.mankier.com/${section}/${command}
http://man.he.net/?topic=${command}&section=${section}
https://man7.org/linux/man-pages/man${section}/${command}.${section}.html
http://manpages.org/${command}
http://man.he.net/?topic=${command}&section=all
https://ss64.com/bash/${command}.html

How it works

It downloads the man page from a website, using wget.

If running an Ubuntu based Puppy Linux, the correct version of Ubuntu man pages will be searched first. Likewise for any Debian based Puppy Linux, too.

It uses $HTMLPAGER to convert the HTML file to plain text, or w3m -dump if that variable doesn't exist.

It saves the man pages in plain text.

The plain text files are cleaned up a bit, and saved to $HOME/.w3m-man/<cmd>.<section>.

It then displays them using $MANPAGER or $PAGER, or falls back to less, if these aren't set.

Does not need roff, groff (etc) to be installed, or any man pages.

Note:

  • $TERM_BROWSER could equal w3m or lynx.
  • $HTMLPAGER could equal w3m -dump, or lynx -dump might work too.

w3m-man's People

Contributors

sc0ttj avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.