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 2010/05/11 00:39:44 UTC

javascript in docs?

I'd like to put a little javascript in the 1.3 docs that takes the  
requested URI and suggests an equivalent one in the 2.2 docs. Is there  
any strong objection to doing this?

--
Rich Bowen
rbowen@rcbowen.com




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


Re: javascript in docs?

Posted by Rich Bowen <rb...@rcbowen.com>.
On May 10, 2010, at 7:12 PM, Nick Kew wrote:

>
> On 10 May 2010, at 23:39, Rich Bowen wrote:
>
>> I'd like to put a little javascript in the 1.3 docs that takes the  
>> requested URI and suggests an equivalent one in the 2.2 docs. Is  
>> there any strong objection to doing this?
>
> Does that need to be javascript?  Why not insert it as a simple link
> generated from the XSLT?  Or at worst, serverside using SSI +  
> xbithack?

No reason. Just working with the tools I know. If there's an easy way  
to do it with SSI, that would be fine. But it's not generated from the  
XSLT in the 1.3 docs. Just straight HTML and this one included header  
file that I have to work with.

--
Rich Bowen
rbowen@rcbowen.com




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


Re: javascript in docs?

Posted by Rich Bowen <rb...@rcbowen.com>.
On May 14, 2010, at 1:37 PM, Igor Galić wrote:

>> Having /docs/ redirect to /docs/1.3/ no longer makes sense. /docs/ 
>> 1.3/
>> should be a permanent redirect to /docs/current/ which should be a  
>> 302
>> to /docs/2.2 (or whatever is current at the time).
>
> This doesn't make sense. /docs/1.3/ should stay where it is.
> I suppose you mean /docs/ -> /docs/current/

Yes, I'm sorry. Let me try again.

/docs/ -> /docs/current
/docs/current -> /docs/2.2
/docs/1.3 remains /docs/1.3

Before we do this we need a friendly 404 page that tells them that 1.3  
is no more, and possibly contains links to the 1.3 docs for the URL  
they requested, as well as links to the other docs.

--
Rich Bowen
rbowen@rcbowen.com




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


Re: javascript in docs?

Posted by Igor Galić <i....@brainsware.org>.
----- "Rich Bowen" <rb...@rcbowen.com> wrote:

> Assuming that we can make it work with the various rewrite rules and
> stuff, here's what I'd like to see:
> 
> /docs/ still goes to /docs/1.3/ for the short term. We update those
> docs to provide links to the improved resource. Later down the road (6
> months? a year?) we start providing distinct 1.3 vs latest links on
> those pages, and then eventually move /docs/ to point to
> /docs/current/
> 
> /docs/x.y/ goes to docs/x.y/ Duh
> 
> /docs/current goes to /docs/2.2 and gets updated with each subsequent
> release.
> 
> 404 goes to a helpful page explaining that the 1.3 version is
> abandonware, and here's a link to a redirection thingy that might know
> what you were looking for.
> 
> The downside is that we don't get seamless redirection for 1.3 links
> (although we might in some cases) and so existing broken links remain
> broken until someone takes the initiative to fix them. I'm not
> persuaded by the "don't break links" argument. A good link to a bad
> resource is a broken link, by definition.
> 
> After some further discussion on IRC, I suppose I'll say what I really
> think.
> 
> 
> Having /docs/ redirect to /docs/1.3/ no longer makes sense. /docs/1.3/
> should be a permanent redirect to /docs/current/ which should be a 302
> to /docs/2.2 (or whatever is current at the time).

This doesn't make sense. /docs/1.3/ should stay where it is.
I suppose you mean /docs/ -> /docs/current/
 
> We'll need to have some sensible handling of 404 conditions. A nice
> 404 handler with multiple choices would be great. But the time has
> passed to be serving 1.3 docs as our default response for /docs/
> requests.
> 
> 
> I'm going to send Tony a patch to make this happen. I think that the
> time has come.
> 
> 
> 
> 
> --
> Rich Bowen
> rbowen@rcbowen.com

-- 
Igor Galić

Tel: +43 (0) 699 122 96 338
Fax: +43(0) 1 91 333 41
Mail: i.galic@brainsware.org
URL: http://brainsware.org/

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


Re: javascript in docs?

