Skip to content
Open
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
37 changes: 20 additions & 17 deletions docs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -176,20 +176,23 @@ def docs(source_dir = "docs", data = [], deps = []):
data = data,
)

sphinx_docs(
name = "needs_json",
srcs = [":docs_sources"],
config = ":" + source_dir + "/conf.py",
extra_opts = [
"-W",
"--keep-going",
"-T", # show more details in case of errors
"--jobs",
"auto",
"--define=external_needs_source=" + str(data),
],
formats = ["needs"],
sphinx = ":sphinx_build",
tools = data,
visibility = ["//visibility:public"],
)
# Create sphinx_docs targets for different output formats
formats = {"needs_json": "needs", "html": "html"}
for target_name, format_type in formats.items():
sphinx_docs(
name = target_name,
srcs = [":docs_sources"],
config = ":" + source_dir + "/conf.py",
extra_opts = [
"-W",
"--keep-going",
"-T", # show more details in case of errors
"--jobs",
"auto",
"--define=external_needs_source=" + str(data),
],
formats = [format_type],
sphinx = ":sphinx_build",
tools = data,
visibility = ["//visibility:public"],
)
2 changes: 2 additions & 0 deletions docs/how-to/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@
| `bazel run //:live_preview` | Creates a live_preview of the documentation viewable in a local server |
| `bazel run //:live_preview_combo_experimental` | Creates a live_preview of the full documentation with all dependencies viewable in a local server |
| `bazel run //:ide_support` | Sets up a Python venv for esbonio (Remember to restart VS Code!) |
| `bazel run //:html.serve` | Serves the generated HTML documentation on a local web server |

## Internal targets (do not use directly)

| Target | What it does |
| ----------------------------- | ------------------------------------------- |
| `bazel build //:needs_json` | Creates a 'needs.json' file |
| `bazel build //:docs_sources` | Provides all the documentation source files |
| `bazel build //:html` | Builds the documentation |
Loading