html_cfg.sh

Content [?]


Converts lynx.cfg to lynx_cfg.html , which Lynx can still parse for configuration items at startup. The script adds named anchors, an index and so on, making it [hopefully] a little easier to navigate.

There is already a cfg2html.pl included with the Lynx sources, and I don't mean to re-invent the wheel. That script does almost the same thing, except that its HTML output is only HTML, not a viable config file, so the information in it becomes outdated the minute you change one setting in lynx.cfg. That's why I'd rather make one file serve both purposes.

But it does write better HTML than mine.

I should explain that lynx.cfg is its central configuration document, like the `*.conf' files used by other applications. You can also use the options screen to save most common settings in a smaller .lynxrc file, in your home directory, but some things can only be changed in lynx.cfg.

As of Lynx 2.8.7dev.9, this file is about 145 K, heavily commented, with a careful description of each setting and what it does. Only about 4 K of that is actually used by the program [or as little as four lines, if you're happy enough with the defaults]. The rest is comments, but those comments are very helpful to human readers. I even keep mine in /usr/share/doc/lynx/ instead of the usual location, because I refer to it more often than the `real' documentation anyway [no offense to those who write the real Lynx documentation, of course].

But it's flat text, and it's a lot of flat text to wade through, especially when you're just looking for one particular setting to change. I hoped an index, with a bunch of named anchors and HREFs would simplify that. Seems to, but it still needs work.


Here's a brief comparison of the scripts, and their output. The following links should open in new windows or tabs, if your browser supports that sort of thing.

lynx.cfg
This is the file Lynx uses by default, and the one processed by all three scripts. [Filename changed on the server, so it will be treated at text/plain.]
 
cfg2html.pl
This script generates HTML documentation, using comments and formatting directives embedded in lynx.cfg . Its output consists of three files; cattoc.html [categorical table of contents], alphatoc.html [alphabetical table of contents], and body.html, which is the complete text reformatted as HTML.
 
The comments in the script itself describe it pretty well.
 
[Note: I've tweaked some of the formatting directives in my lynx.cfg, so to be fair, it also seemed like a good idea to generate HTML from the same source my scripts were using. Another example can be found here, generated from this lynx.cfg file.]
 
html_cfg.sh
Generates a central index, and a separate HTML file for each major heading. Minor headings under a given category all go in the same file. Embedded `INCLUDE:' directives in the index make it possible to use these files as your lynx.cfg.
 
Its main index is lynx_cfg.html, but you might want to start on this informational page instead [the script tries to write its own documentation, but I'm not sure if it does a very good job]. As you can see, the layout of the index is strongly influenced by Vlad Harchev's cfg2html.pl.
 
html_cfg_in1.sh
As above, except this one pours everything into one big HTML file, including the table of contents. Its primary output is lynx.cfg.html [slightly different name, so you can keep both in the same place], but again, you might want to start on its informational page.
 
I'm still not sure if the `one big file' approach is better [using named anchors exclusively, not separate files], or building a collection of linked documents. That's why there are two alternate versions here. One big file is easier to search, using Lynx's built-in whereis, or `Find...' in a graphical text editor, but multiple files do make Lynx's internal LYNXCFG:/ summary a little easier to follow.
 
So I guess that's just a matter of personal taste.

Anyway, there's the scripts. I hope you'll find one, both, or all three useful.

-- pAb


Back to Index || Up to Main Index