Posted by Rich Bowen <rb...@rcbowen.com>.
>
> Assuming that we can make it work with the various rewrite rules and  
> stuff, here's what I'd like to see:
>
> /docs/ still goes to /docs/1.3/ for the short term. We update those  
> docs to provide links to the improved resource. Later down the road  
> (6 months? a year?) we start providing distinct 1.3 vs latest links  
> on those pages, and then eventually move /docs/ to point to /docs/ 
> current/
>
> /docs/x.y/ goes to docs/x.y/  Duh
>
> /docs/current goes to /docs/2.2 and gets updated with each  
> subsequent release.
>
> 404 goes to a helpful page explaining that the 1.3 version is  
> abandonware, and here's a link to a redirection thingy that might  
> know what you were looking for.
>
> The downside is that we don't get seamless redirection for 1.3 links  
> (although we might in some cases) and so existing broken links  
> remain broken until someone takes the initiative to fix them. I'm  
> not persuaded by the "don't break links" argument. A good link to a  
> bad resource is a broken link, by definition.

After some further discussion on IRC, I suppose I'll say what I really  
think.

Having /docs/ redirect to /docs/1.3/ no longer makes sense. /docs/1.3/  
should be a permanent redirect to /docs/current/ which should be a 302  
to /docs/2.2 (or whatever is current at the time).

We'll need to have some sensible handling of 404 conditions. A nice  
404 handler with multiple choices would be great. But the time has  
passed to be serving 1.3 docs as our default response for /docs/  
requests.

I'm going to send Tony a patch to make this happen. I think that the  
time has come.

--
Rich Bowen
rbowen@rcbowen.com




Re: javascript in docs?

Posted by Rich Bowen <rb...@rcbowen.com>.
On May 14, 2010, at 12:35 PM, Tony Stevenson wrote:

> If you intend to re-open the discussion of /docs/current - or  
> something similar, it may be prudent for you to go through the  
> mangled mess that is the vhost configuration for httpd.a.o (rewrites  
> and multi-language support).

Assuming that we can make it work with the various rewrite rules and  
stuff, here's what I'd like to see:

/docs/ still goes to /docs/1.3/ for the short term. We update those  
docs to provide links to the improved resource. Later down the road (6  
months? a year?) we start providing distinct 1.3 vs latest links on  
those pages, and then eventually move /docs/ to point to /docs/current/

/docs/x.y/ goes to docs/x.y/  Duh

/docs/current goes to /docs/2.2 and gets updated with each subsequent  
release.

404 goes to a helpful page explaining that the 1.3 version is  
abandonware, and here's a link to a redirection thingy that might know  
what you were looking for.

The downside is that we don't get seamless redirection for 1.3 links  
(although we might in some cases) and so existing broken links remain  
broken until someone takes the initiative to fix them. I'm not  
persuaded by the "don't break links" argument. A good link to a bad  
resource is a broken link, by definition.

--
Rich Bowen
rbowen@rcbowen.com




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


Re: javascript in docs?

Posted by Rich Bowen <rb...@rcbowen.com>.
On May 14, 2010, at 12:35 PM, Tony Stevenson wrote:

> On 14/05/2010 14:22, Rich Bowen wrote:
>> >
>> The last time we debated this was before 1.3 was declared End Of  
>> Life. I
>> think it's safe to discuss it again.
>>
>
> Rich,
>
> If you intend to re-open the discussion of /docs/current - or  
> something similar, it may be prudent for you to go through the  
> mangled mess that is the vhost configuration for httpd.a.o (rewrites  
> and multi-language support).
>
> If you can give us (infra) a working config, the barrier for an  
> outright no is significantly raised.



Yes. My apologies. I'm largely responsible for that mangled mess. Can  
you please remind me where that is in svn, so that I can submit a  
useful patch? Thanks.


--
Rich Bowen
rbowen@rcbowen.com




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


Re: javascript in docs?

Posted by Tony Stevenson <to...@pc-tony.com>.
On 14/05/2010 14:22, Rich Bowen wrote:
> >
> The last time we debated this was before 1.3 was declared End Of Life. I
> think it's safe to discuss it again.
>

Rich,

If you intend to re-open the discussion of /docs/current - or something 
similar, it may be prudent for you to go through the mangled mess that 
is the vhost configuration for httpd.a.o (rewrites and multi-language 
support).

If you can give us (infra) a working config, the barrier for an outright 
no is significantly raised.


-- 
Cheers,
Tony


--------------------------------------------
Tony Stevenson

tony@pc-tony.com - pctony@apache.org
pctony@freenode.net - tony@caret.cam.ac.uk

http://blog.pc-tony.com

1024D/51047D66
--------------------------------------------

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


Re: javascript in docs?

