# Copyright 2025 The Pigweed Authors # # Licensed under the Apache License, Version 2.0 (the "License"); you may not # use this file except in compliance with the License. You may obtain a copy of # the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations under # the License. load("@bazel_skylib//rules:copy_directory.bzl", "copy_directory") load("@rules_python//sphinxdocs:sphinx.bzl", "sphinx_build_binary", "sphinx_docs") load("@rules_python//sphinxdocs:sphinx_docs_library.bzl", "sphinx_docs_library") load("//pw_build:compatibility.bzl", "incompatible_with_mcu") package(default_visibility = ["//visibility:public"]) licenses(["notice"]) exports_files([ "module_metadata.json", "module_metadata_schema.json", ]) sphinx_docs_library( # TODO: https://pwbug.dev/377679855 - Rename this to "docs" after merging. name = "not_prefixed", srcs = [ "_extensions/bug.py", "_extensions/kconfig.py", "_extensions/module_metadata.py", "_extensions/modules_index.py", "_extensions/pigweed_live.py", "_extensions/seed_metadata.py", "_extensions/sitemap.py", "bazel_compatibility.rst", "build_system.rst", "changelog.rst", "index.rst", "module_metadata.json", "module_metadata_schema.json", "modules.rst", "python_build.rst", "redirects.json", # TODO: b/388905812 - Delete this file. "size_report_notice", "targets.rst", "third_party_support.rst", "toolchain.rst", ], target_compatible_with = incompatible_with_mcu(), ) # TODO: https://pwbug.dev/377679855 - Merge this into "not_prefixed" # (which will be renamed to "docs" after the merge). sphinx_docs_library( name = "prefixed", srcs = [ "_static/css/pigweed.css", "_static/js/changelog.js", "_static/js/pigweed.js", "blog/01-kudzu.rst", "blog/02-bazel-feature-flags.rst", "blog/03-pigweed-sdk.rst", "blog/04-fixed-point.rst", "blog/05-coroutines.rst", "blog/06-better-cpp-toolchains.rst", "blog/07-bazelcon-2024.rst", "blog/08-bazel-docgen.rst", "blog/index.rst", "blog/rss.xml", "code_of_conduct.rst", "code_reviews.rst", "community/index.rst", "concepts/index.rst", "contributing/build.rst", "contributing/docs/build.rst", "contributing/docs/changelog.rst", "contributing/docs/doxygen.rst", "contributing/docs/examples.rst", "contributing/docs/index.rst", "contributing/docs/modules.rst", "contributing/docs/website.rst", "contributing/index.rst", "embedded_cpp_guide.rst", "facades.rst", "faq.rst", "get_started/analysis.rst", "get_started/bazel.rst", "get_started/bazel_integration/index.rst", "get_started/bazel_integration/modules.rst", "get_started/bazel_integration/setup.rst", "get_started/first_time_setup.rst", "get_started/github_actions.rst", "get_started/index.rst", "get_started/install_bazel.rst", "get_started/zephyr.rst", "glossary.rst", "infra/bazel_lockfile.rst", "infra/ci_cq_intro.rst", "infra/glossary.rst", "infra/index.rst", "infra/rollers.rst", "layout/layout.html", "mission.rst", "module_structure.rst", "os/index.rst", "os/zephyr/index.rst", "os/zephyr/kconfig.rst", "overview.rst", "showcases/index.rst", "showcases/sense/analysis.rst", "showcases/sense/automate.rst", "showcases/sense/bazel_cloud.rst", "showcases/sense/build.rst", "showcases/sense/code_intelligence.rst", "showcases/sense/crash_handler.rst", "showcases/sense/device_tests.rst", "showcases/sense/explore.rst", "showcases/sense/factory.rst", "showcases/sense/flash.rst", "showcases/sense/host_sim.rst", "showcases/sense/host_tests.rst", "showcases/sense/index.rst", "showcases/sense/intro.rst", "showcases/sense/outro.rst", "showcases/sense/production.rst", "showcases/sense/rpc.rst", "showcases/sense/setup.rst", "showcases/sense/web.rst", "size_optimizations.rst", "style/bazel.rst", "style/cli.rst", "style/commit_message.rst", "style/cpp.rst", "style/doxygen.rst", "style/protobuf.rst", "style/python.rst", "style/rest.rst", "style/writing.rst", "style_guide.rst", ], target_compatible_with = incompatible_with_mcu(), ) copy_directory( name = "rust_files", src = "//pw_rust:docs_dir", out = "rustdoc", ) sphinx_docs_library( name = "rust", srcs = [":rust_files"], prefix = "rustdoc/", target_compatible_with = incompatible_with_mcu(), ) sphinx_build_binary( name = "sphinx_build", tags = ["manual"], target_compatible_with = incompatible_with_mcu(), deps = [ "//pw_build/py:pigweed_build", "//pw_build/py:pw_build", "//pw_build/py:pw_project_builder", "//pw_console/py:pw_console", "//pw_containers/py:inline_var_len_entry_queue", "//pw_docgen/py:pw_docgen", "//pw_emu/py:pw_emu", "//pw_env_setup/py:pw_env_setup", "//pw_env_setup/py:pw_env_setup_private", "//pw_hdlc/py:pw_hdlc", "//pw_ide/py:pw_ide", "//pw_log/py:pw_log", "//pw_log_rpc/py:pw_log_rpc", "//pw_presubmit/py:pw_presubmit", "//pw_protobuf_compiler/py:pw_protobuf_compiler", "//pw_rpc/py:pw_rpc_benchmark", "//pw_status/py:pw_status", "//pw_system/py:device_sim", "//pw_system/py:pw_system_benchmark_runner", "//pw_system/py:pw_system_console", "//pw_system/py:pw_system_lib", "//pw_tokenizer/py:pw_tokenizer", "//pw_transfer/py:pw_transfer", "//pw_unit_test/py:pw_unit_test", "//pw_watch/py:pw_watch", "//pw_watch/py:watch", "@pigweed_python_packages//jsonschema", "@pigweed_python_packages//kconfiglib", "@pigweed_python_packages//pydata_sphinx_theme", "@pigweed_python_packages//pytz", "@pigweed_python_packages//sphinx", "@pigweed_python_packages//sphinx_argparse", "@pigweed_python_packages//sphinx_copybutton", "@pigweed_python_packages//sphinx_design", "@pigweed_python_packages//sphinx_reredirects", "@pigweed_python_packages//sphinxcontrib_doxylink", "@pigweed_python_packages//sphinxcontrib_mermaid", "@rules_python//python/runfiles", ], ) # Use Sphinx to build the main pigweed.dev website. # # The main `docs` target must output a directory containing the fully # built pigweed.dev website. It must output a directory, not an archive, # because our deploy code expects a directory when it uploads the website # code and assets to our CDN. sphinx_docs( name = "docs", config = "conf.py", extra_opts = [ "--silent", "--fail-on-warning", "--jobs", "16", ], formats = [ "html", ], sphinx = ":sphinx_build", strip_prefix = "docs/sphinx/", tags = ["manual"], target_compatible_with = incompatible_with_mcu(), deps = [ ":not_prefixed", ":prefixed", ":rust", "//:docs", "//docker:docs", "//docs/doxygen:html", "//docs/doxygen:xml", "//kudzu:docs", "//pw_alignment:docs", "//pw_allocator:docs", "//pw_analog:docs", "//pw_android_toolchain:docs", "//pw_arduino_build:docs", "//pw_assert:docs", "//pw_assert_basic:docs", "//pw_assert_fuchsia:docs", "//pw_assert_log:docs", "//pw_assert_tokenized:docs", "//pw_assert_trap:docs", "//pw_assert_zephyr:docs", "//pw_async:docs", "//pw_async2:docs", "//pw_async2_basic:docs", "//pw_async2_epoll:docs", "//pw_async_basic:docs", "//pw_async_fuchsia:docs", "//pw_atomic:docs", "//pw_base64:docs", "//pw_bloat:docs", "//pw_blob_store:docs", "//pw_bluetooth:docs", "//pw_bluetooth_hci:docs", "//pw_bluetooth_profiles:docs", "//pw_bluetooth_proxy:docs", "//pw_bluetooth_sapphire:docs", "//pw_boot:docs", "//pw_boot_cortex_m:docs", "//pw_build:docs", "//pw_build_android:docs", "//pw_build_info:docs", "//pw_build_mcuxpresso:docs", "//pw_bytes:docs", "//pw_change:docs", "//pw_channel:docs", "//pw_checksum:docs", "//pw_chre:docs", "//pw_chrono:docs", "//pw_chrono_embos:docs", "//pw_chrono_freertos:docs", "//pw_chrono_rp2040:docs", "//pw_chrono_stl:docs", "//pw_chrono_threadx:docs", "//pw_chrono_zephyr:docs", "//pw_cli:docs", "//pw_cli_analytics:docs", "//pw_clock_tree:docs", "//pw_clock_tree_mcuxpresso:docs", "//pw_compilation_testing:docs", "//pw_config_loader:docs", "//pw_console:docs", "//pw_containers:docs", "//pw_cpu_exception:docs", "//pw_cpu_exception_cortex_m:docs", "//pw_cpu_exception_risc_v:docs", "//pw_crypto:docs", "//pw_digital_io:docs", "//pw_digital_io_linux:docs", "//pw_digital_io_mcuxpresso:docs", "//pw_digital_io_rp2040:docs", "//pw_digital_io_zephyr:docs", "//pw_display:docs", "//pw_dma_mcuxpresso:docs", "//pw_docgen:docs", "//pw_doctor:docs", "//pw_elf:docs", "//pw_emu:docs", "//pw_env_setup:docs", "//pw_env_setup_zephyr:docs", "//pw_file:docs", "//pw_flatbuffers:docs", "//pw_format:docs", "//pw_function:docs", "//pw_fuzzer:docs", "//pw_grpc:docs", "//pw_hdlc:docs", "//pw_hex_dump:docs", "//pw_i2c:docs", "//pw_i2c_linux:docs", "//pw_i2c_mcuxpresso:docs", "//pw_i2c_rp2040:docs", "//pw_i2c_zephyr:docs", "//pw_ide:docs", "//pw_interrupt:docs", "//pw_interrupt_cortex_m:docs", "//pw_interrupt_freertos:docs", "//pw_interrupt_zephyr:docs", "//pw_intrusive_ptr:docs", "//pw_json:docs", "//pw_kernel:docs", "//pw_kvs:docs", "//pw_libc:docs", "//pw_libcxx:docs", "//pw_log:docs", "//pw_log_android:docs", "//pw_log_basic:docs", "//pw_log_fuchsia:docs", "//pw_log_null:docs", "//pw_log_rpc:docs", "//pw_log_string:docs", "//pw_log_tokenized:docs", "//pw_log_zephyr:docs", "//pw_malloc:docs", "//pw_malloc_freelist:docs", "//pw_malloc_freertos:docs", "//pw_metric:docs", "//pw_minimal_cpp_stdlib:docs", "//pw_module:docs", "//pw_multibuf:docs", "//pw_multisink:docs", "//pw_numeric:docs", "//pw_package:docs", "//pw_perf_test:docs", "//pw_persistent_ram:docs", "//pw_polyfill:docs", "//pw_preprocessor:docs", "//pw_presubmit:docs", "//pw_protobuf:docs", "//pw_protobuf_compiler:docs", "//pw_random:docs", "//pw_random_fuchsia:docs", "//pw_result:docs", "//pw_ring_buffer:docs", "//pw_router:docs", "//pw_rpc:docs", "//pw_rpc_transport:docs", "//pw_rust:sphinx", "//pw_sensor:docs", "//pw_snapshot:docs", "//pw_software_update:docs", "//pw_span:docs", "//pw_spi:docs", "//pw_spi_linux:docs", "//pw_spi_mcuxpresso:docs", "//pw_spi_rp2040:docs", "//pw_status:docs", "//pw_stm32cube_build:docs", "//pw_stream:docs", "//pw_stream_shmem_mcuxpresso:docs", "//pw_stream_uart_linux:docs", "//pw_stream_uart_mcuxpresso:docs", "//pw_string:docs", "//pw_symbolizer:docs", "//pw_sync:docs", "//pw_sync_baremetal:docs", "//pw_sync_embos:docs", "//pw_sync_freertos:docs", "//pw_sync_stl:docs", "//pw_sync_threadx:docs", "//pw_sync_zephyr:docs", "//pw_sys_io:docs", "//pw_sys_io_ambiq_sdk:docs", "//pw_sys_io_arduino:docs", "//pw_sys_io_baremetal_lm3s6965evb:docs", "//pw_sys_io_baremetal_stm32f429:docs", "//pw_sys_io_emcraft_sf2:docs", "//pw_sys_io_mcuxpresso:docs", "//pw_sys_io_rp2040:docs", "//pw_sys_io_stdio:docs", "//pw_sys_io_stm32cube:docs", "//pw_sys_io_zephyr:docs", "//pw_system:docs", "//pw_target_runner:docs", "//pw_thread:docs", "//pw_thread_embos:docs", "//pw_thread_freertos:docs", "//pw_thread_stl:docs", "//pw_thread_threadx:docs", "//pw_thread_zephyr:docs", "//pw_tls_client:docs", "//pw_tls_client_boringssl:docs", "//pw_tls_client_mbedtls:docs", "//pw_tokenizer:docs", "//pw_toolchain:docs", "//pw_trace:docs", "//pw_trace_tokenized:docs", "//pw_transfer:docs", "//pw_uart:docs", "//pw_uart_mcuxpresso:docs", "//pw_unit_test:docs", "//pw_uuid:docs", "//pw_varint:docs", "//pw_watch:docs", "//pw_web:docs", "//pw_work_queue:docs", "//seed:docs", "//targets:docs", "//third_party:docs", ], )