Skip to content

Commit e031cef

Browse files
committed
Add :html target
1 parent 1067fb6 commit e031cef

File tree

2 files changed

+22
-17
lines changed

2 files changed

+22
-17
lines changed

docs.bzl

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -176,20 +176,23 @@ def docs(source_dir = "docs", data = [], deps = []):
176176
data = data,
177177
)
178178

179-
sphinx_docs(
180-
name = "needs_json",
181-
srcs = [":docs_sources"],
182-
config = ":" + source_dir + "/conf.py",
183-
extra_opts = [
184-
"-W",
185-
"--keep-going",
186-
"-T", # show more details in case of errors
187-
"--jobs",
188-
"auto",
189-
"--define=external_needs_source=" + str(data),
190-
],
191-
formats = ["needs"],
192-
sphinx = ":sphinx_build",
193-
tools = data,
194-
visibility = ["//visibility:public"],
195-
)
179+
# Create sphinx_docs targets for different output formats
180+
formats = {"needs_json": "needs", "html": "html"}
181+
for target_name, format_type in formats.items():
182+
sphinx_docs(
183+
name = target_name,
184+
srcs = [":docs_sources"],
185+
config = ":" + source_dir + "/conf.py",
186+
extra_opts = [
187+
"-W",
188+
"--keep-going",
189+
"-T", # show more details in case of errors
190+
"--jobs",
191+
"auto",
192+
"--define=external_needs_source=" + str(data),
193+
],
194+
formats = [format_type],
195+
sphinx = ":sphinx_build",
196+
tools = data,
197+
visibility = ["//visibility:public"],
198+
)

docs/how-to/commands.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@
88
| `bazel run //:live_preview` | Creates a live_preview of the documentation viewable in a local server |
99
| `bazel run //:live_preview_combo_experimental` | Creates a live_preview of the full documentation with all dependencies viewable in a local server |
1010
| `bazel run //:ide_support` | Sets up a Python venv for esbonio (Remember to restart VS Code!) |
11+
| `bazel run //:html.serve` | Serves the generated HTML documentation on a local web server |
1112

1213
## Internal targets (do not use directly)
1314

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

0 commit comments

Comments
 (0)