Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG][Doc] Many broken links in js_of_ocaml documentation #961

Closed
balat opened this issue Feb 4, 2020 · 8 comments
Closed

[BUG][Doc] Many broken links in js_of_ocaml documentation #961

balat opened this issue Feb 4, 2020 · 8 comments
Assignees

Comments

@hhugo
Copy link
Member

hhugo commented Jan 7, 2022

path generated by odoc are different in the following way:

  • anchors are different (e.g. #val-string vs #VALstring)
  • paths are prefixed by the name of the opam package (e.g. api/js_of_ocaml-lwt vs api/optional-sub-project)
  • hierarchical structure (Js_of_ocaml/Dom_html/class-type-element/index.html vs Dom_html.element-c.html)

We should be able to fix html_of_wiki to support odoc.
The main change will be in api.ml to accommodate the change in anchors and paths.

We need a way a decide what api structure to use (odoc vs ocamldoc). Should we introduce a new extentions or just allow new parameters in the a_api one ?

Other than that, subproject will be mandatory for js_of_ocaml references with an explicit project=js_of_ocaml.

Here is an example of what we could get

<a_odoc_api project=js_of_ocaml package=js_of_ocaml-lwt| Js_of_ocaml_lwt/Lwt_js_events.click >>
<a_odoc_api package=js_of_ocaml-lwt| Js_of_ocaml_lwt/Lwt_js_events.click >>

@balat, what do you think ?

@hhugo hhugo self-assigned this Jan 7, 2022
@jonludlam
Copy link
Contributor

We're planning on adding a CLI util to odoc to map from a reference (ie., what you'd find in a doc comment, like (** {!Foo.Bar.baz} *)) to a URL. Would this be useful? The tool will require the relevant odoc files to have been built and their paths supplied as include arguments - there are some details on the issue

@hhugo
Copy link
Member

hhugo commented Jan 7, 2022

@jonludlam, I think this will be useful long term

@hhugo
Copy link
Member

hhugo commented Jan 7, 2022

@balat, I've started some experiment in https://github.com/ocsigen/html_of_wiki/tree/hhugo-odoc-support

@balat
Copy link
Member Author

balat commented Jan 10, 2022

@balat, what do you think ?

Great news! Thank you for experimenting that!

I don't really have a preference.

I suppose that one day we will switch completely to odoc, as supporting the two backends will complicate things.
This may influence the choice.

I'd be happy to switch the whole website to odoc, even if it makes all URLs change ...
Do you think we can have something well integrated to the current web site and keep all html_of_wiki's features?

@hhugo
Copy link
Member

hhugo commented Jan 13, 2022

I currently don't know how to well integrate the odoc api with the current website, see #855 for a possible solution.

Regarding feature parity, I don't have a good grasp on what they are.
Cross project links that include versioning is most likely not supported by default.

@hhugo
Copy link
Member

hhugo commented Jan 13, 2022

I've fixed links in js_of_ocaml, eliom, tyxml, tuto

@hhugo hhugo closed this as completed Jan 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants