ocaml.org icon indicating copy to clipboard operation
ocaml.org copied to clipboard

404 Error on 'Doc Examples' Link in Cmarkit Section

Open labdhiongithub7 opened this issue 10 months ago • 5 comments

This issue pertains to a broken link in the cmarkit section of the application or website. When users click on the "doc examples" link, instead of navigating to the intended resource or page, it results in a 404 error. This indicates that the linked page is either missing, has been moved, or the URL is incorrect. The problem affects user experience by preventing access to the expected documentation or examples. Screenshot 2024-12-28 163821

labdhiongithub7 avatar Dec 28 '24 11:12 labdhiongithub7

CC @cuihtlauac @sabine

labdhiongithub7 avatar Jan 08 '25 05:01 labdhiongithub7

This indicates that the linked page is either missing, has been moved, or the URL is incorrect

For some reason, the Github README is not correctly parsed. The package description page in ocaml.org is just a view from the project's README. All links were working when I tried using Github directly.

It is redirecting to https://ocaml.org/p/cmarkit/test/bench.ml instead of https://github.com/dbuenzli/cmarkit/blob/main/test/bench.ml

I'll try to debug it

vitorsouzaalmeida avatar Jan 24 '25 17:01 vitorsouzaalmeida

Hello @vit0rr ! Could you please elaborate how did you accessed the links directly from Github?

labdhiongithub7 avatar Jan 25 '25 08:01 labdhiongithub7

Hello @vit0rr ! Could you please elaborate how did you accessed the links directly from Github?

You can just access the project's Github page: https://github.com/dbuenzli/cmarkit

vitorsouzaalmeida avatar Jan 26 '25 20:01 vitorsouzaalmeida

For some reason, the Github README is not correctly parsed. The package description page in ocaml.org is just a view from the project's README. All links were working when I tried using Github directly.

ocaml.org copies README from their project's home page in GitHub.

When files include relative links, they are not resolved correctly once displayed in ocaml.org. For instance, here is cmarkit's README source:

## Sample programs 

The [`cmarkit`] tool parses and renders CommonMark files in various
ways.

See also [`bench.ml`] and the [doc examples].

[`cmarkit`]: test/cmarkit_tool.ml
[`bench.ml`]: test/bench.ml
[doc examples]:  test/examples.ml

GitHub translates test.bench.ml into

https://github.com/dbuenzli/cmarkit/blob/main/test/bench.ml

To fix the broken link, we'd need to processing in ocaml.org to restore the complete link to GiutHub.

cuihtlauac avatar Jan 27 '25 06:01 cuihtlauac