Skip to content

Commit 5cb96e8

Browse files
committed
docs: Fix broken links and add CI for link checking
- Ran linkcheck on the built docs and fixed broken links - Added exceptions for private, anchors, and server errors that may come up when we run the linkcheck in CI. - Also ignore self-referential GitHub links with commit hashes - Fixed links on the insights page - Converted some links to use the anchored format - Fixes #1319
1 parent f3724fe commit 5cb96e8

6 files changed

+61
-19
lines changed

.gitlab-ci.yml

+1
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,7 @@ build_docs:
608608
- cd docs
609609
- pip install -r requirements.txt
610610
- build-docs -t esp32 esp32s3 esp32c2 esp32c3 esp32c6 esp32h2 esp32p4 -l en
611+
- build-docs -t esp32 -l en linkcheck
611612

612613
.deploy_docs_template:
613614
stage: docs

docs/conf_common.py

+34
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from esp_docs.conf_docs import * # noqa: F403,F401
2+
import subprocess
23

34
languages = ['en']
45
idf_targets = ['esp32', 'esp32s3', 'esp32c2', 'esp32c3', 'esp32c6', 'esp32h2', 'esp32p4']
@@ -12,6 +13,39 @@
1213
# link roles config
1314
github_repo = 'espressif/esp-matter'
1415

16+
# Get current commit hash
17+
try:
18+
current_commit = subprocess.check_output(['git', 'rev-parse', '--short','HEAD']).decode('utf-8').strip()
19+
except:
20+
current_commit = 'main' # Fallback if git command fails
21+
22+
# do not check for anchors
23+
linkcheck_anchors = False
24+
# Add linkcheck configurations
25+
linkcheck_ignore = [
26+
# Private repositories
27+
'https://github.com/CHIP-Specifications/.*',
28+
29+
# Internal documentation links
30+
'./developing.html#.*',
31+
'./production.html#.*',
32+
33+
# Ignore self-referential GitHub links with commit hashes
34+
f'https://github.com/{github_repo}/blob/{current_commit}/.*', # Current commit
35+
]
36+
37+
# Add timeout and HTTP status codes to ignore
38+
linkcheck_timeout = 30
39+
linkcheck_retries = 3
40+
linkcheck_ignore_codes = [
41+
403, # Forbidden
42+
429, # Too many requests
43+
500, # Server errors
44+
502, # Bad Gateway
45+
503, # Service unavailable
46+
504, # Gateway timeout
47+
]
48+
1549
# context used by sphinx_idf_theme
1650
html_context['github_user'] = 'espressif'
1751
html_context['github_repo'] = 'esp-matter'

