Skip to content

Commit

Permalink
Merge pull request #73 from aalyria/451C0AE9A6D9AC57B22C116D52A0F7D5
Browse files Browse the repository at this point in the history
Project import generated by Copybara.
  • Loading branch information
ciarand authored Mar 11, 2024
2 parents caf6ffe + 58ebf31 commit 759e177
Show file tree
Hide file tree
Showing 4 changed files with 499 additions and 0 deletions.
3 changes: 3 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ load("@rules_jvm_external//:defs.bzl", "maven_install")
load("@rules_jvm_external//:repositories.bzl", "rules_jvm_external_deps")
load("@rules_proto_grpc//:repositories.bzl", "rules_proto_grpc_toolchains")
load("@rules_proto_grpc//cpp:repositories.bzl", rules_proto_grpc_cpp_repos = "cpp_repos")
load("@rules_proto_grpc//doc:repositories.bzl", rules_proto_grpc_doc_repos = "doc_repos")
load("@rules_proto_grpc//go:repositories.bzl", rules_proto_grpc_go_repos = "go_repos")
load("@rules_proto_grpc//java:repositories.bzl", rules_proto_grpc_java_repos = "java_repos")
load("@rules_proto_grpc//python:repositories.bzl", rules_proto_grpc_python_repos = "python_repos")
Expand Down Expand Up @@ -633,6 +634,8 @@ rules_proto_grpc_toolchains()

rules_proto_grpc_cpp_repos()

rules_proto_grpc_doc_repos()

rules_proto_grpc_go_repos()

rules_proto_grpc_java_repos()
Expand Down
41 changes: 41 additions & 0 deletions api/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Copyright 2023 Aalyria Technologies, Inc., and its affiliates.
#
# 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("@rules_proto_grpc//doc:defs.bzl", "doc_markdown_compile", "doc_template_compile")

# bazel query 'kind("^proto_library", //api/...)'
_all_protos = [
"//api/cdpi/v1alpha:cdpi_proto",
"//api/common:common_proto",
"//api/fed/v1alpha:fed_proto",
"//api/nbi/v1alpha:nbi_proto",
"//api/nbi/v1alpha/resources:resources_proto",
"//api/types:types_proto",
]

# The default HTML template that comes with the protoc-gen-doc tool adds a
# `<p></p>` to every newline in every description. This ends up causing weird,
# short line breaks. We use a custom template that just renders the description
# as-is inside a single `<p>` tag.
# https://github.com/pseudomuto/protoc-gen-doc/blob/df9dd4078971bb01d06bcd88130a7b5309348be0/resources/html.tmpl
doc_template_compile(
name = "api.html",
protos = _all_protos,
template = "//api/resources:html.tmpl",
)

doc_markdown_compile(
name = "api.md",
protos = _all_protos,
)
15 changes: 15 additions & 0 deletions api/resources/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2023 Aalyria Technologies, Inc., and its affiliates.
#
# 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.

exports_files(["html.tmpl"])
Loading

0 comments on commit 759e177

Please sign in to comment.