@ 261101.7raw
current

www

www reads directories and repos in the browser: Markdown as pages, code as code, history beside both.

It is for anyone who keeps notes, docs and code in plain files and wants to read them as linked pages. It runs on your machine. Nothing needs a build step, and nothing needs a push first.

A repo on GitHub, GitLab or Codeberg reads the same way, once www has fetched it.

It is fast. A page takes one to three milliseconds and a server starts in about 40 ms. make test fails any page that takes over 5 ms.

Usage

www [-p] [--foreground] [--no-open] [-a ADDR] [--debug] [--no-bug]
    [--cache=SIZE] [--disk=SIZE] [--] [DIR]
www [-p] [--foreground] [--no-open] --share[=HOST] [--secret] [--debug]
    [--no-bug] [--cache=SIZE] [--disk=SIZE] [--] [DIR]
www --restart [-f] [--no-open] [--debug] [--no-bug]
    [-a ADDR | --share[=HOST]] [--] [DIR]
www -l [-a ADDR | --share[=HOST]] [--] [DIR]
www --kill [-a ADDR | --share[=HOST]]
www --commit=REV [--] [DIR]
www --public --disk=SIZE (-a ADDR | --share[=HOST]) [--debug]
    [--cache=SIZE]
www -h | --help
www -V | --version

Run www in a directory. It prints the tree’s URL and opens the browser.

It also writes a lockfile named after the endpoint, eg 127.31.1.1-8080.lock. Delete the lockfile to stop serving the tree. Trees on one address share one server, which exits when its last lock is gone.

www                         serve this directory and open it
www -p ~/notes              serve ~/notes, and again after a reboot
www --share=192.168.1.5     serve this directory to the LAN
www -l                      list every served tree as keyval
www --restart               move every server to the current binary
www --public --disk=6G -a 127.0.0.1:8080
                            serve online repos to the web, behind a proxy

Add ?log to any page’s URL for its history.

To read a repo from GitHub, open http://127.31.1.2/github.com/junegunn/fzf/.

Install

www needs git.

make install links build/www into ~/.local/bin and serves on port 8080.

make install-deb builds and installs two Debian packages: www and its syntax tree helper. The package’s binary may bind port 80, so URLs carry no port.

Documentation

Licence

MIT, see LICENSE.

The embedded fonts are subsets of STIX Two Text and Iosevka, under the SIL Open Font License: see assets/fonts/STIXTwoText-OFL.txt and assets/fonts/Iosevka-OFL.txt.

The binary links in three Go modules under the MIT licence: goldmark by Yusuke Inuzuka, chroma by Alec Thomas and regexp2 by Doug Clark. regexp2 ports parts of Microsoft’s dotnet/corefx. The package’s copyright file carries their notices.