You are viewing a plain text version of this content. The canonical link for it is here.
Posted to docs@httpd.apache.org by Rich Bowen <rb...@rcbowen.com> on 2005/07/21 12:16:09 UTC
Auto-docs rewrite
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.
Thoughts?
--Rich
---------------------------------------------------------------------
To unsubscribe, e-mail: docs-unsubscribe@httpd.apache.org
For additional commands, e-mail: docs-help@httpd.apache.org
Re: Auto-docs rewrite
Posted by André Malo <nd...@perlig.de>.
* William A. Rowe, Jr. wrote:
> At 04:53 AM 8/6/2005, André Malo wrote:
> >> >I'd consider query?directive not as that easy as it could be. Think
> >> > of the users that type them manually.
> >>
> >> Yes, I'm thinking of manual entry; and i want something that is
> >> clearly distinct from normal filesystem entries, for the sake of
> >> various query, spiders, and caching approaches.
> >
> >HTTP doesn't know about file systems, so I'm wondering why a spider
> > would care. URLs with query string are indexed as any other URL for a
> > long time now.
>
> You seem to be missing my point; I don't want spiders crawling that
> section, it will be lookup intensive. If users google they can hit
> the very same information from the normal pages.
There is no section to crawl. The rules respond with redirects to the real
documents. If someone sets a link to one of these recognized URLs and a
spider follows it, then the redirect will be followed and nothing else
happens. Where do you see a crawling problem? From outside view the
redirects are not related to each other.
nd
--
s s^saaaaaoaaaoaaaaooooaaoaaaomaaaa a alataa aaoat a a
a maoaa a laoata a oia a o a m a o alaoooat aaool aaoaa
matooololaaatoto aaa o a o ms;s;\s;s;g;y;s;:;s;y#mailto: #
\51/\134\137| http://www.perlig.de #;print;# > nd@perlig.de
---------------------------------------------------------------------
To unsubscribe, e-mail: docs-unsubscribe@httpd.apache.org
For additional commands, e-mail: docs-help@httpd.apache.org
Re: Auto-docs rewrite
Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
At 04:53 AM 8/6/2005, André Malo wrote:
>> >I'd consider query?directive not as that easy as it could be. Think of
>> > the users that type them manually.
>>
>> Yes, I'm thinking of manual entry; and i want something that is
>> clearly distinct from normal filesystem entries, for the sake of
>> various query, spiders, and caching approaches.
>
>HTTP doesn't know about file systems, so I'm wondering why a spider would
>care. URLs with query string are indexed as any other URL for a long time
>now.
You seem to be missing my point; I don't want spiders crawling that
section, it will be lookup intensive. If users google they can hit
the very same information from the normal pages.
That said, obviously we can use robots.txt to exclude query* and be
done with it. Not sure if all spiders would grok excluding //*.
We could certainly use /411/xxxx if that's quicker than /411?xxxx
Bill
---------------------------------------------------------------------
To unsubscribe, e-mail: docs-unsubscribe@httpd.apache.org
For additional commands, e-mail: docs-help@httpd.apache.org
Re: Auto-docs rewrite
Posted by André Malo <nd...@perlig.de>.
* William A. Rowe, Jr. wrote:
> Nak!!! // is most definately a distinct location :)
Hmm.
> You are reading the uri as a filesystem location; but in fact
> the RFC doesn't consider // equivilant to /, otherwise the Location
> directive would flatten such issues out of scope :)
Actually it's other way 'round. // is not equal to / in file system
locations (e.g. UNC paths). Further <Location>, Alias and whatnot work with
squeezed slashes. <LocationMatch> is an exception, because of a backwards
compat bug as stated in the docs. mod_rewrite is also an exception for some
reason, but only in server context.
But you're right, that the RFC (1738) allows empty path segments - whatever
this means. I'm sure I've read somewhere that // are equivalent to /. Can't
remember, where. hrmpf. ;)
> >I'd consider query?directive not as that easy as it could be. Think of
> > the users that type them manually.
>
> Yes, I'm thinking of manual entry; and i want something that is
> clearly distinct from normal filesystem entries, for the sake of
> various query, spiders, and caching approaches.
HTTP doesn't know about file systems, so I'm wondering why a spider would
care. URLs with query string are indexed as any other URL for a long time
now.
Further a question mark is not as easy to type as just a directive name
(look at keyboard layouts different from US-querty). Further the user needs
to remember what to type to get a result.
My suggestion (in the other mail) put the stuff into httpd.apache.org/docs/
where currently only version numbers exist in the file system. It's also
kinda logical to the user that he can find things under
'httpd.apache.org/docs/directive'.
The point of the whole construction is to make it as easy as possible for
the user, not to have him to learn one more thing he's likely to forget
again and again.
> >> or something that doesn't imply that it's part of the normal content,
> >> and something we can remove from robots? (They will harvest these
> >> anyways as part of crawling the true docs set.)
> >
> >R=301 will do, I guess.
>
> Hows that?
301 response codes are cachable and the client (e.g. spider) is allowed to
forget the original URI. Google, for example does exactly this.
nd
--
If God intended people to be naked, they would be born that way.
-- Oscar Wilde
---------------------------------------------------------------------
To unsubscribe, e-mail: docs-unsubscribe@httpd.apache.org
For additional commands, e-mail: docs-help@httpd.apache.org
Re: Auto-docs rewrite
Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
At 04:08 PM 7/23/2005, André Malo wrote:
>* William A. Rowe, Jr. wrote:
>
>> To disambiguate these requests, would you consider...
>>
>> http://httpd.apache.org//directive
>> http://httpd.apache.org/query?directive
>
>// is equeivalent to / in URLs
Nak!!! // is most definately a distinct location :)
You are reading the uri as a filesystem location; but in fact
the RFC doesn't consider // equivilant to /, otherwise the Location
directive would flatten such issues out of scope :)
>I'd consider query?directive not as that easy as it could be. Think of the
>users that type them manually.
Yes, I'm thinking of manual entry; and i want something that is
clearly distinct from normal filesystem entries, for the sake of
various query, spiders, and caching approaches.
>> or something that doesn't imply that it's part of the normal content,
>> and something we can remove from robots? (They will harvest these
>> anyways as part of crawling the true docs set.)
>
>R=301 will do, I guess.
Hows that?
---------------------------------------------------------------------
To unsubscribe, e-mail: docs-unsubscribe@httpd.apache.org
For additional commands, e-mail: docs-help@httpd.apache.org
Re: Auto-docs rewrite
Posted by André Malo <nd...@perlig.de>.
* William A. Rowe, Jr. wrote:
> To disambiguate these requests, would you consider...
>
> http://httpd.apache.org//directive
> http://httpd.apache.org/query?directive
// is equeivalent to / in URLs, so that won't make a difference.
I'd consider query?directive not as that easy as it could be. Think of the
users that type them manually.
> or something that doesn't imply that it's part of the normal content,
> and something we can remove from robots? (They will harvest these
> anyways as part of crawling the true docs set.)
R=301 will do, I guess.
nd
--
"Das Verhalten von Gates hatte mir bewiesen, dass ich auf ihn und seine
beiden Gefährten nicht zu zählen brauchte" -- Karl May, "Winnetou III"
Im Westen was neues: <http://pub.perlig.de/books.html#apache2>
---------------------------------------------------------------------
To unsubscribe, e-mail: docs-unsubscribe@httpd.apache.org
For additional commands, e-mail: docs-help@httpd.apache.org
Re: Auto-docs rewrite
Posted by Joshua Slive <jo...@slive.ca>.
Rich Bowen wrote:
>>I'd also probably recommend using httpd.apache.org/goto/SomeDirective or
>>even httpd.apache.org/docs/SomeDirective to avoid namespace conflicts
>>and extra filesystem checks that are needed if we overlap with the main
>>website.
>
>
> Well ... I'm really not terribly thrilled about that. The goal is to
> make the URLs as simple as possible. I know this is repetitive, but what
> I'm trying to emulate is the fact that I can just type "php.net/getdate"
> in my browser and get the docs for that function. It makes it amazingly
> fast and easy to get documentation when I'm working. I want Apache to be
> that easy. I'm much more interested in the user's ease of use than
> having the "right" url structure.
I'm willing to try that out. This shouldn't be something that people
are bookmarking, so we can always change it later.
Joshua.
---------------------------------------------------------------------
To unsubscribe, e-mail: docs-unsubscribe@httpd.apache.org
For additional commands, e-mail: docs-help@httpd.apache.org
Re: Auto-docs rewrite
Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
At 02:50 AM 7/22/2005, Rich Bowen wrote:
>-----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA1
>
>>> So httpd.apache.org/SomeDirective?
>>>
>>> Where would it go? 1.3? 2.0? 2.1? 2.2? Just the latest stable?
>>> If we get a consensus on this I have no problem with that stuff in
>>> general.
>>
>> I'd say 'latest stable' (2.0 at the moment).
>
>Yes. Latest stable.
>
>> How do we expect people to find out about the existence of this feature?
>> We could really use an improved /docs-project/ page to give better info
>> about the docs.
>
>I'm not sure how I found out about the php.net autodoc function. It's
>just something that "everybody knows". So, yes, we should advertise it,
>and I think knowledge of it will gradually spread.
>
>> I'd also probably recommend using httpd.apache.org/goto/SomeDirective or
>> even httpd.apache.org/docs/SomeDirective to avoid namespace conflicts
>> and extra filesystem checks that are needed if we overlap with the main
>> website.
>
>Well ... I'm really not terribly thrilled about that. The goal is to
>make the URLs as simple as possible. I know this is repetitive, but what
>I'm trying to emulate is the fact that I can just type "php.net/getdate"
>in my browser and get the docs for that function. It makes it amazingly
>fast and easy to get documentation when I'm working. I want Apache to be
>that easy. I'm much more interested in the user's ease of use than
>having the "right" url structure.
To disambiguate these requests, would you consider...
http://httpd.apache.org//directive
http://httpd.apache.org/query?directive
or something that doesn't imply that it's part of the normal content,
and something we can remove from robots? (They will harvest these
anyways as part of crawling the true docs set.)
Bill
---------------------------------------------------------------------
To unsubscribe, e-mail: docs-unsubscribe@httpd.apache.org
For additional commands, e-mail: docs-help@httpd.apache.org
Re: Auto-docs rewrite
Posted by Rich Bowen <rb...@rcbowen.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
>> So httpd.apache.org/SomeDirective?
>>
>> Where would it go? 1.3? 2.0? 2.1? 2.2? Just the latest stable?
>> If we get a consensus on this I have no problem with that stuff in
>> general.
>
> I'd say 'latest stable' (2.0 at the moment).
Yes. Latest stable.
> How do we expect people to find out about the existence of this feature?
> We could really use an improved /docs-project/ page to give better info
> about the docs.
I'm not sure how I found out about the php.net autodoc function. It's
just something that "everybody knows". So, yes, we should advertise it,
and I think knowledge of it will gradually spread.
> I'd also probably recommend using httpd.apache.org/goto/SomeDirective or
> even httpd.apache.org/docs/SomeDirective to avoid namespace conflicts
> and extra filesystem checks that are needed if we overlap with the main
> website.
Well ... I'm really not terribly thrilled about that. The goal is to
make the URLs as simple as possible. I know this is repetitive, but what
I'm trying to emulate is the fact that I can just type "php.net/getdate"
in my browser and get the docs for that function. It makes it amazingly
fast and easy to get documentation when I'm working. I want Apache to be
that easy. I'm much more interested in the user's ease of use than
having the "right" url structure.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFC4KVEXP03+sx4yJMRAiUHAJ4/w3djSToTCLzKIbhhPToGnL47GACgsZUa
59Ng4jhJba/MQpLq5A3KblI=
=VEgx
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: docs-unsubscribe@httpd.apache.org
For additional commands, e-mail: docs-help@httpd.apache.org
Re: Auto-docs rewrite
Posted by Astrid Keßler <ke...@kess-net.de>.
>> So httpd.apache.org/SomeDirective?
>>
>> Where would it go? 1.3? 2.0? 2.1? 2.2? Just the latest stable?
>> If we get a consensus on this I have no problem with that stuff in general.
> I'd say 'latest stable' (2.0 at the moment).
+1
> How do we expect people to find out about the existence of this feature?
> We could really use an improved /docs-project/ page to give better
> info about the docs.
> I'd also probably recommend using
> httpd.apache.org/goto/SomeDirective or
> even httpd.apache.org/docs/SomeDirective to avoid namespace conflicts
> and extra filesystem checks that are needed if we overlap with the main
> website.
httpd.apache.org/docs/SomeDirective would be fine.
httpd.apache.org/docs/goto/SomeDirective or something similar would also
do it. But httpd.apache.org/goto/SomeDirective is outsite of the
httpd.apache.org/docs namespace. I think, we should avoid this.
Kess
---------------------------------------------------------------------
To unsubscribe, e-mail: docs-unsubscribe@httpd.apache.org
For additional commands, e-mail: docs-help@httpd.apache.org
Re: Auto-docs rewrite
Posted by Jason Lingohr <js...@apache.org>.
Joshua Slive wrote:
>> So httpd.apache.org/SomeDirective?
>>
>> Where would it go? 1.3? 2.0? 2.1? 2.2? Just the latest stable?
>> If we get a consensus on this I have no problem with that stuff in
>> general.
>
>
> I'd say 'latest stable' (2.0 at the moment).
>
+1, I like it.
Jason.
---------------------------------------------------------------------
To unsubscribe, e-mail: docs-unsubscribe@httpd.apache.org
For additional commands, e-mail: docs-help@httpd.apache.org
Re: Auto-docs rewrite
Posted by Joshua Slive <jo...@slive.ca>.
André Malo wrote:
> * Rich Bowen wrote:
>
>> 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.
>
> So httpd.apache.org/SomeDirective?
>
> Where would it go? 1.3? 2.0? 2.1? 2.2? Just the latest stable?
> If we get a consensus on this I have no problem with that stuff in general.
I'd say 'latest stable' (2.0 at the moment).
How do we expect people to find out about the existence of this feature?
We could really use an improved /docs-project/ page to give better
info about the docs.
I'd also probably recommend using httpd.apache.org/goto/SomeDirective or
even httpd.apache.org/docs/SomeDirective to avoid namespace conflicts
and extra filesystem checks that are needed if we overlap with the main
website.
Overall, looks cool to me.
Joshua.
---------------------------------------------------------------------
To unsubscribe, e-mail: docs-unsubscribe@httpd.apache.org
For additional commands, e-mail: docs-help@httpd.apache.org
Re: Auto-docs rewrite
Posted by André Malo <nd...@perlig.de>.
* Rich Bowen wrote:
> 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.
So httpd.apache.org/SomeDirective?
Where would it go? 1.3? 2.0? 2.1? 2.2? Just the latest stable?
If we get a consensus on this I have no problem with that stuff in general.
> 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]
Well, that should be made less complex, but I get the idea :-)
> 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.
Heck, I'm trying to reduce the use of perl in the docs build ;-) We can
easily do this with xslt (just like the directive list is generated).
Further we could include the module names themselves as well (with and
without prefixes).
I think, we should generate that text file then, check it in and transform
it to dbm on the server. (or just leave it as is -- text maps are cached in
the server)
nd
--
"Umfassendes Werk (auch fuer Umsteiger vom Apache 1.3)"
-- aus einer Rezension
<http://pub.perlig.de/books.html#apache2>
---------------------------------------------------------------------
To unsubscribe, e-mail: docs-unsubscribe@httpd.apache.org
For additional commands, e-mail: docs-help@httpd.apache.org
Re: Auto-docs rewrite
Posted by Mads Toftum <ma...@toftum.dk>.
On Sun, Jul 24, 2005 at 10:27:49AM +0200, André Malo wrote:
> The mapfile (txt) will be added to the normal build process like the
> typemaps if it's ready. However, all stuff in manual will be distributed
> with the httpd releases, so I hestitate to add a dbm file there, as long as
> we don't have a separation of online docs and distributed docs. I'd like to
> generate it server side (and which dbm type should it use?). Somehow...
>
Agreed on that - once we get a new build of httpd up and running, we
should have an httxt2dbm that will do the right thing on the serverside,
so all we need is to convince someone with access to set up a cronjob to
do the actual conversion.
vh
Mads Toftum
--
`Darn it, who spiked my coffee with water?!' - lwall
---------------------------------------------------------------------
To unsubscribe, e-mail: docs-unsubscribe@httpd.apache.org
For additional commands, e-mail: docs-help@httpd.apache.org
Re: Auto-docs rewrite
Posted by André Malo <nd...@perlig.de>.
* Mads Toftum wrote:
> On Sat, Jul 23, 2005 at 11:14:35PM +0200, André Malo wrote:
>> I'm not sure how and when to convert to dbm, though (possibly
>> automatically). Ideas?
>
> httxt2dbm?
Sure ;-)
> Maybe the txt file could be generated when generating the
> list of directives for the docs?
The mapfile (txt) will be added to the normal build process like the
typemaps if it's ready. However, all stuff in manual will be distributed
with the httpd releases, so I hestitate to add a dbm file there, as long as
we don't have a separation of online docs and distributed docs. I'd like to
generate it server side (and which dbm type should it use?). Somehow...
nd
--
"Das Verhalten von Gates hatte mir bewiesen, dass ich auf ihn und seine
beiden Gefährten nicht zu zählen brauchte" -- Karl May, "Winnetou III"
Im Westen was neues: <http://pub.perlig.de/books.html#apache2>
---------------------------------------------------------------------
To unsubscribe, e-mail: docs-unsubscribe@httpd.apache.org
For additional commands, e-mail: docs-help@httpd.apache.org
Re: Auto-docs rewrite
Posted by Mads Toftum <ma...@toftum.dk>.
On Sat, Jul 23, 2005 at 11:14:35PM +0200, André Malo wrote:
> How about the following when using the generated map I've just committed to
> trunk/docs/manual.
>
> RewriteEngine On
> RewriteMap tolower int:tolower
> RewriteMap dir2url txt:/path/to/convenience.map
>
> RewriteCond ${dir2url:${tolower:$1}} (.+)
> RewriteRule ^/+docs/+([^/]+)$ /docs/2.0/%1 [R=301,NE,L]
>
Much better.
> I'm not sure how and when to convert to dbm, though (possibly
> automatically). Ideas?
>
httxt2dbm? Maybe the txt file could be generated when generating the
list of directives for the docs?
vh
Mads Toftum
--
`Darn it, who spiked my coffee with water?!' - lwall
---------------------------------------------------------------------
To unsubscribe, e-mail: docs-unsubscribe@httpd.apache.org
For additional commands, e-mail: docs-help@httpd.apache.org
Re: Auto-docs rewrite
Posted by André Malo <nd...@perlig.de>.
* Mads Toftum wrote:
> On Thu, Jul 21, 2005 at 12:40:13PM +0200, Rich Bowen wrote:
> > 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]
>
> I'm not too thrilled about this idea, because I think it would be a real
> performace killer. AFAIK ajax is more than busy enough as it is, it
> doesn't need more to do. If you really want to go through with this,
> then make it a lot simpler to get rid of the -d and -f.
How about the following when using the generated map I've just committed to
trunk/docs/manual.
RewriteEngine On
RewriteMap tolower int:tolower
RewriteMap dir2url txt:/path/to/convenience.map
RewriteCond ${dir2url:${tolower:$1}} (.+)
RewriteRule ^/+docs/+([^/]+)$ /docs/2.0/%1 [R=301,NE,L]
I'm not sure how and when to convert to dbm, though (possibly
automatically). Ideas?
nd
--
"Solides und umfangreiches Buch"
-- aus einer Rezension
<http://pub.perlig.de/books.html#apache2>
---------------------------------------------------------------------
To unsubscribe, e-mail: docs-unsubscribe@httpd.apache.org
For additional commands, e-mail: docs-help@httpd.apache.org
Re: Auto-docs rewrite
Posted by Mads Toftum <ma...@toftum.dk>.
On Thu, Jul 21, 2005 at 12:40:13PM +0200, Rich Bowen wrote:
> 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]
>
I'm not too thrilled about this idea, because I think it would be a real
performace killer. AFAIK ajax is more than busy enough as it is, it
doesn't need more to do. If you really want to go through with this,
then make it a lot simpler to get rid of the -d and -f.
vh
Mads Toftum
--
`Darn it, who spiked my coffee with water?!' - lwall
---------------------------------------------------------------------
To unsubscribe, e-mail: docs-unsubscribe@httpd.apache.org
For additional commands, e-mail: docs-help@httpd.apache.org
Re: Auto-docs rewrite
Posted by Rich Bowen <rb...@rcbowen.com>.
-----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