0

I was planning to use lynx for reading all local HTML files in a folder:

lynx ~/Documents/webpages/*

I don't know how to move beyond the first document. Quitting with qq exits the program and returns to the shell.

Specifying the directory (lynx ~/Documents/webpages/) requires manually selecting each entry (but lynx at least remembers the last one, when going back).

note: lynx doesn't support tabs and there's no need to open the pages at once.

3 Answers3

3

In Lynx,

  • you can get to the other files by pressing g, and then using up/down cursor keys to scroll through the list of files.
  • After you have visited a file, it is put into another list, which you can see using a double-tab after pressing g (and select by moving the cursor up/down, pressing Enter).
  • Both are different from Lynx's history-stack (which you can inspect by pressing control-H).

This is not a new feature. It is mentioned in the changelog for 2.8.3dev.1 (1996/06/11):

  • Additional non-option args (before the last one), i.e. URLs or filenames, are made available for 'g'oto recall. If unwanted, this can be disabled by changing EXTENDED_STARTFILE_RECALL in LYMain.c -KW

w3m puts extra parameters into its history-stack and that should allow one to move to different files.

links/links2/elinks do not appear to support that feature at all.

Thomas Dickey
  • 76,765
0

It is not possible to have multiple pages to be open simultaneously. If you run lynx with multiple URLs in command line - it will open the last one.

It is however possible to create a jump file. It is virtually the same as bookmarks in other browsers. Create a file with full URLs:

<dt>?<dd><a href="file://localhost/home/me/jumps.html">jumps file</a>
<dt>a<dd><a href="file://localhost/home/me/a.html">a file</a>
<dt>b<dd><a href="file://localhost/home/me/b.html">b file</a>
<dt>c<dd><a href="file://localhost/home/me/c.html">c file</a>

Please note, that the '?' have to be the first one in the file. Not sure why it is so...

Create/modify a local config file and add that jump file into it:

JUMPFILE:/home/me/jumps.html
INCLUDE:/etc/lynx/lynx.cfg

Next, enable that local config file on the lynx start

linx -cfg /home/me/lynx.cfg

Now all you need is to hit j, type the shortcut (the one defined in dt) and lynx will jump to that file.

White Owl
  • 5,129
0

xargs can be used used to sequentially open HTML documents in lynx (realpath returns the absolute path):

realpath ~/Documents/webpages/*.html | xargs --max-lines=1 lynx