docs/en/app_guide.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ ModeWaterHeater, ModeRefrigerator, ModeLaundryWasher and ModeMicrowaveOven.
262262
.. _`Energy Evse Mode`: https://github.com/espressif/connectedhomeip/blob/ea679d2dc674f576f4d391d1d71af1489010e580/examples/energy-management-app/energy-management-common/energy-evse/include/energy-evse-modes.h
263263
.. _`Microwave Oven Mode`: https://github.com/espressif/connectedhomeip/blob/ea679d2dc674f576f4d391d1d71af1489010e580/examples/all-clusters-app/all-clusters-common/include/microwave-oven-mode.h
264264
.. _`Device Energy Management Mode`: https://github.com/espressif/connectedhomeip/blob/ea679d2dc674f576f4d391d1d71af1489010e580/examples/energy-management-app/energy-management-common/device-energy-management/include/device-energy-management-modes.h
265-
.. _`Water Heater Mode`: https://github.com/espressif/connectedhomeip/blob/ea679d2dc674f576f4d391d1d71af1489010e580/examples/energy-management-app/energy-management-common/water-heater/include/water-heater-mode.h
265+
.. _`Water Heater Mode`: https://github.com/espressif/connectedhomeip/blob/ea679d2dc674f576f4d391d1d71af1489010e580/examples/all-clusters-app/all-clusters-common/include/water-heater-mode.h
266266
.. _`Energy Evse`: https://github.com/espressif/connectedhomeip/blob/ea679d2dc674f576f4d391d1d71af1489010e580/src/app/clusters/energy-evse-server/energy-evse-server.h
267267
.. _`Energy Evse Delegate`: https://github.com/espressif/connectedhomeip/blob/ea679d2dc674f576f4d391d1d71af1489010e580/examples/energy-management-app/energy-management-common/energy-evse/include/EnergyEvseDelegateImpl.h
268268
.. _`Operational State`: https://github.com/espressif/connectedhomeip/blob/ea679d2dc674f576f4d391d1d71af1489010e580/src/app/clusters/operational-state-server/operational-state-server.h
@@ -299,7 +299,7 @@ ModeWaterHeater, ModeRefrigerator, ModeLaundryWasher and ModeMicrowaveOven.
299299
.. _`Mode Select`: https://github.com/espressif/connectedhomeip/blob/ea679d2dc674f576f4d391d1d71af1489010e580/src/app/clusters/mode-select-server/supported-modes-manager.h
300300
.. _`Mode Select Delegate`: https://github.com/espressif/connectedhomeip/blob/ea679d2dc674f576f4d391d1d71af1489010e580/examples/all-clusters-app/all-clusters-common/include/static-supported-modes-manager.h
301301
.. _`Water Heater Management`: https://github.com/espressif/connectedhomeip/blob/ea679d2dc674f576f4d391d1d71af1489010e580/src/app/clusters/water-heater-management-server/water-heater-management-server.h
302-
.. _`Water Heater Management Delegate`: https://github.com/espressif/connectedhomeip/blob/ea679d2dc674f576f4d391d1d71af1489010e580/examples/energy-management-app/energy-management-common/water-heater/include/WhmDelegate.h
302+
.. _`Water Heater Management Delegate`: https://github.com/espressif/connectedhomeip/blob/ea679d2dc674f576f4d391d1d71af1489010e580/examples/all-clusters-app/all-clusters-common/include/WhmDelegate.h
303303
.. _`Energy Preference`: https://github.com/espressif/connectedhomeip/blob/ea679d2dc674f576f4d391d1d71af1489010e580/src/app/clusters/energy-preference-server/energy-preference-server.h
304304
.. _`Energy Preference Delegate`: https://github.com/espressif/connectedhomeip/blob/ea679d2dc674f576f4d391d1d71af1489010e580/examples/all-clusters-app/all-clusters-common/src/energy-preference-delegate.cpp
305305
.. _`Commissioner Control`: https://github.com/espressif/connectedhomeip/blob/ea679d2dc674f576f4d391d1d71af1489010e580/src/app/clusters/commissioner-control-server/commissioner-control-server.h

docs/en/developing.rst

+16-9
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ Development on Windows is supported using Windows Subsystem for Linux (WSL). Ple
3030
- Install Ubuntu 20.04 or 22.04 from the `Windows App Store <https://apps.microsoft.com/store/search/Ubuntu>`__.
3131
- Start Ubuntu (search into start menu) and run command ``uname -a``, it should report a kernel version of ``5.10.60.1`` or later.
3232
If not please upgrade the WSL2. To upgrade the kernel, run ``wsl --upgrade`` from Windows Power Shell.
33-
- Windows does not support exposing COM ports to WSL distros. Install usbipd-win on `Windows <https://github.com/dorssel/usbipd-win>`__
34-
and `WSL <https://github.com/espressif/vscode-esp-idf-extension/blob/master/docs/WSL.md#usbipd>`__ (usbipd-win `WSL Support <https://github.com/dorssel/usbipd-win/wiki/WSL-support>`__).
33+
- Windows does not support exposing COM ports to WSL distros. Install `usbipd-win`_
34+
and `WSL`_ (`usbipd-win WSL Support`_).
3535
- Here onwards process for setting esp-matter and building examples is same as other hosts.
3636
- Please clone the repositories from inside the WSL environment and not inside a mounted directory.
3737

@@ -496,7 +496,7 @@ Use the cluster commands to control the attributes.
496496

497497
chip-tool when used in interactive mode uses CASE resumption as against establishing CASE for cluster control commands. This results into shorter execution times, thereby improving the overall experience.
498498

499-
For more details on chip-tool usage, check https://github.com/espressif/connectedhomeip/tree/v1.0.0.2/examples/chip-tool
499+
For more details about the commands, please check `chip-tool usage guide`_
500500

501501
2.4 Device console
502502
------------------
@@ -1097,7 +1097,7 @@ We need to generate the new CD because it SHALL match the VID, PID in DAC and th
10971097
ninja -C build
10981098

10991099
Generate the Test CD, please make sure to change the ``-V`` (vendor_id) and ``-p`` (product-id) options based on the ones that are being used.
1100-
For more info about the arguments, please check `here <https://github.com/espressif/connectedhomeip/tree/v1.0.0.2/src/tools/chip-cert#gen-cd>`__.
1100+
For more info about the arguments, please check `chip-cert's gen-cd command`_ in the connectedhomeip repository.
11011101

