-
Notifications
You must be signed in to change notification settings - Fork 16
Description
Problem
buckaroo.artifact.to_html() generates HTML that references static-embed.js and static-embed.css as sibling files. Users must manually locate and copy these from the installed package alongside their generated HTML, or the page won't render.
This is awkward for the simplest use case:
from buckaroo.artifact import to_html
import pandas as pd
html = to_html(pd.read_csv('data.csv'), title="My Data")
with open('my-data.html', 'w') as f:
f.write(html)
# Page doesn't work until you also run:
# cp $(python -c "...")/static/static-embed.* ./Possible solutions
-
Inline the JS/CSS —
to_html()could embed the bundle directly in the HTML via<script>and<style>tags. Makes the file ~1.3 MB larger but fully self-contained. Could be opt-in:to_html(df, inline_assets=True). -
Copy assets automatically —
to_html()or a companionto_html_dir()could write the HTML + assets to a directory. -
CDN reference — publish
static-embed.jsto a CDN (jsDelivr, unpkg) and reference it by URL. Each HTML file stays tiny, but requires internet access to view.
Option 1 (with an inline_assets flag) seems like the lowest-friction fix. Option 3 is the long-term goal per the content plan.
Context
Reported via Codex review on #641. The current workaround is documented in the embedding guide, but the default to_html() experience should just work.