conf_common.py 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. # -*- coding: utf-8 -*-
  2. #
  3. # Common (non-language-specific) configuration for Sphinx
  4. #
  5. # This file is imported from a language-specific conf.py (ie en/conf.py or
  6. # zh_CN/conf.py)
  7. # type: ignore
  8. # pylint: disable=wildcard-import
  9. # pylint: disable=undefined-variable
  10. from __future__ import print_function, unicode_literals
  11. import os.path
  12. from esp_docs.conf_docs import * # noqa: F403,F401
  13. if os.environ.get('IDF_PATH') is None:
  14. raise RuntimeError('IDF_PATH should be set, run export.sh before building docs')
  15. BT_DOCS = ['api-guides/blufi.rst',
  16. 'api-guides/esp-ble-mesh/**',
  17. 'api-reference/bluetooth/**']
  18. SDMMC_DOCS = ['api-reference/peripherals/sdmmc_host.rst',
  19. 'api-reference/peripherals/sd_pullup_requirements.rst']
  20. SDIO_SLAVE_DOCS = ['api-reference/peripherals/sdio_slave.rst',
  21. 'api-reference/protocols/esp_sdio_slave_protocol.rst']
  22. MCPWM_DOCS = ['api-reference/peripherals/mcpwm.rst']
  23. DEDIC_GPIO_DOCS = ['api-reference/peripherals/dedic_gpio.rst']
  24. PCNT_DOCS = ['api-reference/peripherals/pcnt.rst']
  25. DAC_DOCS = ['api-reference/peripherals/dac.rst']
  26. TEMP_SENSOR_DOCS = ['api-reference/peripherals/temp_sensor.rst']
  27. TOUCH_SENSOR_DOCS = ['api-reference/peripherals/touch_pad.rst']
  28. SPIRAM_DOCS = ['api-guides/external-ram.rst']
  29. LEGACY_DOCS = ['api-guides/build-system-legacy.rst',
  30. 'gnu-make-legacy.rst',
  31. 'api-guides/ulp-legacy.rst',
  32. 'api-guides/unit-tests-legacy.rst',
  33. 'get-started-legacy/**']
  34. USB_DOCS = ['api-reference/peripherals/usb_device.rst',
  35. 'api-reference/peripherals/usb_host.rst',
  36. 'api-guides/usb-otg-console.rst',
  37. 'api-guides/dfu.rst']
  38. FTDI_JTAG_DOCS = ['api-guides/jtag-debugging/configure-ft2232h-jtag.rst']
  39. USB_SERIAL_JTAG_DOCS = ['api-guides/jtag-debugging/configure-builtin-jtag.rst',
  40. 'api-guides/usb-serial-jtag-console.rst']
  41. ULP_DOCS = ['api-guides/ulp.rst', 'api-guides/ulp_macros.rst']
  42. RISCV_COPROC_DOCS = ['api-guides/ulp-risc-v.rst',]
  43. XTENSA_DOCS = ['api-guides/hlinterrupts.rst',
  44. 'api-reference/system/perfmon.rst']
  45. RISCV_DOCS = [] # type: list[str]
  46. ESP32_DOCS = ['api-guides/ulp_instruction_set.rst',
  47. 'api-reference/system/himem.rst',
  48. 'api-guides/romconsole.rst',
  49. 'api-reference/system/ipc.rst',
  50. 'security/secure-boot-v1.rst',
  51. 'api-reference/peripherals/secure_element.rst',
  52. 'api-reference/peripherals/dac.rst',
  53. 'hw-reference/esp32/**'] + LEGACY_DOCS + FTDI_JTAG_DOCS
  54. ESP32S2_DOCS = ['hw-reference/esp32s2/**',
  55. 'api-guides/ulps2_instruction_set.rst',
  56. 'api-guides/usb-console.rst',
  57. 'api-reference/peripherals/ds.rst',
  58. 'api-reference/peripherals/spi_slave_hd.rst',
  59. 'api-reference/peripherals/temp_sensor.rst',
  60. 'api-reference/system/async_memcpy.rst',
  61. 'api-reference/peripherals/touch_element.rst'] + FTDI_JTAG_DOCS
  62. ESP32S3_DOCS = ['hw-reference/esp32s3/**',
  63. 'api-reference/system/ipc.rst']
  64. # No JTAG docs for this one as it gets gated on SOC_USB_SERIAL_JTAG_SUPPORTED down below.
  65. ESP32C3_DOCS = ['hw-reference/esp32c3/**']
  66. # format: {tag needed to include: documents to included}, tags are parsed from sdkconfig and peripheral_caps.h headers
  67. conditional_include_dict = {'SOC_BT_SUPPORTED':BT_DOCS,
  68. 'SOC_SDMMC_HOST_SUPPORTED':SDMMC_DOCS,
  69. 'SOC_SDIO_SLAVE_SUPPORTED':SDIO_SLAVE_DOCS,
  70. 'SOC_MCPWM_SUPPORTED':MCPWM_DOCS,
  71. 'SOC_USB_OTG_SUPPORTED':USB_DOCS,
  72. 'SOC_USB_SERIAL_JTAG_SUPPORTED':USB_SERIAL_JTAG_DOCS,
  73. 'SOC_DEDICATED_GPIO_SUPPORTED':DEDIC_GPIO_DOCS,
  74. 'SOC_SPIRAM_SUPPORTED':SPIRAM_DOCS,
  75. 'SOC_PCNT_SUPPORTED':PCNT_DOCS,
  76. 'SOC_DAC_SUPPORTED':DAC_DOCS,
  77. 'SOC_TOUCH_SENSOR_NUM':TOUCH_SENSOR_DOCS,
  78. 'SOC_ULP_SUPPORTED':ULP_DOCS,
  79. 'SOC_RISCV_COPROC_SUPPORTED':RISCV_COPROC_DOCS,
  80. 'SOC_DIG_SIGN_SUPPORTED':['api-reference/peripherals/ds.rst'],
  81. 'SOC_HMAC_SUPPORTED':['api-reference/peripherals/hmac.rst'],
  82. 'SOC_ASYNC_MEMCPY_SUPPORTED':['api-reference/system/async_memcpy.rst'],
  83. 'CONFIG_IDF_TARGET_ARCH_XTENSA':XTENSA_DOCS,
  84. 'CONFIG_IDF_TARGET_ARCH_RISCV':RISCV_DOCS,
  85. 'SOC_TEMP_SENSOR_SUPPORTED':TEMP_SENSOR_DOCS,
  86. 'esp32':ESP32_DOCS,
  87. 'esp32s2':ESP32S2_DOCS,
  88. 'esp32s3':ESP32S3_DOCS,
  89. 'esp32c3':ESP32C3_DOCS}
  90. extensions += ['sphinx_copybutton',
  91. # Note: order is important here, events must
  92. # be registered by one extension before they can be
  93. # connected to another extension
  94. 'esp_docs.idf_extensions.build_system',
  95. 'esp_docs.idf_extensions.esp_err_definitions',
  96. 'esp_docs.idf_extensions.gen_toolchain_links',
  97. 'esp_docs.idf_extensions.gen_defines',
  98. 'esp_docs.idf_extensions.gen_version_specific_includes',
  99. 'esp_docs.idf_extensions.kconfig_reference',
  100. 'esp_docs.idf_extensions.gen_idf_tools_links',
  101. 'esp_docs.esp_extensions.run_doxygen',
  102. ]
  103. # link roles config
  104. github_repo = 'espressif/esp-idf'
  105. # context used by sphinx_idf_theme
  106. html_context['github_user'] = 'espressif'
  107. html_context['github_repo'] = 'esp-idf'
  108. # Extra options required by sphinx_idf_theme
  109. project_slug = 'esp-idf'
  110. versions_url = 'https://dl.espressif.com/dl/esp-idf/idf_versions.js'
  111. idf_targets = ['esp32', 'esp32s2', 'esp32s3', 'esp32c3']
  112. languages = ['en', 'zh_CN']
  113. google_analytics_id = os.environ.get('CI_GOOGLE_ANALYTICS_ID', None)
  114. project_homepage = 'https://github.com/espressif/esp-idf'