10. HTML Report Output
Beyond exporting query results as CSV / Excel and other formats, Lantide Data can also convert a Report document into a standalone HTML report in one click, rendering a polished data-analysis result directly in the browser.
10.1 What Is HTML Report
An HTML Report is a standalone HTML file generated from a Report-type Markdown document. The AI Agent reads the Report content and, based on your chosen layout and style settings, produces a fully formatted HTML report. The resulting .html file is stored in the same directory as the original .md file and can be opened directly in a browser.
10.2 Generate an HTML Report
- Open a Report-type Markdown tab.
- On the tab toolbar, click the HTML Report dropdown button (globe icon).
- Choose Generate Report.
- The system first saves the current document, then opens the report configuration dialog.
- Adjust the configuration options, then click Generate.
- The AI panel opens automatically, and the Agent starts generating the HTML from the Report content and your configuration.
- When generation completes, the Open Report button on the toolbar becomes enabled automatically.
10.3 Report Configuration Options
The report configuration dialog offers the following options to control how the HTML report is presented. The desktop version uses a two-column layout: the left column holds layout and style options; the right column has Use CDN and Custom Script at the top, followed by Other Requirements. The mobile version keeps a single stacked column, with Cancel / Generate fixed at the bottom.
| Option | Choices | Description |
|---|---|---|
| Layout Mode | Standard / Presentation | Standard is a scrollable data report page; Presentation is a slide-style fullscreen show (left column) |
| Style Preset | Professional / Executive / Consulting | Suited respectively to a formal report, a KPI-dashboard style, and a strategy-consulting framework style (left column) |
| Color Scheme | Light / Dark / Corporate Blue / Neutral | The report's overall color scheme (left column) |
| Use CDN | On / Off | Standard + On always includes managed Chart.js (standard-chartjs); Presentation + On uses reveal.js; Off produces offline HTML |
| Custom Script | On / Off | Allows custom JavaScript such as D3 or Plotly. Each Generate requires risk acknowledgment; unavailable for Presentation. A yellow badge identifies these reports in the toolbar and Quick Edit |
| Other Requirements | Free text (max 2000 chars) | Below the toggles; type / to insert a User Skill snippet |
Tip: Presentation + CDN uses reveal.js; Presentation + CDN off uses pure CSS scroll-snap. Standard + CDN always includes Chart.js. Custom Script cannot be combined with Presentation.
10.4 View and Export the HTML Report
After generation completes, there are three ways to view the report:
- Toolbar: Click Open Report in the HTML Report dropdown to open the HTML file in your default browser.
- Toolbar export: Click Export HTML Report to copy the project's
.htmlto any local path via the system "Save As" dialog; on success it is located in Finder / File Explorer. Desktop (Electron) only; the export is the on-disk HTML snapshot as-is (a report using CDN still needs network when opened offline). - In AI chat: After the Agent finishes generating, an Open HTML Report button appears in the conversation; click it to open in the browser.
- Sidebar shortcut button: In the Projects section, a Report file that already has a generated HTML report shows a Globe icon button beside it; click it to open the corresponding HTML report directly in the browser, without opening the tab first.
10.5 Regenerate
If you have edited the Report content, or want to adjust the configuration and regenerate:
- Click the HTML Report dropdown on the toolbar → Re-generate Report.
- The system prompts you to confirm overwriting the existing HTML file.
- After you confirm, the configuration dialog opens again; the flow is the same as the first generation.
Re-generate and the block contract: Each Re-generate overwrites the entire .html and creates brand-new block IDs (text_id). If you had the Agent modify a text_id in an older conversation, that ID may be invalid after a Regenerate, and you will need to ask the Agent to re-read the report (read_html_text).
10.5.1 Post-Generation HTML Edits (AI Chat)
After generation, you can ask the Agent to fine-tune the report without regenerating, provided the project is focused and a matching .html file exists on disk (or you are triggering an html_report task via the toolbar Generate / Re-generate).
- Report tab: Send the edit request directly on that Report
.mdtab, and the Agent uses the block/style tools automatically. - Other tabs (SQL, chat, etc.): The Agent first calls
activate_html_editingto unlock the editing tools, then patches; if several reports in the project have HTML, name which one to edit in your message (e.g.02_report.md). - New conversation / new message: Like the statistical-analysis activator, each turn needs to re-activate or return to the Report tab; the edit mode is not remembered across turns.
- With only a
.mdand no.htmlyet on disk, the Agent can only usecreate_html_reportto create the report; the block/style patch tools are not exposed.
| What to change | Agent approach |
|---|---|
| Paragraph text, tables, card structure | Block tools: read_html_text → get_html_chunk_by_id → patch_html_chunk_by_id |
Chart.js charts (standard-chartjs report) |
get_html_chunk_by_id to read data-chart-spec → edit the JSON → patch_html_chunk_by_id; then re-open Report (or refresh the browser) to redraw the chart |
Colors, .card appearance, :root variables, and other global CSS |
Style tools: get_html_styles → patch_html_styles (editing <style id="report-styles">) |
| Custom Script JavaScript | get_html_scripts → patch_html_scripts by data-script-id; never put <script> inside an editable block, and managed Chart.js scripts cannot be edited |
We suggest changing styles first, then the block HTML, to avoid adding a class with no matching CSS. In Chart.js reports, chart colors are applied automatically from :root's --primary / --accent (if the spec does not specify a palette).
- Legacy HTML without a contract (no
data-report-contract="1"): neither block nor style tools are available—please Re-generate. - Has a contract but lacks
#report-styles(an early chunk-version artifact): block tools still work; style tools fail—please Re-generate to enable style editing. - Overall layout, CDN / Custom Script settings, or a legacy contract: use Re-generate, not patching alone.
10.5.2 Quick Edit HTML (Manual Block Editing)
After an HTML report has been generated, open the editing dialog from the Report tab toolbar via HTML Report → Quick Edit HTML to modify a single block's content without going through AI chat.
Flow:
- The left side lists each block as a card (
desc,kind, text snippet); select a card. - On the right, Monaco edits that block's inner HTML (without the outer
data-text-idwrapper tag). - Click Save or press Cmd/Ctrl+S to write to disk. On a successful save, the editor automatically syncs to the server-normalized HTML (whitespace and tag formatting may differ slightly from what you typed—this is normal).
- Click Open Live Preview to open a local preview page in your default browser; after a successful Save, the preview page reloads automatically within about 2 seconds (keep that tab open).
Differences from AI editing:
| Item | Quick Edit | AI patch_html_chunk_by_id |
|---|---|---|
| Concurrency protection | Save must carry content_hash; a stale hash returns 409—reload the block |
Does not check the hash; may overwrite content you just edited manually |
| While the Agent is running | Cannot open Quick Edit; if the dialog is already open, Save is paused | Can keep running |
| Global CSS | Not edited in this dialog; use AI patch_html_styles or Re-generate |
Supports patch_html_styles |
Live Preview and security: Preview uses a separate local origin with a short-lived capability token bound to this report. It does not share the main API origin. Quick Edit marks Custom Script reports and warns that their runtime can cover the page; do not expose the main API publicly.
Re-generate overwrites manual edits and resets all text_ids.
10.6 Button Disable Conditions
| Situation | Affected buttons | Hint |
|---|---|---|
| AI Agent is running | Generate / Re-generate, Open Report, Quick Edit HTML | Agent is busy |
| Plan is in Executing state | Generate / Re-generate | Plan is executing |
| No HTML file generated yet | Open Report, Export HTML Report, Quick Edit HTML | Nothing to open / edit |
Note: The HTML Report feature applies only to Report-type Markdown documents, not to Plans.
[Image] Report configuration dialog and HTML Report toolbar buttons
Design note: For HTML deliverable positioning, see Data analysis workflow in the Agent era §4; for the contract and tools, see AI Agent architecture §7.