docs(usb): Move USB docs to esp-usb and add redirects

Remove USB Host/Device content from ESP-IDF pages and keep only links to
ESP-USB documentation.

Add redirects for legacy USB pages to ESP-USB with target-aware URL
substitution in docs config.

Drop obsolete USB host notes references from docs_not_updated lists.
This commit is contained in:
igor.masar
2026-02-23 14:07:22 +01:00
parent b10fa80961
commit 7b38e47834
36 changed files with 24 additions and 3712 deletions
+16 -8
View File
@@ -157,14 +157,6 @@ SPIRAM_DOCS = ['api-guides/external-ram.rst']
USB_DOCS = [
'api-reference/peripherals/usb_device.rst',
'api-reference/peripherals/usb_host.rst',
'api-reference/peripherals/usb_host/usb_host_notes_arch.rst',
'api-reference/peripherals/usb_host/usb_host_notes_design.rst',
'api-reference/peripherals/usb_host/usb_host_notes_dwc_otg.rst',
'api-reference/peripherals/usb_host/usb_host_notes_index.rst',
'api-reference/peripherals/usb_host/usb_host_notes_usbh.rst',
'api-reference/peripherals/usb_host/usb_host_notes_enum.rst',
'api-reference/peripherals/usb_host/usb_host_notes_ext_hub.rst',
'api-reference/peripherals/usb_host/usb_host_notes_ext_port.rst',
]
I80_LCD_DOCS = ['api-reference/peripherals/lcd/i80_lcd.rst']
@@ -509,6 +501,20 @@ QEMU_TARGETS = ['esp32', 'esp32c3', 'esp32s3']
ESP_TEE_TARGETS = ['esp32c6', 'esp32h2', 'esp32c5', 'esp32c61']
def _resolve_redirect_page_macros(redirect_pages, target):
replace_map = {
'{IDF_TARGET_PATH_NAME}': target,
}
resolved_redirect_pages = []
for old_url, new_url in redirect_pages:
for macro, value in replace_map.items():
new_url = new_url.replace(macro, value)
resolved_redirect_pages.append((old_url, new_url))
return resolved_redirect_pages
# Callback function for user setup that needs be done after `config-init`-event
# config.idf_target is not available at the initial config stage
def conf_setup(app, config):
@@ -531,6 +537,8 @@ def conf_setup(app, config):
# Not for all target
pass
config.html_redirect_pages = _resolve_redirect_page_macros(config.html_redirect_pages, config.idf_target)
config.html_baseurl = f'https://docs.espressif.com/projects/esp-idf/{config.language}/stable/{config.idf_target}'