Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: move Sphinx object inventory for Bazel under sphinxdocs #2117

Merged
merged 4 commits into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions docs/sphinx/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ load("//python:pip.bzl", "compile_pip_requirements")
load("//python/private:bzlmod_enabled.bzl", "BZLMOD_ENABLED") # buildifier: disable=bzl-visibility
load("//python/private:util.bzl", "IS_BAZEL_7_OR_HIGHER") # buildifier: disable=bzl-visibility
load("//sphinxdocs:readthedocs.bzl", "readthedocs_install")
load("//sphinxdocs:sphinx.bzl", "sphinx_build_binary", "sphinx_docs", "sphinx_inventory")
load("//sphinxdocs:sphinx.bzl", "sphinx_build_binary", "sphinx_docs")
load("//sphinxdocs:sphinx_stardoc.bzl", "sphinx_stardocs")

# We only build for Linux and Mac because:
Expand All @@ -38,7 +38,6 @@ _TARGET_COMPATIBLE_WITH = select({
sphinx_docs(
name = "docs",
srcs = [
":bazel_inventory",
":bzl_api_docs",
] + glob(
include = [
Expand All @@ -60,19 +59,14 @@ sphinx_docs(
renamed_srcs = {
"//:CHANGELOG.md": "changelog.md",
"//:CONTRIBUTING.md": "contributing.md",
"//sphinxdocs/inventories:bazel_inventory": "bazel_inventory.inv",
},
sphinx = ":sphinx-build",
strip_prefix = package_name() + "/",
tags = ["docs"],
target_compatible_with = _TARGET_COMPATIBLE_WITH,
)

sphinx_inventory(
name = "bazel_inventory",
src = "bazel_inventory.txt",
visibility = ["//:__subpackages__"],
)

sphinx_stardocs(
name = "bzl_api_docs",
docs = {
Expand Down
22 changes: 22 additions & 0 deletions sphinxdocs/inventories/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright 2024 The Bazel Authors. All rights reserved.
#
# 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
#
# http://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("//sphinxdocs:sphinx.bzl", "sphinx_inventory")

# Inventory for the current Bazel version
sphinx_inventory(
name = "bazel_inventory",
src = "bazel_inventory.txt",
visibility = ["//visibility:public"],
)
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ bool bzl:type 1 rules/lib/bool -
int bzl:type 1 rules/lib/int -
depset bzl:type 1 rules/lib/depset -
dict bzl:type 1 rules/lib/dict -
label bzl:type 1 concepts/labels -
label bzl:doc 1 concepts/labels -
attr.bool bzl:type 1 rules/lib/toplevel/attr#bool -
attr.int bzl:type 1 rules/lib/toplevel/attr#int -
attr.label bzl:type 1 rules/lib/toplevel/attr#label -
Expand Down
2 changes: 1 addition & 1 deletion sphinxdocs/tests/sphinx_stardoc/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ sphinx_docs(
"html",
],
renamed_srcs = {
"//docs/sphinx:bazel_inventory": "bazel_inventory.inv",
"//sphinxdocs/inventories:bazel_inventory": "bazel_inventory.inv",
},
sphinx = ":sphinx-build",
strip_prefix = package_name() + "/",
Expand Down