11021102
::
11031103

@@ -1199,7 +1199,7 @@ Run the following command from host to commission the device.
11991199

12001200
- Enable the ``CONFIG_ENABLE_OTA_REQUESTOR`` option to enable Matter OTA Requestor functionality.
12011201

1202-
Please follow the `guide <https://github.com/project-chip/connectedhomeip/blob/master/docs/guides/esp32/ota.md>`__
1202+
Please follow the `OTA guide`_
12031203
in the connectedhomeip repository for generating a Matter OTA image and performing OTA.
12041204

12051205
2.8.1 Encrypted Matter OTA
@@ -1224,7 +1224,7 @@ Please follow the steps below to enable and use encrypted application images for
12241224
}
12251225

12261226

1227-
- Please refer to the `guide <https://github.com/project-chip/connectedhomeip/blob/master/docs/guides/esp32/ota.md#encrypted-ota>`__
1227+
- Please refer to the `encrypted OTA guide`_
12281228
in the connectedhomeip repository for instructions on how to generate a private key, encrypted OTA image, and Matter OTA image.
12291229

12301230
.. note::
@@ -1695,14 +1695,21 @@ To enable these functions, the cluster should be added to the appropriate entry
16951695
If the example uses ESP-Matter APIs to define its data model, the custom data model should be created and added to the data model using the esp-matter APIs, following the instructions in `Adding custom data model fields <./developing.html#adding-custom-data-model-fields>`__
16961696

16971697
.. _`step by step installation guide`: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/linux-macos-setup.html
1698-
.. _`Prerequisites for ESP-IDF`: https://docs.espressif.com/projects/esp-idf/en/v5.0.1/esp32/get-started/index.html#step-1-install-prerequisites
1699-
.. _`Prerequisites for Matter`: https://github.com/espressif/connectedhomeip/blob/v1.1-branch/docs/guides/BUILDING.md#prerequisites
1698+
.. _`Prerequisites for ESP-IDF`: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/index.html#installation
1699+
.. _`Prerequisites for Matter`: https://github.com/project-chip/connectedhomeip/tree/master/docs/guides/BUILDING.md#prerequisites
17001700
.. _`esp-matter-mfg-tool`: https://github.com/espressif/esp-matter-tools/tree/main/mfg_tool
17011701
.. _`zcl configuration file`: https://github.com/project-chip/connectedhomeip/blob/master/src/app/zap-templates/zcl/zcl.json
17021702
.. _`zcl test configuration file`: https://github.com/project-chip/connectedhomeip/blob/master/src/app/zap-templates/zcl/zcl-with-test-extensions.json
1703-
.. _`zap configuration data`: <https://github.com/project-chip/connectedhomeip/blob/master/src/app/common/templates/config-data.yaml>
1703+
.. _`zap configuration data`: https://github.com/project-chip/connectedhomeip/blob/master/src/app/common/templates/config-data.yaml
17041704
.. _`ESP-Rainmaker iOS App`: https://apps.apple.com/app/esp-rainmaker/id1497491540
17051705
.. _`ESP-Rainmaker Android App`: https://play.google.com/store/apps/details?id=com.espressif.rainmaker
17061706
.. _`connectedhomeip`: https://github.com/project-chip/connectedhomeip
17071707
.. _`CHIP Tool User Guide`: https://github.com/project-chip/connectedhomeip/blob/master/docs/development_controllers/chip-tool/chip_tool_guide.md
17081708
.. _`profile installation instructions`: https://github.com/project-chip/connectedhomeip/blob/master/docs/guides/darwin.md#profile-installation
1709+
.. _`OTA guide`: https://github.com/project-chip/connectedhomeip/blob/master/docs/platforms/esp32/ota.md
1710+
.. _`encrypted OTA guide`: https://github.com/project-chip/connectedhomeip/blob/master/docs/platforms/esp32/ota.md#encrypted-ota
1711+
.. _`chip-cert's gen-cd command`: https://github.com/espressif/connectedhomeip/tree/v1.0.0.2/src/tools/chip-cert#gen-cd
1712+
.. _usbipd-win: https://github.com/dorssel/usbipd-win
1713+
.. _WSL: https://docs.espressif.com/projects/vscode-esp-idf-extension/en/latest/additionalfeatures/wsl.html#usbipd-win-in-wsl
1714+
.. _`usbipd-win WSL Support`: https://github.com/dorssel/usbipd-win/wiki/WSL-support
1715+
.. _`chip-tool usage guide`: https://github.com/project-chip/connectedhomeip/blob/master/docs/development_controllers/chip-tool/chip_tool_guide.md

