feat(reports): save the report as one HTML page as well (#1419)

- a saved report also includes complete_report.html: the report as one self-contained page with its sections listed beside the text, readable in a browser, on a phone and in print
- answering the save question at the prompt also asks about the page and offers to open it in a local browser window; --no-html and save_reports(..., html=False) skip it
- the Tauric Research logo leads the header at the top left, and a line at the foot credits TradingAgents and Tauric Research
- the page loads nothing and runs nothing (inline styles, a content-security policy); report text is rendered without raw HTML or images
- markdown-it-py is declared as a dependency
This commit is contained in:
Yijia-Xiao
2026-10-03 21:27:43 +00:00
parent d53b076b7a
commit 56a98d9df7
11 changed files with 820 additions and 93 deletions
+5 -1
View File
@@ -60,6 +60,10 @@ def analyze(
show: bool | None = typer.Option(
None, "--show/--no-show", help="Show the full report at the end without asking"
),
html: bool | None = typer.Option(
None, "--html/--no-html",
help="Save the report as one HTML page too, complete_report.html, without asking (default: yes)",
),
):
"""Run an analysis. This is what a bare `tradingagents` does.
@@ -81,7 +85,7 @@ def analyze(
raise typer.Exit(code=1) from None
try:
flags = {"ticker": ticker, "date": date, "analysts": analysts, "save": save, "show": show}
flags = {"ticker": ticker, "date": date, "analysts": analysts, "save": save, "show": show, "html": html}
run_analysis(checkpoint=checkpoint, portfolio=portfolio_context, flags=flags)
except _NO_CONSOLE_ERRORS:
# A terminal with no console buffer cannot host the interactive prompts.