This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

papers / src / summary-page.ts
4.3 kB 121 lines
1export const SUMMARY_PAGE = `<!DOCTYPE html> 2<html lang="en"> 3<head> 4 <meta charset="utf-8"> 5 <meta name="viewport" content="width=device-width, initial-scale=1"> 6 <title>Paper Summary</title> 7 <style> 8 :root { 9 --bg: #0f0f0f; 10 --surface: #1a1a1a; 11 --text: #e0e0e0; 12 --dim: #888; 13 --accent: #6d9eeb; 14 --border: #333; 15 --mauve: #ce93d8; 16 } 17 * { box-sizing: border-box; margin: 0; padding: 0; } 18 body { 19 font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; 20 background: var(--bg); 21 color: var(--text); 22 line-height: 1.6; 23 padding: 2rem; 24 max-width: 760px; 25 margin: 0 auto; 26 } 27 a { color: var(--accent); text-decoration: none; } 28 a:hover { text-decoration: underline; } 29 header { margin-bottom: 2rem; } 30 header .back { font-size: 0.8125rem; color: var(--dim); margin-bottom: 0.5rem; } 31 h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.5rem; } 32 .meta { color: var(--dim); font-size: 0.875rem; margin-bottom: 1rem; } 33 .meta .venue-badge { 34 font-size: 0.6875rem; 35 padding: 0.125rem 0.375rem; 36 border-radius: 4px; 37 background: var(--mauve); 38 color: var(--bg); 39 font-weight: 600; 40 } 41 .domains { margin-bottom: 1rem; display: flex; gap: 0.375rem; flex-wrap: wrap; } 42 .domain { 43 font-size: 0.6875rem; 44 padding: 0.125rem 0.375rem; 45 border-radius: 4px; 46 background: var(--border); 47 color: var(--dim); 48 } 49 .abstract { 50 background: var(--surface); 51 border: 1px solid var(--border); 52 border-radius: 8px; 53 padding: 1rem 1.25rem; 54 margin-bottom: 1.5rem; 55 font-size: 0.9375rem; 56 } 57 .abstract h2 { font-size: 1rem; margin-bottom: 0.5rem; } 58 .summary-section h2 { font-size: 1.125rem; margin-bottom: 0.5rem; } 59 .summary-section p { margin-bottom: 0.75rem; } 60 .post-link { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--border); } 61 .post-link .label { font-size: 0.8125rem; color: var(--dim); } 62 .at-uri { font-family: monospace; font-size: 0.75rem; color: var(--dim); word-break: break-all; } 63 </style> 64</head> 65<body> 66 <header> 67 <div class="back"><a href="/">← All Papers</a></div> 68 <h1 id="title"></h1> 69 <div class="meta" id="meta"></div> 70 <div class="domains" id="domains"></div> 71 </header> 72 <div class="abstract" id="abstract-section" style="display:none"> 73 <h2>Abstract</h2> 74 <p id="abstract"></p> 75 </div> 76 <div class="summary-section"> 77 <h2>Summary</h2> 78 <p id="summary"></p> 79 </div> 80 <div class="post-link" id="post-link-section" style="display:none"> 81 <div class="label">Source Post</div> 82 <div class="at-uri" id="source-uri"></div> 83 </div> 84 <script> 85 const s = window.__SUMMARY__; 86 if (s) { 87 document.getElementById('title').textContent = s.title || 'Untitled'; 88 document.title = s.title || 'Paper Summary'; 89 90 const metaParts = []; 91 if (s.venue) metaParts.push('<span class="venue-badge">' + esc(s.venue) + '</span>'); 92 if (s.year) metaParts.push(s.year); 93 if (s.authors && s.authors.length) { 94 const a = s.authors.length <= 3 ? s.authors.join(', ') : s.authors[0] + ' et al.'; 95 metaParts.push(esc(a)); 96 } 97 if (s.posterHandle) metaParts.push('via @' + esc(s.posterHandle)); 98 if (s.paperUrl) metaParts.push('<a href="' + esc(s.paperUrl) + '">' + esc(s.paperUrl) + '</a>'); 99 document.getElementById('meta').innerHTML = metaParts.join(' · '); 100 101 if (s.domains && s.domains.length) { 102 document.getElementById('domains').innerHTML = s.domains.map(d => '<span class="domain">' + esc(d) + '</span>').join(''); 103 } 104 105 if (s.abstract) { 106 document.getElementById('abstract').textContent = s.abstract; 107 document.getElementById('abstract-section').style.display = ''; 108 } 109 110 document.getElementById('summary').textContent = s.summary || ''; 111 112 if (s.sourceUri) { 113 document.getElementById('source-uri').textContent = s.sourceUri; 114 document.getElementById('post-link-section').style.display = ''; 115 } 116 } 117 118 function esc(s) { return (s||'').replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/"/g,'&quot;'); } 119 </script> 120</body> 121</html>`;