One trick I've used in the past is to generate "relative" URIs with
scripts. I think it'd work with gitweb URIs.

If a document knows that it's called "docs/index.html" (it's important
that it know how it's called) and wants to refer to "style.css", I did
it in 3 simple steps:

-URI-resolve "style.css" against "docs/index.html" (resulting in
"docs/style.css").
-Starting with the page's current URI, replace every instance of
"docs/index.html" by "docs/style.css".
-If there was any match, use the result as the "relative" URI.
Otherwise, the URI got mangled somehow.

Another approach might be that it doesn't know how it's called but
knows how to recognize certain URIs and extract its own name our of
it, e.g. on it could look for a query parameter "a=blob_plain" and
know that its own name is in the f parameter.

The painful part is really to re-write the HTML such that every
relevant <a>, <img>, <link> and <script> get generated appropriately.

JBQ

On Fri, Apr 24, 2009 at 1:28 PM, Dan Bornstein <[email protected]> wrote:
>
> On Apr 24, 11:27 am, Jean-Baptiste Queru <[email protected]> wrote:
>> There's no standard yet that I know of. I put my doc in the source
>> tree because I feel that's the most natural place for it, and because
>> I wanted it to be visible outside of Google (even though it's
>> incomplete and outdated). From that point, docs/index.html felt like
>> the most natural filename. It'd be good for someone to build a list of
>> all such documentation in the source tree, establish a pattern, and
>> make things fit into that pattern. Putting stubs for the projects that
>> don't have any documentation wouldn't hurt either.
>>
>> Ideally, such a list of links would be stored in the source tree
>> itself, to keep the source tree somewhat self-contained. Bonus points
>> for making it work both when browsed through gitweb and when stored
>> locally in a checked-out tree (make sure that the file is at the root
>> of the source tree).
>
> The Dalvik docs — perhaps unsurprisingly, at <dalvik/docs> in the
> source tree — suffer in gitweb from the fact that many of the html
> files have associated css files, and gitweb doesn't provide the css
> files at sufficiently mangle-free URLs. If there is a reasonable
> solution beyond viewing them from your local checkout directory, I
> would love to know about it.
>
> -dan
>
> >
>



-- 
Jean-Baptiste M. "JBQ" Queru
Android Engineer, Google.

Questions sent directly to me that have no reason for being private
will likely get ignored or forwarded to a public forum with no further
warning.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Android Discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/android-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to