Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Unreleased

- Make prompt-lint and text-audit HTML reports readable on mobile screens, wrapping long paths and table content; identify the text-audit document language.

## 0.1.0

- Added the first productized CLI: `scan`, `doctor`, and `init`.
Expand Down
14 changes: 11 additions & 3 deletions src/prompt/promptYamlLint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,16 +193,24 @@ function formatPromptHtml(report: PromptLintReport): string {
const rows = report.results.map((result) => `<tr><td>${escapeHtml(result.status)}</td><td>${escapeHtml(result.check)}</td><td>${escapeHtml(result.message)}</td></tr>`).join("");
return `<!doctype html>
<html lang="en">
<head><meta charset="utf-8"><title>Prompt YAML Lint Report</title></head>
<body>
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>Prompt YAML Lint Report</title>
<style>
* { box-sizing: border-box; }
body { max-width: 960px; margin: 0 auto; padding: 24px; font: 16px/1.5 system-ui, sans-serif; overflow-wrap: anywhere; }
h1 { font-size: clamp(1.5rem, 5vw, 2rem); }
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
th, td { text-align: left; vertical-align: top; padding: 8px; border: 1px solid #d6dde8; }
th:first-child { width: 5.5rem; } th:nth-child(2) { width: 24%; }
</style></head>
<body><main>
<h1>Prompt YAML Lint Report</h1>
<p>Score: <strong>${report.score}/100</strong></p>
<p>File: <code>${escapeHtml(report.file)}</code></p>
<table>
<thead><tr><th>Status</th><th>Check</th><th>Message</th></tr></thead>
<tbody>${rows}</tbody>
</table>
</body>
</main></body>
</html>`;
}

Expand Down
10 changes: 9 additions & 1 deletion src/text/textAudit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,15 @@ ${rows}

function formatHtml(report: TextAuditReport): string {
const rows = report.results.map((item) => `<tr><td>${escapeHtml(item.status)}</td><td>${escapeHtml(item.check)}</td><td>${escapeHtml(item.message)}</td></tr>`).join("");
return `<!doctype html><html><head><meta charset="utf-8"><title>${escapeHtml(report.title)} Report</title></head><body><h1>${escapeHtml(report.title)} Report</h1><p>Score: ${report.score}/100</p><p>Profile: ${escapeHtml(report.profile)}</p><table><thead><tr><th>Status</th><th>Check</th><th>Message</th></tr></thead><tbody>${rows}</tbody></table></body></html>`;
return `<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>${escapeHtml(report.title)} Report</title>
<style>
* { box-sizing: border-box; }
body { max-width: 960px; margin: 0 auto; padding: 24px; font: 16px/1.5 system-ui, sans-serif; overflow-wrap: anywhere; }
h1 { font-size: clamp(1.5rem, 5vw, 2rem); }
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
th, td { text-align: left; vertical-align: top; padding: 8px; border: 1px solid #d6dde8; }
th:first-child { width: 5.5rem; } th:nth-child(2) { width: 24%; }
</style></head><body><main><h1>${escapeHtml(report.title)} Report</h1><p>Score: ${report.score}/100</p><p>Profile: ${escapeHtml(report.profile)}</p><table><thead><tr><th>Status</th><th>Check</th><th>Message</th></tr></thead><tbody>${rows}</tbody></table></main></body></html>`;
}

function formatAnnotations(report: TextAuditReport): string {
Expand Down
Loading