blob: e25b8eaf58e0062347f40d4bf713f5fb5ce12a8f [file] [log] [blame] [edit]
# Copyright 2017 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("//tools/stardoc:index.bzl", "rules_nodejs_docs", "stardoc")
stardoc(
name = "builtins",
out = "builtins.api",
input = "//:index.for_docs.bzl",
tags = ["fix-windows"],
deps = [
"//:bzl",
"//internal/node:bzl",
],
)
stardoc(
name = "providers",
out = "providers.api",
input = "//:providers.bzl",
tags = ["fix-windows"],
deps = [
"//:bzl",
],
)
_BUILTINS_README = "# Built-in rules\n\nThese rules are available without any npm installation, via the `WORKSPACE` install of the `build_bazel_rules_nodejs` workspace. This is necessary to bootstrap Bazel to run the package manager to download other rules from NPM.\n\n"
# Ugly genrule depending on local linux environment to build the README out of skylark doc generation.
# Only referenced when we do a release.
# TODO: This ought to be possible with stardoc alone. Need to coordinate with Chris Parsons.
genrule(
name = "builtins_md",
srcs = [
":builtins.api",
":providers.api",
],
outs = ["builtins.doc"],
cmd = "echo '%s' > $@;" % _BUILTINS_README +
"cat $(location :builtins.api) | sed 's/^##/\\\n##/' >> $@ &&" +
"cat $(location :providers.api) | sed 's/^##/\\\n##/' >> $@",
tags = ["fix-windows"],
)
rules_nodejs_docs(
name = "docs",
assets = glob(["images/*"]),
config = "_config.yml",
css = "//docs/css",
docs = [
"search.md",
"install.md",
"repositories.md",
"debugging.md",
"dependencies.md",
"stamping.md",
"index.md",
"examples.md",
"changing-rules.md",
],
includes = glob(["_includes/*"]),
layouts = glob(["_layouts/*"]),
readmes = {
"Built-ins": ":builtins.doc",
"Cypress": "//packages/cypress:README.md",
"Jasmine": "//packages/jasmine:README.md",
"Karma": "//packages/karma:README.md",
"Labs": "//packages/labs:README.md",
"Protractor": "//packages/protractor:README.md",
"Rollup": "//packages/rollup:README.md",
"Terser": "//packages/terser:README.md",
"TypeScript": "//packages/typescript:README.md",
},
tags = [
"fix-windows",
"manual",
],
)