doc script

# doc script (All GMs)

If you don't want to keep a browser running, and you don't want to use "more" on the html docs (because then you see tags, or because you have to give a path and remember names), or if you want to look up an item from the macro glossary, you can use the doc utility.

`gmX doc foo.html`

  will look for foo.html in Template/html. If found, it'll display it to you nicely, without the tags showing up, but somewhat formatted according to them. (It does this by running lynx -dump through your pager, defaulting to "less -eMsZ" if your PAGER environment variable is not set.) Links show up as footnotes, with paths to game files in terms of $GAME.

`gmX doc foo`

  will look for foo.html where you are as above. If it's not there, it looks for Template/html/foo*.html --- that is, any Template html documentation that starts with foo. If there's only one match, it shows that file to you as above. If there's more than one, it lists them all for you.

`gmX doc`

  by itself will list all available docs in Template/html for you.

`gmX doc \\foo`

  will look up all macros that start "\foo" in the macro glossary and display those entries. In this form doc does not display links. The first backslash on the command line is needed to protect the second from the shell, so that what doc sees is "\foo".

`gmX doc http://foobarbaz`

  will aim lynx at "http://foobarbaz" and output whatever that gives. This is supplied only so that you can consistently use doc to look at all Template-documenting html including the external page(s) of recent issues. But if you're looking at external pages, even those, you probably really want to run a browser manually.

`gmX doc -h or --help`

  will give you basic information on doc (pretty much this stuff).

Sample use of doc:

    athena% gmX doc in
            injector
            intro
            invertmap
    athena% gmX doc intro
    [introductory material in Template/html/intro.html is displayed nicely]