diff --git a/BUILD b/BUILD index cc6279471f..6927fdf895 100644 --- a/BUILD +++ b/BUILD @@ -132,6 +132,16 @@ alias( # Docs docs( + bundles = [ + { + "bundle": "//score/launch_manager:docs", + "mount_at": "components/launch_manager", + }, + { + "bundle": "//score/health_monitor:docs", + "mount_at": "components/health_monitor", + }, + ], data = [ "//score/launch_manager/src/daemon/src/configuration/config_schema:config_schema_files", ], @@ -139,5 +149,7 @@ docs( "@score_platform//:needs_json", # This allows linking to feature requirements. "@score_process//:needs_json", # This allows linking to requirements (wp__requirements_comp, etc.) from the process_description repository. ], - source_dir = ".", + project = "Lifecycle and Health Management", + project_url = "https://eclipse-score.github.io/lifecycle/", + source_dir = "docs", ) diff --git a/conf.py b/conf.py deleted file mode 100644 index 43eb2d0a88..0000000000 --- a/conf.py +++ /dev/null @@ -1,81 +0,0 @@ -# ******************************************************************************* -# Copyright (c) 2024 Contributors to the Eclipse Foundation -# -# See the NOTICE file(s) distributed with this work for additional -# information regarding copyright ownership. -# -# This program and the accompanying materials are made available under the -# terms of the Apache License Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0 -# -# SPDX-License-Identifier: Apache-2.0 -# ******************************************************************************* - -# Configuration file for the Sphinx documentation builder. -# -# For the full list of built-in configuration values, see the documentation: -# https://www.sphinx-doc.org/en/master/usage/configuration.html - -import os -import shutil -from pathlib import Path - -# -- Project information ----------------------------------------------------- -# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information - -project = "Lifecycle and Health Management" -project_url = "https://eclipse-score.github.io/lifecycle/" -version = "0.1" - -# -- General configuration --------------------------------------------------- -# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration - - -extensions = ["score_sphinx_bundle"] - -include_patterns = [ - "index.rst", - "docs/**", - "examples/docs/**", - "score/launch_manager/docs/**", - "score/launch_manager/src/lifecycle_client/docs/**", - "score/health_monitor/docs/**", -] - -exclude_patterns = [ - # The following entries are not required when building the documentation via 'bazel - # build //docs:docs', as that command runs in a sandboxed environment. However, when - # building the documentation via 'bazel run //docs:incremental' or esbonio, these - # entries are required to prevent the build from failing. - "bazel-*", - ".venv_docs", -] - - -def setup(app): - # When Sphinx runs inside a Bazel action (bazel build //:needs_json), the - # CWD is the execroot / sandbox root and the JSON schema files are linked - # there at their workspace-relative paths (src/...) because they are - # declared as tools. However, the Sphinx source tree lives under - # bazel-out/…/_needs_json/_sources/, so literalinclude directives that - # traverse four levels up from docs/module/…/user_guide/ land at - # _sources/src/…, which Bazel does not populate automatically. Copying - # the files into the source tree directory makes literalinclude work - # without touching the RST files or the external docs macro. - # - # For non-Bazel runs (bazel run //:docs, local sphinx-build) the source - # JSON files already exist at srcdir.parent / "src" / …, so the guard - # below is a no-op. - srcdir = Path(app.srcdir) - workspace_root = Path(os.getcwd()) - src_json_dir = ( - workspace_root - / "score/lifecycle/score/launch_manager/src/daemon/src/configuration/config_schema" - ) - dest_json_dir = ( - srcdir.parent - / "score/lifecycle/score/launch_manager/src/daemon/src/configuration/config_schema" - ) - if src_json_dir.exists() and not dest_json_dir.exists(): - dest_json_dir.parent.mkdir(parents=True, exist_ok=True) - shutil.copytree(src_json_dir, dest_json_dir) diff --git a/docs/components/index.rst b/docs/components/index.rst new file mode 100644 index 0000000000..2a9d5cf7d5 --- /dev/null +++ b/docs/components/index.rst @@ -0,0 +1,7 @@ +Component documentation +------------------------ + +.. toctree will be filled by docs_bundle via bazel + +.. toctree:: + :maxdepth: 1 diff --git a/index.rst b/docs/index.rst similarity index 84% rename from index.rst rename to docs/index.rst index c34ccf4dc0..b2b225c59a 100644 --- a/index.rst +++ b/docs/index.rst @@ -21,12 +21,12 @@ Module / Feature Documentation .. toctree:: :maxdepth: 1 - docs/features/index - docs/manuals/index - docs/safety_mgt/index - docs/security_mgt/index - docs/release/index - docs/verification_report/statistics + features/index + manuals/index + safety_mgt/index + security_mgt/index + release/index + verification_report/statistics Component documentation ------------------------ @@ -34,8 +34,7 @@ Component documentation .. toctree:: :maxdepth: 1 - score/launch_manager/docs/index - score/health_monitor/docs/index + components/index .. _quick-start-building-testing: diff --git a/docs/manuals/user_manual.rst b/docs/manuals/user_manual.rst index 2ff9467f11..9688dba39c 100644 --- a/docs/manuals/user_manual.rst +++ b/docs/manuals/user_manual.rst @@ -115,7 +115,7 @@ Integrating with Your Project Version History, Compatibility, and Troubleshooting =================================================== -For comprehensive information on the following topics, refer to :doc:`/docs/release/index`: +For comprehensive information on the following topics, refer to :ref:`release_notes`: * Version history and changes * Compatibility notes and upgrade instructions diff --git a/docs/release/index.rst b/docs/release/index.rst index 2c9737d329..19e6933771 100644 --- a/docs/release/index.rst +++ b/docs/release/index.rst @@ -12,7 +12,7 @@ # SPDX-License-Identifier: Apache-2.0 # ******************************************************************************* - +.. _release_notes: Release notes ============= diff --git a/score/health_monitor/BUILD b/score/health_monitor/BUILD index cd6b10241e..f7c1457946 100644 --- a/score/health_monitor/BUILD +++ b/score/health_monitor/BUILD @@ -10,6 +10,7 @@ # # SPDX-License-Identifier: Apache-2.0 # ******************************************************************************* +load("@score_docs_as_code//:docs.bzl", "docs_bundle") alias( name = "health_monitoring_cc", @@ -22,3 +23,13 @@ alias( actual = "//score/health_monitor/src/rust:health_monitoring_lib", visibility = ["//visibility:public"], ) + +docs_bundle( + name = "docs", + code_targets = [ + ":health_monitoring_cc", + ":health_monitoring_rust", + ], + source_dir = "docs", + visibility = ["//visibility:public"], +) diff --git a/score/launch_manager/BUILD b/score/launch_manager/BUILD index 21e08ed118..d4f7996058 100644 --- a/score/launch_manager/BUILD +++ b/score/launch_manager/BUILD @@ -11,6 +11,7 @@ # SPDX-License-Identifier: Apache-2.0 # ******************************************************************************* load("@rules_cc//cc:defs.bzl", "cc_library") +load("@score_docs_as_code//:docs.bzl", "docs_bundle") load("//tests/utils/bazel:unit_test.bzl", "lm_cc_test") package(default_visibility = ["//visibility:public"]) @@ -132,3 +133,19 @@ alias( actual = "//score/launch_manager/src/lifecycle_client:runapplication", ) # END: Fine granular targets only needed for testing purposes + +docs_bundle( + name = "docs", + bundles = [ + { + "bundle": "//score/launch_manager/src/lifecycle_client:docs", + "mount_at": "subcomponents/lifecycle_client", + }, + ], + code_targets = [ + ":launch_manager", + ], + data = ["//score/launch_manager/src/daemon/src/configuration/config_schema:config_schema_files"], + source_dir = "docs", + visibility = ["//visibility:public"], +) diff --git a/score/launch_manager/docs/index.rst b/score/launch_manager/docs/index.rst index 66c1019514..e1dc57ed47 100644 --- a/score/launch_manager/docs/index.rst +++ b/score/launch_manager/docs/index.rst @@ -39,4 +39,4 @@ Subcomponents .. toctree:: :titlesonly: - ../src/lifecycle_client/docs/index.rst + subcomponents/index diff --git a/score/launch_manager/docs/subcomponents/index.rst b/score/launch_manager/docs/subcomponents/index.rst new file mode 100644 index 0000000000..7d3cd8326b --- /dev/null +++ b/score/launch_manager/docs/subcomponents/index.rst @@ -0,0 +1,21 @@ +.. + # ******************************************************************************* + # Copyright (c) 2026 Contributors to the Eclipse Foundation + # + # See the NOTICE file(s) distributed with this work for additional + # information regarding copyright ownership. + # + # This program and the accompanying materials are made available under the + # terms of the Apache License Version 2.0 which is available at + # https://www.apache.org/licenses/LICENSE-2.0 + # + # SPDX-License-Identifier: Apache-2.0 + # ******************************************************************************* + +Sub-Component documentation +--------------------------- + +.. toctree will be filled by docs_bundle via bazel + +.. toctree:: + :maxdepth: 1 diff --git a/score/launch_manager/src/daemon/src/configuration/config_schema/README.rst b/score/launch_manager/src/daemon/src/configuration/README.rst similarity index 100% rename from score/launch_manager/src/daemon/src/configuration/config_schema/README.rst rename to score/launch_manager/src/daemon/src/configuration/README.rst diff --git a/score/launch_manager/src/daemon/src/configuration/config_schema/BUILD b/score/launch_manager/src/daemon/src/configuration/config_schema/BUILD index c36116909f..c11defa670 100644 --- a/score/launch_manager/src/daemon/src/configuration/config_schema/BUILD +++ b/score/launch_manager/src/daemon/src/configuration/config_schema/BUILD @@ -21,5 +21,5 @@ exports_files( filegroup( name = "config_schema_files", srcs = glob(["**/*.json"]), - visibility = ["//:__pkg__"], + visibility = ["//visibility:public"], ) diff --git a/score/launch_manager/src/lifecycle_client/BUILD b/score/launch_manager/src/lifecycle_client/BUILD index 7a2d504a38..734792332a 100644 --- a/score/launch_manager/src/lifecycle_client/BUILD +++ b/score/launch_manager/src/lifecycle_client/BUILD @@ -12,6 +12,7 @@ # ******************************************************************************* load("@rules_cc//cc:defs.bzl", "cc_library") load("@score_baselibs//score/language/safecpp:toolchain_features.bzl", "COMPILER_WARNING_FEATURES") +load("@score_docs_as_code//:docs.bzl", "docs_bundle") load("//tests/utils/bazel:unit_test.bzl", "lm_cc_test") cc_library( @@ -249,3 +250,12 @@ lm_cc_test( "@googletest//:gtest_main", ], ) + +docs_bundle( + name = "docs", + code_targets = [ + ":lifecycle_client", + ], + source_dir = "docs", + visibility = ["//visibility:public"], +)