feat(viewer): add PrintMode for browser print/PDF export
Adds RenderOptions.PrintMode flag. When true: - view.js (table filters) is not loaded - window.print() fires on page load - @media print CSS hides filters, collapses grid to single column, adds page-break hints for section cards Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -86,6 +86,7 @@ type RenderOptions struct {
|
||||
DownloadArchiveLabel string
|
||||
NoticeTitle string
|
||||
NoticeBody string
|
||||
PrintMode bool
|
||||
}
|
||||
|
||||
func RenderHTML(snapshot []byte, title string) ([]byte, error) {
|
||||
@@ -103,6 +104,7 @@ func RenderHTMLWithOptions(snapshot []byte, title string, opts RenderOptions) ([
|
||||
func buildPageData(snapshot []byte, title string, opts RenderOptions) (pageData, error) {
|
||||
page := pageData{
|
||||
Title: title,
|
||||
PrintMode: opts.PrintMode,
|
||||
NoticeTitle: strings.TrimSpace(opts.NoticeTitle),
|
||||
NoticeBody: strings.TrimSpace(opts.NoticeBody),
|
||||
DownloadArchiveURL: strings.TrimSpace(opts.DownloadArchiveURL),
|
||||
|
||||
Reference in New Issue
Block a user