Easy Documentation for Git, MySQL, PHP, et cetera
This is what I do on my box to quickly find documentation, which you guys may find helpful. Especially those of you on Linux—although you could do this on Windows too.
Most package managers make available ‘-doc’ packages, like php-doc, mysql-doc, and so on. Install these for all the major software you use.
Next, install ‘screen’.
Now put this is your Bash config:
-
# Displays various types of documentation.
-
-
function doc() {
-
case "$1" in
-
‘llvm’)
-
screen -t ‘LLVM Documentation’ w3m /usr/share/doc/llvm-doc/html/index.html ;;
-
‘erlang’)
-
screen -t ‘Erlang Documentation’ firefox /usr/share/doc/erlang-doc-html/html/doc/index.html ;;
-
‘python’)
-
screen -t ‘Python Documentation’ w3m /usr/share/doc/python3-doc/html/index.html ;;
-
‘php’)
-
screen -t ‘PHP Documentation’ w3m /usr/share/doc/php-doc/html/index.html ;;
-
‘ghc’)
-
firefox /usr/share/doc/ghc6-doc/index.html & ;;
-
‘postgresql’)
-
screen -t ‘PostgreSQL Documentation’ w3m /usr/share/doc/postgresql-doc-8.4/html/index.html ;;
-
‘mysql’)
-
screen -t ‘MySQL Documentation’ w3m /usr/share/doc/mysql-doc-5.0/refman-5.0-en.html-chapter/index.html ;;
-
‘apache’)
-
screen -t ‘Apache Documentation’ w3m /usr/share/doc/apache2-doc/manual/index.html ;;
-
‘j’)
-
screen -t ‘J Documentation’ w3m ~/Software/j602/help/index.htm ;;
-
‘lua’)
-
screen -t ‘Lua Documentation’ w3m /usr/share/doc/lua5.1-doc/doc/index.html ;;
-
‘git’)
-
screen -t ‘Git Documentation’ w3m /usr/local/share/doc/git-doc/index.html ;;
-
‘lighttpd’)
-
screen -t ‘Lighttpd Documentation’ w3m /usr/share/doc/lighttpd-doc/ ;;
-
‘plt-scheme’)
-
screen -t ‘PLT Scheme Documentation’ w3m /usr/share/plt/doc/index.html ;;
-
‘gambit’)
-
screen -t ‘Gambit Documentation’ w3m /usr/share/doc/gambit-doc/html/index.html ;;
-
‘tintin++’)
-
screen -t ‘TinTin++ Documentation’ zless /usr/share/doc/tintin++/tintin19.txt.gz ;;
-
‘sqlite’)
-
screen -t ‘SQLite Documentation’ w3m /usr/share/doc/sqlite3-doc/index.html ;;
-
‘django’)
-
screen -t ‘Django Documentation’ w3m /usr/share/doc/python-django-doc/html/index.html ;;
-
‘sbcl’)
-
screen -t ‘SBCL Documentation’ w3m /usr/share/doc/sbcl-doc/html/index.html ;;
-
‘boost’)
-
screen -t ‘Boost Documentation’ w3m /usr/share/doc/libboost-doc/HTML/index.htm ;;
-
‘smalltalk’)
-
screen -t ‘GNU Smalltalk Documentation’ info Smalltalk ;;
-
‘haskell-tutorial’)
-
screen -t ‘Haskell 98 Tutorial’ w3m /usr/share/doc/haskell98-tutorial/html/index.html ;;
-
‘haskell-report’)
-
screen -t ‘Haskell 98 Report’ w3m /usr/share/doc/haskell98-report/html/index.html ;;
-
‘java’)
-
firefox "/home/eric/Documents/Books/Programming/Java SDK/index.html" & ;;
-
esac
-
}
Replace ‘w3m’ with the browser you want to use. And make sure the paths are correct. If you’re on a Debian-based box, that’s where those doc packages will end up.
Now whenever you’re at the terminal you can simply run stuff like
$ doc git
$ doc postgresql
to browse through the official docs.
For Git in particular you will have to build the HTML docs. In the Git source directory:
$ make html
$ sudo make install-html
There ya go, easy way to look up docs quickly.
Related posts:
- MySQL Introduction
- PostgreSQL Introduction
- Powerful Data Insertion Features in MySQL
- Issues With MySQL
- Data Schema Documentation Tool : SchemaSpy


Leave a comment