opam-doc icon indicating copy to clipboard operation
opam-doc copied to clipboard

Uris

Open samoht opened this issue 12 years ago • 12 comments
trafficstars

Why did you choose http://ocaml-redesign.github.io/docs/opam/?package=async_core&module=Async_or_error instead of http://ocaml-redesign.github.io/docs/opam/async_core/Async_or_error/ ?

samoht avatar Sep 19 '13 13:09 samoht

This is because there's a script that dynamically loads the documentation. Having static files would mean potentially generating hundreds of megabytes (or more) of documentation for (big) packages which use "include".

pw374 avatar Sep 19 '13 13:09 pw374

I'm fine having a script which expands the includes. But you can at least generate an entry page per package and per modules in that package (which seems a more natural naming convention than having to pass extra arguments to your global script).

samoht avatar Sep 19 '13 14:09 samoht

I did something like this once and used a single script/page but generated subdirectories and symlinked each resource name in the subdirectory to the main page. The main page then introspected on the URL and loaded the appropriate panorama. It is also possible to prevent a full server round trip by using the HTML5 pushState API to change the URL without re-GET-ing the symlink.

dsheets avatar Sep 19 '13 14:09 dsheets

I'm fine having a script which expands the includes. But you can at least generate an entry page per package and per modules in that package (which seems a more natural naming convention than having to pass extra arguments to your global script).

Oh, yeah, ok, I see. A quick hack for ocaml-redesign.github.io would be to generate some P/M/index.html that redirect to ../../?package=P&module=M.

pw374 avatar Sep 19 '13 14:09 pw374

Note that it is not very easy to have /package/module/submodule/... urls in the general case because a module can include a module which includes a module which adds a submodule etc.. Although we could easily add urls for all toplevel modules.

lpw25 avatar Sep 19 '13 15:09 lpw25

I don't think the "submodule/..." is very useful in practice. But having a direct links to package/ and package/module would be very useful.

samoht avatar Sep 19 '13 15:09 samoht

To be more complete on the uri scheme. It would be nice if opam-doc generates overlay on top of an existing repository (as we plan to do in opam2web). eg. doc related to a given package should go in: packages/name/name.version/

Would be trivial after that to integrate it with a local opam2web instance. @dsheets does it make sense ?

samoht avatar Sep 20 '13 14:09 samoht

An overlay is a good idea if it has a consistent structure. Right now, we have 3 package repository structures:

opam:

packages/name.version/

opam2web:

packages/name/version/

new opam (?):

packages/name/name.version/

We should decide on one and harmonize across all the tools. I think the packages/name.version/ is unacceptable due to its lack of per-project path. This leaves the (new) opam2web convention and the (new) opam convention which both seem acceptable. I do wonder, why does new opam repeat the name in the project subdirectory? Is it to reuse the existing parsing logic? What happens if the name's unsync? It's also sorta long... :-P

dsheets avatar Sep 20 '13 14:09 dsheets

Yes, the plan is to switch to packages/name/name.version/ once the final 1.1 is out. Regarding the "long" names, OPAM is looking for any files called packages/XX/YY/ZZ/name.version/opam to compute the available packages in the repository.

samoht avatar Sep 20 '13 14:09 samoht

I think that I want to switch to urls of the form:

packages/name/name.version/docs/#Module.Submodule

lpw25 avatar Nov 01 '13 15:11 lpw25

Yes, this URI format is nice.

On 1 Nov 2013, at 15:18, Leo White [email protected] wrote:

I think that I want to switch to urls of the form:

packages/name/name.version/docs/#Module.Submodule

— Reply to this email directly or view it on GitHub.

avsm avatar Nov 01 '13 15:11 avsm

I like this format.

What about "api" or "doc" instead of "docs"? I guess it depends on what else you see being hosted under the path and what siblings you foresee.

dsheets avatar Nov 01 '13 15:11 dsheets