[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
HOWTO: Serve htags generated website (CGI, AJAX and all) using just Pyth
HOWTO: Serve htags generated website (CGI, AJAX and all) using just Python. No scripting required.
Fri, 08 Feb 2013 00:55:13 +0100
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130109 Thunderbird/17.0.2
Perhaps not all of you know this, but it is possible (and very
convenient :-) to serve the website generated by for example:
$ htags --suggest2
using nothing more than a Python installation. No need to edit daunting
configuration files, change (or ask for) permissions, etcetera.
First, setup GTAGSROOT
In the root of your source directory, where the tags files and HTML
directory are, do:
$ pwd > GTAGSROOT # This is needed so that global.cgi can find the tags
Next, start Python's built-in HTTP/CGI server.
If you're using Python 3.x, do:
$ (cd HTML; python -m http.server --cgi)
If you're using Python 2.x, do:
$ (cd HTML; python -m CGIHTTPServer)
Now, you can surf to: http://localhost:8000/index.html
and browse and search your source code, with all the AJAX goodness like
symbol completion, dynamic cross-references, etc.
Currently, there is a small problem, when a search for a symbol returns
only 1 result, you will get a blank page instead of being taken to the
source file with the symbol.
I have sent a patch to address this problem to the bug-global mailing
list (look for "[PATCH][Feature request] global.cgi: Add a fallback
redirect method for webservers which do not support CGI redirects". I
hope this issue gets fixed soon.
Have fun :-)
|[Prev in Thread]
||[Next in Thread]|
- HOWTO: Serve htags generated website (CGI, AJAX and all) using just Python. No scripting required.,
Alain Kalker <=