jupyter_report
Rules
jupyter_report
load("@rules_jupyter//jupyter:jupyter_report.bzl", "jupyter_report")
jupyter_report(name, data, args, cwd_mode, env, exporter_args, notebook, out_html,
out_html_template_type, out_latex, out_latex_template_type, out_markdown, out_notebook,
out_rst, out_webpdf)
Executes a Jupyter notebook and generates reports in various formats (HTML, Markdown, LaTeX, PDF, RST, WebPDF).
ATTRIBUTES
| Name | Description | Type | Mandatory | Default |
|---|---|---|---|---|
| name | A unique name for this target. | Name | required | |
| data | Additional data files required by the notebook (e.g., input data files, images, configuration files). | List of labels | optional | [] |
| args | Additional command-line arguments to pass to the notebook execution. | List of strings | optional | [] |
| cwd_mode | The working directory mode for notebook execution. If not specified, uses the jupyter_toolchain.cwd. | String | optional | "" |
| env | Environment variables to set when executing the notebook. Values support location expansion (e.g., $(location :target)). | Dictionary: String -> String | optional | {} |
| exporter_args | Traitlets-style flags forwarded to nbconvert exporters (e.g. --WebPDFExporter.exclude_input=true). | List of strings | optional | [] |
| notebook | The notebook to execute and convert. Must be a jupyter_notebook target. | Label | required | |
| out_html | Output path for an HTML report. If specified, the notebook will be converted to HTML format. | Label; nonconfigurable | optional | None |
| out_html_template_type | Template type for HTML output. | String | optional | "" |
| out_latex | Output path for a LaTeX report. If specified, the notebook will be converted to LaTeX format. | Label; nonconfigurable | optional | None |
| out_latex_template_type | Template type for LaTeX output. | String | optional | "" |
| out_markdown | Output path for a Markdown report. If specified, the notebook will be converted to Markdown format. | Label; nonconfigurable | optional | None |
| out_notebook | Output path for the executed notebook (.ipynb file with cell outputs). If not specified, a default name is generated. | Label; nonconfigurable | optional | None |
| out_rst | Output path for a reStructuredText report. If specified, the notebook will be converted to RST format. | Label; nonconfigurable | optional | None |
| out_webpdf | Output path for a WebPDF report (generated via Playwright/Chromium). If specified, the notebook will be converted to PDF format using headless browser rendering. | Label; nonconfigurable | optional | None |