Posted by Rich Bowen <rb...@rcbowen.com>.
On May 14, 2010, at 9:09 AM, Vincent Bray wrote:

> On 14 May 2010 13:50, Rich Bowen <rb...@rcbowen.com> wrote:
>> Yeah, I suppose static is preferable to dynamic. Very good points.
>
> Which just leaves the fun question of where to link to. Can we now
> have a /docs/current/ or /docs/stable/ ? Perhaps one that redirects to
> the numbered current/stable version. I know this subject has a long
> and tedious history, but if we're going to link from old -> new, it
> would be nice to keep new new.

The last time we debated this was before 1.3 was declared End Of Life.  
I think it's safe to discuss it again.

--
Rich Bowen
rbowen@rcbowen.com




RE: javascript in docs?

Posted by Vincent de Lau <vi...@delau.nl>.
> -----Original Message-----
> From: Vincent Bray [mailto:noodlet@gmail.com]
> Sent: Friday, May 14, 2010 3:10 PM
> 
> On 14 May 2010 13:50, Rich Bowen <rb...@rcbowen.com> wrote:
> > Yeah, I suppose static is preferable to dynamic. Very good points.
> 
> Which just leaves the fun question of where to link to. Can we now
> have a /docs/current/ or /docs/stable/ ? Perhaps one that redirects to
> the numbered current/stable version. I know this subject has a long
> and tedious history, but if we're going to link from old -> new, it
> would be nice to keep new new.

I think this is not so easy to do, since /foo might exist in 1.3 and 2.2 but is removed in a future version. You then would have to go back and edit 1.3 anyway. 

The redirector solution allows you to dynamically update the map. A dynamic include could also alter the warning message in old docs (e.g. mod_auth was replaced, read here for the new ...) or even display various version in future docs.

I can help with the latter two. For changing the static files, I'll leave that for somebody else.

Vincent de Lau
 vincent@delau.nl



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


Re: javascript in docs?

Posted by Vincent Bray <no...@gmail.com>.
On 14 May 2010 13:50, Rich Bowen <rb...@rcbowen.com> wrote:
> Yeah, I suppose static is preferable to dynamic. Very good points.

Which just leaves the fun question of where to link to. Can we now
have a /docs/current/ or /docs/stable/ ? Perhaps one that redirects to
the numbered current/stable version. I know this subject has a long
and tedious history, but if we're going to link from old -> new, it
would be nice to keep new new.

-- 
noodl

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


Re: javascript in docs?

Posted by Rich Bowen <rb...@rcbowen.com>.
On May 14, 2010, at 8:16 AM, Vincent Bray wrote:

> On 11 May 2010 01:56, Sander Temme <sa...@temme.net> wrote:
>> Because 1.3 docs are straight-up HTML and are not transformed?
>
> Given that:
>
> * 1.3 is obsolete and won't need any new docs
> * Its docs are straight-up html
> * It would be desirable to avoid a server-side redirect (for  
> mirroring)
>
> .. would it then make sense to write a script to add the html link on
> a one-off basis to each page?
>
> Given a mapping table it would be fairly trivial to do this in ruby
> using e.g. Nokogiri.

Yeah, I suppose static is preferable to dynamic. Very good points.