docs/en/faq.rst

+3-4
Original file line numberDiff line numberDiff line change
@@ -414,12 +414,11 @@ Please check `#1123`_ for relevant discussion on Github issue.
414414
.. _light_wifi_prov: https://github.com/espressif/esp-matter/tree/main/examples/light_wifi_prov#4-external-platform
415415
.. _getting the repository: https://docs.espressif.com/projects/esp-matter/en/latest/esp32/developing.html#getting-the-repository
416416
.. _requirements.txt: https://github.com/espressif/esp-matter/blob/main/requirements.txt
417-
.. _implementation which frees the BLE memory: https://github.com/espressif/esp-matter/blob/c52fa686d1a3be275b0a5c872ee5f1a3c8f2420d/components/esp_matter/esp_matter_core.cpp#L859-L891
418417
.. _generate_setup_payload.py: https://github.com/project-chip/connectedhomeip/tree/master/src/setup_payload/python
419418
.. _CHIP QR Code: https://project-chip.github.io/connectedhomeip/qrcode.html
420-
.. _CONFIG_APP_PROJECT_VER_FROM_CONFIG: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/kconfig.html#config-app-project-ver-from-config
421-
.. _UART console baud rate: https://docs.espressif.com/projects/esp-idf/en/latest/esp32c2/api-reference/kconfig.html#config-esp-console-uart-baudrate
422-
.. _Main XTAL frequency: https://docs.espressif.com/projects/esp-idf/en/latest/esp32c2/api-reference/kconfig.html#main-xtal-config
419+
.. _CONFIG_APP_PROJECT_VER_FROM_CONFIG: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/kconfig-reference.html#config-app-project-ver-from-config
420+
.. _UART console baud rate: https://docs.espressif.com/projects/esp-idf/en/latest/esp32c2/api-reference/kconfig-reference.html#config-esp-console-uart-baudrate
421+
.. _Main XTAL frequency: https://docs.espressif.com/projects/esp-idf/en/latest/esp32c2/api-reference/kconfig-reference.html#main-xtal-config
423422

424423
.. _Github issue: https://github.com/espressif/esp-matter/issues/new?template=issue-template.md
425424
.. _`#1123`: https://github.com/espressif/esp-matter/issues/1123

docs/en/insights.rst

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
Enabling ESP-Insights in ESP-Matter
22
===================================
33

4-
- To learn more about esp-insights and get started, please refer [project README.md] (https://github.com/espressif/esp-insights/blob/main/README.md).
4+
- To learn more about esp-insights and get started, please refer `project README.md`_.
55
- Before building the app, enable the option `ESP_INSIGHTS_ENABLED` through menuconfig.
6-
- Follow the steps present [here](https://github.com/espressif/esp-insights/blob/main/examples/README.md#set-up-esp-insights-account) to set up an `insights_account`, and create an auth key.
6+
- Follow the steps present `set up esp-insights account`_ , and create an auth key.
77
- Create a file named `insights_auth_key.txt` in the project directory of the example.
88
- Download the auth key and copy Auth Key to the example.
99

1010
::
1111

1212
cp /path/to/auth/key.txt path/to/esp-matter/examples/generic_switch/insights_auth_key.txt
1313

14-
- Refer the esp-matter [generic switch example](https://github.com/espressif/esp-matter/blob/main/examples/generic_switch/main/app_main.cpp) to enable the traces and metrics reported by the esp32 tracing backend in the chip SDK on the insights dashboard and about how to use the auth key for enabling insights.
14+
- Refer the esp-matter :project_file:`Generic Switch example <examples/generic_switch/main/app_main.cpp>` to enable the traces and metrics reported by the esp32 tracing backend in the chip SDK on the insights dashboard and about how to use the auth key for enabling insights.
1515
- Enable the option `ENABLE_ESP_INSIGHTS_SYSTEM_STATS` to get a report of the system metrics in the chip SDK on the insights dashboard.
1616

17-
17+
.. _project README.md: https://github.com/espressif/esp-insights/blob/main/README.md
18+
.. _set up esp-insights account: https://github.com/espressif/esp-insights/blob/main/examples/README.md#set-up-esp-insights-account

0 commit comments

Comments
 (0)