httpd-docs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rich Bowen <rbo...@rcbowen.com>
Subject Re: Auto-docs rewrite
Date Thu, 21 Jul 2005 10:40:13 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Rich Bowen wrote:
> While we're on the topic of docs URLs, I've got a feature that I'd like
> to have on the docs site. I've got it already at
> http://fajita.drbacchus.com/ and it's like the php.net auto-docs URLs.
> http://php.net/ANY_FUNCTION goes to the documentation for that function.
> Likewise, http://fajita.drbacchus.com/AllowOverride goes to the docs for
> AllowOverride, and likewise for every configuration directive.
> 
> I'm doing this with a simple RewriteMap directive. I'd like to have this
> same functionality on httpd.apache.org.

By the way, here's the details:


Config:

RewriteMap directive2url \
   dbm:/www/vhosts/drbacchus/fajita/scripts/rewritemap.txt
RewriteMap tolower int:tolower

RewriteCond %{REQUEST_URI} !^/(index.html)?$
RewriteCond %{REQUEST_URI} !^/(urls|to|be|excluded)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/([^/]*)$ \
  ${directive2url:${tolower:$1}|http://httpd.apache.org/docs-2.0} [NE,R,L]



The rewrite map file itself is 359 lines, and so making it a dbm seems
to be a really good idea, particularly since Paul went and created the
shiny new httxt2dbm utility. The file will change very infrequently
(when a directive is added/removed) so maintenance is not a big hassle
for anyone.

Entries in the map file look like:
aliasmatch http://httpd.apache.org/docs-2.0/mod/mod_alias.html#AliasMatch

and are generated directly from the documentation XML by a little (18
line) perl script. The target URL can be fully qualified like that, or I
suppose it could just be a local URL, if we're only going to run it on
the main site.




- --Rich
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFC33uNXP03+sx4yJMRAkByAJwJcLixhlPfz21Lq22Gqc4npX9z3ACgmsNY
vw/sQ51t7KG2lrtvrIt1rEo=
=JUJB
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: docs-unsubscribe@httpd.apache.org
For additional commands, e-mail: docs-help@httpd.apache.org


Mime
View raw message