Step 1: Assume that every /foo.html in the 1.3 docs has a  
corresponding /foo.html in the 2.2 docs (ie, what I've already done)
Step 2: Correct that assumption on a case-by-case basis. This also  
lets us do things like "mod_proxy has been replaced by a suite of  
modules that provide proxying for various protocols, and also provide  
load-balancing functionality." on a case-by-case basis.

--
Rich Bowen
rbowen@rcbowen.com




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


Re: javascript in docs?

Posted by Vincent Bray <no...@gmail.com>.
On 11 May 2010 01:56, Sander Temme <sa...@temme.net> wrote:
> Because 1.3 docs are straight-up HTML and are not transformed?

Given that:

* 1.3 is obsolete and won't need any new docs
* Its docs are straight-up html
* It would be desirable to avoid a server-side redirect (for mirroring)

.. would it then make sense to write a script to add the html link on
a one-off basis to each page?

Given a mapping table it would be fairly trivial to do this in ruby
using e.g. Nokogiri.

-- 
noodl

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


Re: javascript in docs?

Posted by Rich Bowen <rb...@rcbowen.com>.
Now, I just wish someone would answer my question about how to update  
the online docs ...

--
Rich Bowen
rbowen@rcbowen.com




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


Re: javascript in docs?

Posted by Tony Stevenson <to...@pc-tony.com>.
On 14/05/2010 12:30, Rich Bowen wrote:
>
> On May 14, 2010, at 7:07 AM, Vincent de Lau wrote:
>
>> In the meantime I was thinking that you don't have to include dynamic
>> content, you could also create a link to a redirector. That redirector
>> would
>> not have to be mirrored and would also not rely on other versions of the
>> docs to be available on the mirror.
>
>
> Ooh. That's a really good idea. We should pursue that. A simple
> Perl/PHP/Python script, or a RewriteMap, somewhere either on ASF
> hardware or elsewhere, would be awesome. I think that linking to an
> offsite docs-redirector would be acceptable, don't you? Or even
> something running on people.apache.org/~username
>

Rich, Vincent,

Let me know what you come up with, and I can review it with my infra hat 
on.


--
Cheers,
Tony


--------------------------------------------
Tony Stevenson

tony@pc-tony.com - pctony@apache.org
pctony@freenode.net - tony@caret.cam.ac.uk

http://blog.pc-tony.com

1024D/51047D66
--------------------------------------------

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


Re: javascript in docs?

Posted by Rich Bowen <rb...@rcbowen.com>.
On May 14, 2010, at 7:07 AM, Vincent de Lau wrote:

> In the meantime I was thinking that you don't have to include dynamic
> content, you could also create a link to a redirector. That  
> redirector would
> not have to be mirrored and would also not rely on other versions of  
> the
> docs to be available on the mirror.


Ooh. That's a really good idea. We should pursue that. A simple Perl/ 
PHP/Python script, or a RewriteMap, somewhere either on ASF hardware  
or elsewhere, would be awesome. I think that linking to an offsite  
docs-redirector would be acceptable, don't you? Or even something  
running on people.apache.org/~username

--
Rich Bowen
rbowen@rcbowen.com




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


RE: javascript in docs?

Posted by Vincent de Lau <vi...@delau.nl>.
> -----Original Message-----
> From: Rich Bowen [mailto:rbowen@rcbowen.com]
> Sent: Friday, May 14, 2010 1:00 PM

> There has long been a requirement that we do something that is easily
> mirror-able. I don't know if that's still a requirement. There's also
> the desire that the docs work "out of the box" on install, but I
> suppose that doesn't much matter any more with the 1.3 docs, since
> nobody should be installing them. We should bring the Infra folks into
> the conversation before we implement a server-side dynamic solution.

In the meantime I was thinking that you don't have to include dynamic
content, you could also create a link to a redirector. That redirector would
not have to be mirrored and would also not rely on other versions of the
docs to be available on the mirror.
 
> Having said that, yes, I agree that this is what we need to do, and
> would be glad to help in any way I can.

When we know the requirements, I can start building a solution.

Regards,

Vincent de Lau
 vincent@delau.nl


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


Re: javascript in docs?

Posted by Rich Bowen <rb...@rcbowen.com>.
On May 14, 2010, at 6:33 AM, Vincent de Lau wrote:

>> -----Original Message-----
>> From: Rich Bowen [mailto:rbowen@rcbowen.com]
>> Sent: Wednesday, May 12, 2010 12:58 PM
>> To: docs@httpd.apache.org
>> Subject: Re: javascript in docs?
>>
>> At a certain level of complexity (there are dozens of cases where  
>> this
>> kind of thing is needed) it becomes worthwhile to just put links in
>> each individual file. But, sure, something like that is worth trying.
>
> Maybe using SSI to call a server side script might be something to  
> try. This
> would also remove the need for JavaScript and allows for indexing.
>
> <!--#include virtual="/path/to/newdocs.cgi?file=${REQUEST_URI}" -->
>
> One way or another, you would have to provide some map for files  
> that are
> not 1:1 in the new docs. I'd be happy to write a PHP script that  
> does this
> (similar to the JavaScript version), but I don't know that the server
> supports.

There has long been a requirement that we do something that is easily  
mirror-able. I don't know if that's still a requirement. There's also  
the desire that the docs work "out of the box" on install, but I  
suppose that doesn't much matter any more with the 1.3 docs, since  
nobody should be installing them. We should bring the Infra folks into  
the conversation before we implement a server-side dynamic solution.

Having said that, yes, I agree that this is what we need to do, and  
would be glad to help in any way I can.

--
Rich Bowen
rbowen@rcbowen.com




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


RE: javascript in docs?

Posted by Vincent de Lau <vi...@delau.nl>.
> -----Original Message-----
> From: Rich Bowen [mailto:rbowen@rcbowen.com]
> Sent: Wednesday, May 12, 2010 12:58 PM
> To: docs@httpd.apache.org
> Subject: Re: javascript in docs?
> 
> At a certain level of complexity (there are dozens of cases where this
> kind of thing is needed) it becomes worthwhile to just put links in
> each individual file. But, sure, something like that is worth trying.

Maybe using SSI to call a server side script might be something to try. This
would also remove the need for JavaScript and allows for indexing.

<!--#include virtual="/path/to/newdocs.cgi?file=${REQUEST_URI}" -->  

One way or another, you would have to provide some map for files that are
not 1:1 in the new docs. I'd be happy to write a PHP script that does this
(similar to the JavaScript version), but I don't know that the server
supports.

Vincent de Lau
 vincent@delau.nl



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


Re: javascript in docs?

Posted by Rich Bowen <rb...@rcbowen.com>.
At a certain level of complexity (there are dozens of cases where this  
kind of thing is needed) it becomes worthwhile to just put links in  
each individual file. But, sure, something like that is worth trying.

On May 11, 2010, at 8:29 PM, Vincent de Lau wrote:

>> -----Original Message-----
>> From: Eric Covener [mailto:covener@gmail.com]
>> Sent: Tuesday, May 11, 2010 11:27 PM
>> To: docs@httpd.apache.org
>> Subject: Re: javascript in docs?
>>
>> On Tue, May 11, 2010 at 1:51 PM, Rich Bowen <rb...@rcbowen.com>  
>> wrote:
>>>
>>> I'd like to put a little javascript in the 1.3 docs that takes the
>> requested
>>> URI and suggests an equivalent one in the 2.2 docs. Is there any
>> strong
>>> objection to doing this?
>>>
>>> I've done this. However, in some places,
>>> like http://httpd.apache.org/docs/1.3/mod/mod_auth.html for example,
>> the
>>> generated link isn't useful. I suppose it would be possible to be
>> smarter
>>> than this, but it's a good first step.
>>
>> Looks good here!
>
> The links to the new docs will give you a 404 in this instance.
>
> Maybe something like this could solve the problem. (Code is not  
> tested!)
>
> <script language='Javascript' type='text/javascript'>
>    var oldversion = "1.3";
>    var newversion = "2.2";
>    var redirect = {
>        'mod/mod_auth': 'howto/auth'
>    };
>    var path = location.pathname;
>    // strip the path before the version to get the doc base path
>    var base = path.slice(path.indexOf(oldversion));
>    // strip the path after the version to get the filename (+ 2  
> slashes)
>    var file = path.slice(path.indexOf(oldversion) + 2 +  
> oldversion.length);
>    // strip of all extentions (.en.html)
>    var ext = file.slice(file.indexOf('.'));
>    file = file.slice(0, file.indexOf('.'));
>
>    // lookup file and redirect or just replace the version number
>    if(redirect[file]) {
>        //FIXME: is the extention still valid?
>        path = base + newversion + '/' + redirect[file] + ext;
>    } else {
>        path = base + newversion + '/' + file + ext;
>    }
>    document.getElementById("docLink").href=(path);
> </script>
>
> The redirect object/hash stores overrides for files in the old docs  
> to the
> new docs. As the FIXME denotes, I'm not sure if it is safe to reuse  
> the
> extention from the old docs for the new docs. If it ain't, it is  
> possible to
> remove this code and provide more specific filename including  
> extention.
>
> Vincent de Lau
> vincent@delau.nl
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: docs-unsubscribe@httpd.apache.org
> For additional commands, e-mail: docs-help@httpd.apache.org
>

