project-chip / connectedhomeip

Matter (formerly Project CHIP) creates more connections between more objects, simplifying development for manufacturers and increasing compatibility for consumers, guided by the Connectivity Standards Alliance.
https://buildwithmatter.com
Apache License 2.0
7.51k stars 2.01k forks source link

[Documentation] Relative link to ../../examples doesn't work [404] #35855

Open soares-sergio opened 1 month ago

soares-sergio commented 1 month ago

Documentation issues

In https://github.com/project-chip/connectedhomeip/pull/35846#discussion_r1781552590 I attempted to fix a broken link to the examples directory.

When you access that link from https://project-chip.github.io/connectedhomeip-doc/getting_started/first_example.html#an-sdk-example it results in a 404 because the master branch is not in the URL. but when you access it from https://github.com/project-chip/connectedhomeip/blob/master/docs/getting_started/first_example.md it works just fine. So there's a discrepancy on how links are compiled on project-chip.github.io vs github.com/project-chip.

The most interesting thing is that the link to ../../examples/chip-tool works fine on both. But ../../examples/ breaks somehow.

I ended up just using the full hardcoded link to get around the issue but I'm afraid this problem may happen in other places and we might end up with other broken links throughout our documentation.

andy31415 commented 1 month ago

As far as I know, the documentation we upload gets built with sphyx and its config is at https://github.com/project-chip/connectedhomeip/blob/master/docs/conf.py#L76

We build it via make html so it uses https://github.com/project-chip/connectedhomeip/blob/master/docs/Makefile#L19

Workflow at https://github.com/project-chip/connectedhomeip/blob/master/.github/workflows/docbuild.yaml#L40

So we probably should reproduce this locally - can we see the wrong links being built after a make and once we reproduce, can we figure out what settings to fix up?