1*61c4878aSAndroid Build Coastguard Worker# Copyright 2024 The Pigweed Authors 2*61c4878aSAndroid Build Coastguard Worker# 3*61c4878aSAndroid Build Coastguard Worker# Licensed under the Apache License, Version 2.0 (the "License"); you may not 4*61c4878aSAndroid Build Coastguard Worker# use this file except in compliance with the License. You may obtain a copy of 5*61c4878aSAndroid Build Coastguard Worker# the License at 6*61c4878aSAndroid Build Coastguard Worker# 7*61c4878aSAndroid Build Coastguard Worker# https://www.apache.org/licenses/LICENSE-2.0 8*61c4878aSAndroid Build Coastguard Worker# 9*61c4878aSAndroid Build Coastguard Worker# Unless required by applicable law or agreed to in writing, software 10*61c4878aSAndroid Build Coastguard Worker# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11*61c4878aSAndroid Build Coastguard Worker# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12*61c4878aSAndroid Build Coastguard Worker# License for the specific language governing permissions and limitations under 13*61c4878aSAndroid Build Coastguard Worker# the License. 14*61c4878aSAndroid Build Coastguard Worker 15*61c4878aSAndroid Build Coastguard Workerload("@pigweed//pw_build:compatibility.bzl", "incompatible_with_mcu") 16*61c4878aSAndroid Build Coastguard Workerload("@rules_python//sphinxdocs:sphinx.bzl", "sphinx_build_binary", "sphinx_docs") 17*61c4878aSAndroid Build Coastguard Workerload("@rules_python//sphinxdocs:sphinx_docs_library.bzl", "sphinx_docs_library") 18*61c4878aSAndroid Build Coastguard Worker 19*61c4878aSAndroid Build Coastguard Workerpackage(default_visibility = ["//visibility:public"]) 20*61c4878aSAndroid Build Coastguard Worker 21*61c4878aSAndroid Build Coastguard Workerlicenses(["notice"]) 22*61c4878aSAndroid Build Coastguard Worker 23*61c4878aSAndroid Build Coastguard Workerexports_files([ 24*61c4878aSAndroid Build Coastguard Worker "module_metadata.json", 25*61c4878aSAndroid Build Coastguard Worker "module_metadata_schema.json", 26*61c4878aSAndroid Build Coastguard Worker]) 27*61c4878aSAndroid Build Coastguard Worker 28*61c4878aSAndroid Build Coastguard Workersphinx_docs_library( 29*61c4878aSAndroid Build Coastguard Worker # TODO: https://pwbug.dev/377679855 - Rename this to "docs" after merging. 30*61c4878aSAndroid Build Coastguard Worker name = "not_prefixed", 31*61c4878aSAndroid Build Coastguard Worker srcs = [ 32*61c4878aSAndroid Build Coastguard Worker "automated_analysis.rst", 33*61c4878aSAndroid Build Coastguard Worker "bazel_compatibility.rst", 34*61c4878aSAndroid Build Coastguard Worker "build_system.rst", 35*61c4878aSAndroid Build Coastguard Worker "changelog.rst", 36*61c4878aSAndroid Build Coastguard Worker "index.rst", 37*61c4878aSAndroid Build Coastguard Worker "layout/layout.html", 38*61c4878aSAndroid Build Coastguard Worker "module_metadata.json", 39*61c4878aSAndroid Build Coastguard Worker "module_metadata_schema.json", 40*61c4878aSAndroid Build Coastguard Worker "modules.rst", 41*61c4878aSAndroid Build Coastguard Worker "python_build.rst", 42*61c4878aSAndroid Build Coastguard Worker "targets.rst", 43*61c4878aSAndroid Build Coastguard Worker "third_party_support.rst", 44*61c4878aSAndroid Build Coastguard Worker ], 45*61c4878aSAndroid Build Coastguard Worker strip_prefix = "docs/", 46*61c4878aSAndroid Build Coastguard Worker target_compatible_with = incompatible_with_mcu(), 47*61c4878aSAndroid Build Coastguard Worker) 48*61c4878aSAndroid Build Coastguard Worker 49*61c4878aSAndroid Build Coastguard Worker# TODO: https://pwbug.dev/377679855 - Merge this into "not_prefixed" 50*61c4878aSAndroid Build Coastguard Worker# (which will be renamed to "docs" after the merge). 51*61c4878aSAndroid Build Coastguard Workersphinx_docs_library( 52*61c4878aSAndroid Build Coastguard Worker name = "prefixed", 53*61c4878aSAndroid Build Coastguard Worker srcs = [ 54*61c4878aSAndroid Build Coastguard Worker "_static/css/pigweed.css", 55*61c4878aSAndroid Build Coastguard Worker "_static/js/changelog.js", 56*61c4878aSAndroid Build Coastguard Worker "_static/js/pigweed.js", 57*61c4878aSAndroid Build Coastguard Worker "_static/pw_logo.ico", 58*61c4878aSAndroid Build Coastguard Worker "_static/pw_logo.svg", 59*61c4878aSAndroid Build Coastguard Worker "3p/index.rst", 60*61c4878aSAndroid Build Coastguard Worker "blog/01-kudzu.rst", 61*61c4878aSAndroid Build Coastguard Worker "blog/02-bazel-feature-flags.rst", 62*61c4878aSAndroid Build Coastguard Worker "blog/03-pigweed-sdk.rst", 63*61c4878aSAndroid Build Coastguard Worker "blog/04-fixed-point.rst", 64*61c4878aSAndroid Build Coastguard Worker "blog/05-coroutines.rst", 65*61c4878aSAndroid Build Coastguard Worker "blog/index.rst", 66*61c4878aSAndroid Build Coastguard Worker "blog/rss.xml", 67*61c4878aSAndroid Build Coastguard Worker "code_of_conduct.rst", 68*61c4878aSAndroid Build Coastguard Worker "code_reviews.rst", 69*61c4878aSAndroid Build Coastguard Worker "community/index.rst", 70*61c4878aSAndroid Build Coastguard Worker "concepts/index.rst", 71*61c4878aSAndroid Build Coastguard Worker "contributing/index.rst", 72*61c4878aSAndroid Build Coastguard Worker "contributing/docs/changelog.rst", 73*61c4878aSAndroid Build Coastguard Worker "contributing/docs/guides.rst", 74*61c4878aSAndroid Build Coastguard Worker "contributing/docs/index.rst", 75*61c4878aSAndroid Build Coastguard Worker "contributing/docs/modules.rst", 76*61c4878aSAndroid Build Coastguard Worker "embedded_cpp_guide.rst", 77*61c4878aSAndroid Build Coastguard Worker "facades.rst", 78*61c4878aSAndroid Build Coastguard Worker "faq.rst", 79*61c4878aSAndroid Build Coastguard Worker "get_started/bazel_integration.rst", 80*61c4878aSAndroid Build Coastguard Worker "get_started/bazel.rst", 81*61c4878aSAndroid Build Coastguard Worker "get_started/first_time_setup.rst", 82*61c4878aSAndroid Build Coastguard Worker "get_started/github_actions.rst", 83*61c4878aSAndroid Build Coastguard Worker "get_started/index.rst", 84*61c4878aSAndroid Build Coastguard Worker "get_started/install_bazel.rst", 85*61c4878aSAndroid Build Coastguard Worker "get_started/upstream.rst", 86*61c4878aSAndroid Build Coastguard Worker "get_started/zephyr.rst", 87*61c4878aSAndroid Build Coastguard Worker "glossary.rst", 88*61c4878aSAndroid Build Coastguard Worker "infra/ci_cq_intro.rst", 89*61c4878aSAndroid Build Coastguard Worker "infra/index.rst", 90*61c4878aSAndroid Build Coastguard Worker "infra/rollers.rst", 91*61c4878aSAndroid Build Coastguard Worker "mission.rst", 92*61c4878aSAndroid Build Coastguard Worker "module_structure.rst", 93*61c4878aSAndroid Build Coastguard Worker "os/index.rst", 94*61c4878aSAndroid Build Coastguard Worker "os/zephyr/index.rst", 95*61c4878aSAndroid Build Coastguard Worker # TODO: https://pwbug.dev/377683258 - Enable this file after 96*61c4878aSAndroid Build Coastguard Worker # https://pwrev.dev/248014 merges. 97*61c4878aSAndroid Build Coastguard Worker # "os/zephyr/kconfig.rst", 98*61c4878aSAndroid Build Coastguard Worker "overview.rst", 99*61c4878aSAndroid Build Coastguard Worker "showcases/sense/index.rst", 100*61c4878aSAndroid Build Coastguard Worker "showcases/sense/tutorial/automate.rst", 101*61c4878aSAndroid Build Coastguard Worker "showcases/sense/tutorial/bazel_cloud.rst", 102*61c4878aSAndroid Build Coastguard Worker "showcases/sense/tutorial/build.rst", 103*61c4878aSAndroid Build Coastguard Worker "showcases/sense/tutorial/code_intelligence.rst", 104*61c4878aSAndroid Build Coastguard Worker "showcases/sense/tutorial/crash_handler.rst", 105*61c4878aSAndroid Build Coastguard Worker "showcases/sense/tutorial/device_tests.rst", 106*61c4878aSAndroid Build Coastguard Worker "showcases/sense/tutorial/explore.rst", 107*61c4878aSAndroid Build Coastguard Worker "showcases/sense/tutorial/factory.rst", 108*61c4878aSAndroid Build Coastguard Worker "showcases/sense/tutorial/flash.rst", 109*61c4878aSAndroid Build Coastguard Worker "showcases/sense/tutorial/host_sim.rst", 110*61c4878aSAndroid Build Coastguard Worker "showcases/sense/tutorial/host_tests.rst", 111*61c4878aSAndroid Build Coastguard Worker "showcases/sense/tutorial/index.rst", 112*61c4878aSAndroid Build Coastguard Worker "showcases/sense/tutorial/outro.rst", 113*61c4878aSAndroid Build Coastguard Worker "showcases/sense/tutorial/production.rst", 114*61c4878aSAndroid Build Coastguard Worker "showcases/sense/tutorial/rpc.rst", 115*61c4878aSAndroid Build Coastguard Worker "showcases/sense/tutorial/setup.rst", 116*61c4878aSAndroid Build Coastguard Worker "showcases/sense/tutorial/web.rst", 117*61c4878aSAndroid Build Coastguard Worker "size_optimizations.rst", 118*61c4878aSAndroid Build Coastguard Worker "style/cli.rst", 119*61c4878aSAndroid Build Coastguard Worker "style/commit_message.rst", 120*61c4878aSAndroid Build Coastguard Worker "style/cpp.rst", 121*61c4878aSAndroid Build Coastguard Worker "style/doxygen.rst", 122*61c4878aSAndroid Build Coastguard Worker "style/protobuf.rst", 123*61c4878aSAndroid Build Coastguard Worker "style/rest.rst", 124*61c4878aSAndroid Build Coastguard Worker "style/writing.rst", 125*61c4878aSAndroid Build Coastguard Worker "style_guide.rst", 126*61c4878aSAndroid Build Coastguard Worker ], 127*61c4878aSAndroid Build Coastguard Worker # TODO: https://pwbug.dev/377679855 - Remove this URL prefix. 128*61c4878aSAndroid Build Coastguard Worker prefix = "docs/", 129*61c4878aSAndroid Build Coastguard Worker target_compatible_with = incompatible_with_mcu(), 130*61c4878aSAndroid Build Coastguard Worker) 131*61c4878aSAndroid Build Coastguard Worker 132*61c4878aSAndroid Build Coastguard Workersphinx_docs( 133*61c4878aSAndroid Build Coastguard Worker name = "docs", 134*61c4878aSAndroid Build Coastguard Worker config = "conf.py", 135*61c4878aSAndroid Build Coastguard Worker formats = [ 136*61c4878aSAndroid Build Coastguard Worker "html", 137*61c4878aSAndroid Build Coastguard Worker ], 138*61c4878aSAndroid Build Coastguard Worker sphinx = ":sphinx-build", 139*61c4878aSAndroid Build Coastguard Worker strip_prefix = "docs/", 140*61c4878aSAndroid Build Coastguard Worker target_compatible_with = incompatible_with_mcu(), 141*61c4878aSAndroid Build Coastguard Worker deps = [ 142*61c4878aSAndroid Build Coastguard Worker ":not_prefixed", 143*61c4878aSAndroid Build Coastguard Worker ":prefixed", 144*61c4878aSAndroid Build Coastguard Worker "//pw_async2:docs", 145*61c4878aSAndroid Build Coastguard Worker "//pw_boot:docs", 146*61c4878aSAndroid Build Coastguard Worker "//seed:docs", 147*61c4878aSAndroid Build Coastguard Worker "//targets:docs", 148*61c4878aSAndroid Build Coastguard Worker ], 149*61c4878aSAndroid Build Coastguard Worker) 150*61c4878aSAndroid Build Coastguard Worker 151*61c4878aSAndroid Build Coastguard Workersphinx_build_binary( 152*61c4878aSAndroid Build Coastguard Worker name = "sphinx-build", 153*61c4878aSAndroid Build Coastguard Worker target_compatible_with = incompatible_with_mcu(), 154*61c4878aSAndroid Build Coastguard Worker deps = [ 155*61c4878aSAndroid Build Coastguard Worker "//pw_console/py:pw_console", 156*61c4878aSAndroid Build Coastguard Worker "//pw_docgen/py:pw_docgen", 157*61c4878aSAndroid Build Coastguard Worker "@python_packages//breathe", 158*61c4878aSAndroid Build Coastguard Worker "@python_packages//pydata_sphinx_theme", 159*61c4878aSAndroid Build Coastguard Worker "@python_packages//sphinx", 160*61c4878aSAndroid Build Coastguard Worker "@python_packages//sphinx_argparse", 161*61c4878aSAndroid Build Coastguard Worker "@python_packages//sphinx_copybutton", 162*61c4878aSAndroid Build Coastguard Worker "@python_packages//sphinx_design", 163*61c4878aSAndroid Build Coastguard Worker "@python_packages//sphinx_reredirects", 164*61c4878aSAndroid Build Coastguard Worker "@python_packages//sphinx_sitemap", 165*61c4878aSAndroid Build Coastguard Worker "@python_packages//sphinxcontrib_mermaid", 166*61c4878aSAndroid Build Coastguard Worker ], 167*61c4878aSAndroid Build Coastguard Worker) 168*61c4878aSAndroid Build Coastguard Worker 169*61c4878aSAndroid Build Coastguard Workerfilegroup( 170*61c4878aSAndroid Build Coastguard Worker name = "doxygen", 171*61c4878aSAndroid Build Coastguard Worker srcs = [ 172*61c4878aSAndroid Build Coastguard Worker "//pw_alignment:doxygen", 173*61c4878aSAndroid Build Coastguard Worker "//pw_allocator:doxygen", 174*61c4878aSAndroid Build Coastguard Worker "//pw_analog:doxygen", 175*61c4878aSAndroid Build Coastguard Worker "//pw_async:doxygen", 176*61c4878aSAndroid Build Coastguard Worker "//pw_async2:doxygen", 177*61c4878aSAndroid Build Coastguard Worker "//pw_async2_basic:doxygen", 178*61c4878aSAndroid Build Coastguard Worker "//pw_async_basic:doxygen", 179*61c4878aSAndroid Build Coastguard Worker "//pw_base64:doxygen", 180*61c4878aSAndroid Build Coastguard Worker "//pw_bluetooth:doxygen", 181*61c4878aSAndroid Build Coastguard Worker "//pw_bluetooth_proxy:doxygen", 182*61c4878aSAndroid Build Coastguard Worker "//pw_build:doxygen", 183*61c4878aSAndroid Build Coastguard Worker "//pw_bytes:doxygen", 184*61c4878aSAndroid Build Coastguard Worker "//pw_channel:doxygen", 185*61c4878aSAndroid Build Coastguard Worker "//pw_chre:doxygen", 186*61c4878aSAndroid Build Coastguard Worker "//pw_chrono:doxygen", 187*61c4878aSAndroid Build Coastguard Worker "//pw_clock_tree:doxygen", 188*61c4878aSAndroid Build Coastguard Worker "//pw_clock_tree_mcuxpresso:doxygen", 189*61c4878aSAndroid Build Coastguard Worker "//pw_containers:doxygen", 190*61c4878aSAndroid Build Coastguard Worker "//pw_crypto:doxygen", 191*61c4878aSAndroid Build Coastguard Worker "//pw_digital_io:doxygen", 192*61c4878aSAndroid Build Coastguard Worker "//pw_display:doxygen", 193*61c4878aSAndroid Build Coastguard Worker "//pw_elf:doxygen", 194*61c4878aSAndroid Build Coastguard Worker "//pw_function:doxygen", 195*61c4878aSAndroid Build Coastguard Worker "//pw_hdlc:doxygen", 196*61c4878aSAndroid Build Coastguard Worker "//pw_hex_dump:doxygen", 197*61c4878aSAndroid Build Coastguard Worker "//pw_i2c:doxygen", 198*61c4878aSAndroid Build Coastguard Worker "//pw_i2c_linux:doxygen", 199*61c4878aSAndroid Build Coastguard Worker "//pw_interrupt:doxygen", 200*61c4878aSAndroid Build Coastguard Worker "//pw_json:doxygen", 201*61c4878aSAndroid Build Coastguard Worker "//pw_kvs:doxygen", 202*61c4878aSAndroid Build Coastguard Worker "//pw_log:doxygen", 203*61c4878aSAndroid Build Coastguard Worker "//pw_log_string:doxygen", 204*61c4878aSAndroid Build Coastguard Worker "//pw_log_tokenized:doxygen", 205*61c4878aSAndroid Build Coastguard Worker "//pw_malloc:doxygen", 206*61c4878aSAndroid Build Coastguard Worker "//pw_multibuf:doxygen", 207*61c4878aSAndroid Build Coastguard Worker "//pw_numeric:doxygen", 208*61c4878aSAndroid Build Coastguard Worker "//pw_perf_test:doxygen", 209*61c4878aSAndroid Build Coastguard Worker "//pw_polyfill:doxygen", 210*61c4878aSAndroid Build Coastguard Worker "//pw_preprocessor:doxygen", 211*61c4878aSAndroid Build Coastguard Worker "//pw_protobuf:doxygen", 212*61c4878aSAndroid Build Coastguard Worker "//pw_random:doxygen", 213*61c4878aSAndroid Build Coastguard Worker "//pw_rpc:doxygen", 214*61c4878aSAndroid Build Coastguard Worker "//pw_span:doxygen", 215*61c4878aSAndroid Build Coastguard Worker "//pw_spi:doxygen", 216*61c4878aSAndroid Build Coastguard Worker "//pw_status:doxygen", 217*61c4878aSAndroid Build Coastguard Worker "//pw_stream:doxygen", 218*61c4878aSAndroid Build Coastguard Worker "//pw_stream_uart_linux:doxygen", 219*61c4878aSAndroid Build Coastguard Worker "//pw_string:doxygen", 220*61c4878aSAndroid Build Coastguard Worker "//pw_sync:doxygen", 221*61c4878aSAndroid Build Coastguard Worker "//pw_sys_io:doxygen", 222*61c4878aSAndroid Build Coastguard Worker "//pw_system:doxygen", 223*61c4878aSAndroid Build Coastguard Worker "//pw_thread:doxygen", 224*61c4878aSAndroid Build Coastguard Worker "//pw_tokenizer:doxygen", 225*61c4878aSAndroid Build Coastguard Worker "//pw_toolchain:doxygen", 226*61c4878aSAndroid Build Coastguard Worker "//pw_transfer:doxygen", 227*61c4878aSAndroid Build Coastguard Worker "//pw_uart:doxygen", 228*61c4878aSAndroid Build Coastguard Worker "//pw_unit_test:doxygen", 229*61c4878aSAndroid Build Coastguard Worker "//pw_varint:doxygen", 230*61c4878aSAndroid Build Coastguard Worker "//pw_work_queue:doxygen", 231*61c4878aSAndroid Build Coastguard Worker ], 232*61c4878aSAndroid Build Coastguard Worker) 233