--
Rich Bowen
rbowen@rcbowen.com




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


RE: javascript in docs?

Posted by Vincent de Lau <vi...@delau.nl>.
> -----Original Message-----
> From: Eric Covener [mailto:covener@gmail.com]
> Sent: Tuesday, May 11, 2010 11:27 PM
> To: docs@httpd.apache.org
> Subject: Re: javascript in docs?
> 
> On Tue, May 11, 2010 at 1:51 PM, Rich Bowen <rb...@rcbowen.com> wrote:
> >
> > I'd like to put a little javascript in the 1.3 docs that takes the
> requested
> > URI and suggests an equivalent one in the 2.2 docs. Is there any
> strong
> > objection to doing this?
> >
> > I've done this. However, in some places,
> > like http://httpd.apache.org/docs/1.3/mod/mod_auth.html for example,
> the
> > generated link isn't useful. I suppose it would be possible to be
> smarter
> > than this, but it's a good first step.
> 
> Looks good here!

The links to the new docs will give you a 404 in this instance.

Maybe something like this could solve the problem. (Code is not tested!)

<script language='Javascript' type='text/javascript'>
    var oldversion = "1.3";
    var newversion = "2.2";
    var redirect = {
        'mod/mod_auth': 'howto/auth'
    }; 
    var path = location.pathname;
    // strip the path before the version to get the doc base path
    var base = path.slice(path.indexOf(oldversion));
    // strip the path after the version to get the filename (+ 2 slashes)
    var file = path.slice(path.indexOf(oldversion) + 2 + oldversion.length);
    // strip of all extentions (.en.html)
    var ext = file.slice(file.indexOf('.'));
    file = file.slice(0, file.indexOf('.'));
    
    // lookup file and redirect or just replace the version number
    if(redirect[file]) {
        //FIXME: is the extention still valid?
        path = base + newversion + '/' + redirect[file] + ext;
    } else {
        path = base + newversion + '/' + file + ext;
    }
    document.getElementById("docLink").href=(path);
