Monday, November 23, 2015

Reading Racket Documentation on Android, No Internet Needed

I've got emacs and racket running nicely on my Android phone (thanks to the awesome Gnuroot). But that left me with a new wrinkle: what's the best way to access Racket Documentation while programming on my phone? Obviously, I can open up a browser to doc.racket-lang.org but what if I'm a context where I don't have access to the Net?

By default, apt-get appears to install racket documentation in /usr/share/doc/racket, which means that my phone had the documentation, I just needed a way of viewing it.

Method 1: w3m. A quick and easy way to view the documentation is to run apt-get install w3m, and install w3m. w3m is an extremely handy tool as it lets you view html files from the command line. For example:

Method 2: launch a local web server. While w3m is a fast and functional solution, I wanted to be able to view the documentation in a standard browser, too. I figured I could accomplish this if I kicked off a local webserver. I could then point my regular Android browser to this server and I'd be all set. While I'm sure I could have installed apache or another full featured server, I found an easier and lighter weight solution: wbox. wbox is a testing tool that happens to offer the capability of being a stand alone, zero configuration, web server. Installing wbox is as easy as running apt-get install wbox. And here it is in action:

(Note the URL is: http://localhost:8081)

wbox worked perfectly, and I should be able to leverage this same approach to hosting any local documentation.

Combine this local web browser approach with Android Multi Window, and you've got a remarkably functional environment.

I'm one step closer to a full self contained, no-Internet-needed, development environment.

3 comments:

  1. If you have Python already installed, you can also say "python -m SimpleHTTPServer 8000" to get a trivial web server on port 8000.

    ReplyDelete
  2. You plan *not* to use the Internet...

    ReplyDelete
  3. Grant -

    When I'm flying (on a WiFi-less flight) and want to program, yeah, I plan to *not* use the Internet :-).

    ReplyDelete