</script>

The redirect object/hash stores overrides for files in the old docs to the
new docs. As the FIXME denotes, I'm not sure if it is safe to reuse the
extention from the old docs for the new docs. If it ain't, it is possible to
remove this code and provide more specific filename including extention.

Vincent de Lau
 vincent@delau.nl


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


Re: javascript in docs?

Posted by Eric Covener <co...@gmail.com>.
On Tue, May 11, 2010 at 1:51 PM, Rich Bowen <rb...@rcbowen.com> wrote:
>
> I'd like to put a little javascript in the 1.3 docs that takes the requested
> URI and suggests an equivalent one in the 2.2 docs. Is there any strong
> objection to doing this?
>
> I've done this. However, in some places,
> like http://httpd.apache.org/docs/1.3/mod/mod_auth.html for example, the
> generated link isn't useful. I suppose it would be possible to be smarter
> than this, but it's a good first step.

Looks good here!

-- 
Eric Covener
covener@gmail.com

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


Re: javascript in docs?

Posted by Rich Bowen <rb...@rcbowen.com>.
>>
>>> I'd like to put a little javascript in the 1.3 docs that takes the  
>>> requested URI and suggests an equivalent one in the 2.2 docs. Is  
>>> there any strong objection to doing this?


I've done this. However, in some places, like http://httpd.apache.org/docs/1.3/mod/mod_auth.html 
  for example, the generated link isn't useful. I suppose it would be  
possible to be smarter than this, but it's a good first step.

--
Rich Bowen
rbowen@rcbowen.com




Re: javascript in docs?

Posted by Sander Temme <sa...@temme.net>.
On May 10, 2010, at 4:12 PM, Nick Kew wrote:

> 
> On 10 May 2010, at 23:39, Rich Bowen wrote:
> 
>> I'd like to put a little javascript in the 1.3 docs that takes the requested URI and suggests an equivalent one in the 2.2 docs. Is there any strong objection to doing this?
> 
> Does that need to be javascript?  Why not insert it as a simple link
> generated from the XSLT?  Or at worst, serverside using SSI + xbithack?

Because 1.3 docs are straight-up HTML and are not transformed? 

S.

-- 
sander@temme.net              http://www.temme.net/sander/
PGP FP: 51B4 8727 466A 0BC3 69F4  B7B8 B2BE BC40 1529 24AF


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


Re: javascript in docs?

Posted by Nick Kew <ni...@webthing.com>.
On 10 May 2010, at 23:39, Rich Bowen wrote:

> I'd like to put a little javascript in the 1.3 docs that takes the requested URI and suggests an equivalent one in the 2.2 docs. Is there any strong objection to doing this?

Does that need to be javascript?  Why not insert it as a simple link
generated from the XSLT?  Or at worst, serverside using SSI + xbithack?

-- 
Nick Kew


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


Re: javascript in docs?

Posted by Sander Temme <sa...@temme.net>.
On May 10, 2010, at 3:39 PM, Rich Bowen wrote:

> I'd like to put a little javascript in the 1.3 docs that takes the requested URI and suggests an equivalent one in the 2.2 docs. Is there any strong objection to doing this?

Good idea, go ahead.

S. 

-- 
sander@temme.net              http://www.temme.net/sander/
PGP FP: 51B4 8727 466A 0BC3 69F4  B7B8 B2BE BC40 1529 24AF


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